diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/.vsixmanifest b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/.vsixmanifest new file mode 100644 index 00000000..9a44ec8e --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/.vsixmanifest @@ -0,0 +1,35 @@ + + + + + Dockerfile and Docker Compose File (yml) Support + Adds syntax highlighting, snippets and description on hover for Dockerfiles and Docker compose files. + snippet,dockerfile,Dockerfile,yaml + Languages + Public + + + + + + + + + + + + + + + extension/LICENSE.md + extension/images/docker_icon.svg + + + + + + + + + + diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/LICENSE.md b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/LICENSE.md new file mode 100644 index 00000000..28622332 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/LICENSE.md @@ -0,0 +1,13 @@ +Visual Studio Code Extension for Docker + +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +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/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/README.md b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/README.md new file mode 100644 index 00000000..7e89a1fc --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/README.md @@ -0,0 +1,30 @@ +## Docker Extension for Visual Studio Code +------------------- +## Functionality +This extension adds syntax highlighting, snippets and additional intellisense for Dockerfiles and docker-compose files in Visual Studio Code. Hovering over +commands in your Dockerfile will show you additional information about commands and images. + +![dockerfile](https://github.com/Microsoft/vscode-docker/raw/master/images/dockerfile.gif) + +Similar functionality is available for docker compose files: + +![composefile](https://github.com/Microsoft/vscode-docker/raw/master/images/dockercompose.gif) + +## Install +Open up Visual Studio Code, press F1 and type `ext install` and select **Dockerfile and Docker Compose File (yml) Support**. Once extension is installed you will +be prompted to restart Visual Studio Code. + +![installation](https://github.com/Microsoft/vscode-docker/raw/master/images/installing.gif) + +## Contributing +There are a couple of ways you can contribute to this repo: + +- Ideas, feature requests and bugs: We are open to all ideas and we want to get rid of bugs! Use the Issues section to either report a new issue, provide your ideas or contribute to existing threads +- Documentation: Found a typo or strangely worded sentences? Submit a PR! +- Code: Contribute bug fixes, features or design changes. + +## Legal +Before we can accept your pull request you will need to sign a **Contribution License Agreement**. All you need to do is to submit a pull request, then the PR will get appropriately labelled (e.g. `cla-required`, `cla-norequired`, `cla-signed`, `cla-already-signed`). If you already signed the agreement we will continue with reviewing the PR, otherwise system will tell you how you can sign the CLA. Once you sign the CLA all future PR's will be labeled as `cla-signed`. + +## License +[MIT](https://github.com/Microsoft/vscode-docker/blob/master/LICENSE) \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/docker_icon.svg b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/docker_icon.svg new file mode 100644 index 00000000..bec2539c --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/docker_icon.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/dockercompose.gif b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/dockercompose.gif new file mode 100644 index 00000000..c5b9cba5 Binary files /dev/null and b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/dockercompose.gif differ diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/dockerfile.gif b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/dockerfile.gif new file mode 100644 index 00000000..1d36c3fd Binary files /dev/null and b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/dockerfile.gif differ diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/installing.gif b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/installing.gif new file mode 100644 index 00000000..09f6c345 Binary files /dev/null and b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/images/installing.gif differ diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeCompletionItemProvider.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeCompletionItemProvider.js new file mode 100644 index 00000000..fb74eea5 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeCompletionItemProvider.js @@ -0,0 +1,55 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var vscode_1 = require('vscode'); +var helper = require('../helpers/suggestSupportHelper'); +var dockerComposeKeyInfo_1 = require('./dockerComposeKeyInfo'); +var DockerComposeCompletionItemProvider = (function () { + function DockerComposeCompletionItemProvider() { + this.triggerCharacters = []; + this.excludeTokens = []; + } + DockerComposeCompletionItemProvider.prototype.provideCompletionItems = function (document, position, token) { + var yamlSuggestSupport = new helper.SuggestSupportHelper(); + // Get the line where intellisense was invoked on (e.g. 'image: u'). + var line = document.lineAt(position.line).text; + if (line.length === 0) { + // empty line + return Promise.resolve(this.suggestKeys('')); + } + var range = document.getWordRangeAtPosition(position); + // Get the text where intellisense was invoked on (e.g. 'u'). + var word = range && document.getText(range) || ''; + var textBefore = line.substring(0, position.character); + if (/^\s*[\w_]*$/.test(textBefore)) { + // on the first token + return Promise.resolve(this.suggestKeys(word)); + } + // Matches strings like: 'image: "ubuntu' + var imageTextWithQuoteMatchYaml = textBefore.match(/^\s*image\s*\:\s*"([^"]*)$/); + if (imageTextWithQuoteMatchYaml) { + var imageText = imageTextWithQuoteMatchYaml[1]; + return yamlSuggestSupport.suggestImages(imageText); + } + // Matches strings like: 'image: ubuntu' + var imageTextWithoutQuoteMatch = textBefore.match(/^\s*image\s*\:\s*([\w\:\/]*)/); + if (imageTextWithoutQuoteMatch) { + var imageText = imageTextWithoutQuoteMatch[1]; + return yamlSuggestSupport.suggestImages(imageText); + } + return Promise.resolve([]); + }; + DockerComposeCompletionItemProvider.prototype.suggestKeys = function (word) { + return Object.keys(dockerComposeKeyInfo_1.DOCKER_COMPOSE_KEY_INFO).map(function (ruleName) { + var completionItem = new vscode_1.CompletionItem(ruleName); + completionItem.kind = vscode_1.CompletionItemKind.Keyword; + completionItem.insertText = ruleName + ': '; + completionItem.documentation = dockerComposeKeyInfo_1.DOCKER_COMPOSE_KEY_INFO[ruleName]; + return completionItem; + }); + }; + return DockerComposeCompletionItemProvider; +}()); +exports.DockerComposeCompletionItemProvider = DockerComposeCompletionItemProvider; +//# sourceMappingURL=dockerComposeCompletionItemProvider.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeKeyInfo.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeKeyInfo.js new file mode 100644 index 00000000..799ebe10 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeKeyInfo.js @@ -0,0 +1,51 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +"use strict"; +// https://docs.docker.com/compose/yml/ +exports.DOCKER_COMPOSE_KEY_INFO = { + 'image': ("Tag or partial image ID. Can be local or remote - Compose will attempt to pull if it doesn't exist locally."), + 'build': ("Path to a directory containing a Dockerfile. When the value supplied is a relative path, it is interpreted as relative to the " + + "location of the yml file itself. This directory is also the build context that is sent to the Docker daemon.\n\n" + + "Compose will build and tag it with a generated name, and use that image thereafter."), + 'command': ("Override the default command."), + 'links': ("Link to containers in another service. Either specify both the service name and the link alias (`CONTAINER:ALIAS`), or " + + "just the service name (which will also be used for the alias)."), + 'external_links': ("Link to containers started outside this `docker-compose.yml` or even outside of Compose, especially for containers that " + + "provide shared or common services. `external_links` follow " + + "semantics similar to `links` when specifying both the container name and the link alias (`CONTAINER:ALIAS`)."), + 'ports': ("Expose ports. Either specify both ports (`HOST:CONTAINER`), or just the container port (a random host port will be chosen).\n\n" + + "**Note**: When mapping ports in the `HOST:CONTAINER` format, you may experience erroneous results when using a container port " + + "lower than 60, because YAML will parse numbers in the format `xx:yy` as sexagesimal (base 60). For this reason, we recommend " + + "always explicitly specifying your port mappings as strings."), + 'expose': ("Expose ports without publishing them to the host machine - they'll only be accessible to linked services. \n" + + "Only the internal port can be specified."), + 'volumes': ("Mount paths as volumes, optionally specifying a path on the host machine (`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`)."), + 'volumes_from': ("Mount all of the volumes from another service or container."), + 'environment': ("Add environment variables. You can use either an array or a dictionary.\n\n" + + "Environment variables with only a key are resolved to their values on the machine Compose is running on, which can be helpful for secret or host-specific values."), + 'env_file': ("Add environment variables from a file. Can be a single value or a list.\n\n" + + "If you have specified a Compose file with `docker-compose -f FILE`, paths in `env_file` are relative to the directory that file is in.\n\n" + + "Environment variables specified in `environment` override these values."), + 'net': ("Networking mode. Use the same values as the docker client `--net` parameter."), + 'pid': ("Sets the PID mode to the host PID mode. This turns on sharing between container and the host operating system the PID address space. " + + "Containers launched with this flag will be able to access and manipulate other containers in the bare-metal machine's namespace and vise-versa."), + 'dns': ("Custom DNS servers. Can be a single value or a list."), + 'cap_add': ("Add or drop container capabilities. See `man 7 capabilities` for a full list."), + 'cap_drop': ("Add or drop container capabilities. See `man 7 capabilities` for a full list."), + 'dns_search': ("Custom DNS search domains. Can be a single value or a list."), + 'cgroup_parent': ("Specify an optional parent cgroup for the container."), + 'container_name': ("Specify custom container name, rather than a generated default name."), + 'devices': ("List of device mappings. Uses the same format as the `--device` docker client create option."), + 'dockerfile': ("Alternate dockerfile. Compose will use an alternate file to build with. Using `dockerfile` together with `image` is not allowed. Attempting to do so results in an error."), + 'extends': ("Extend another service, in the current file or another, optionally overriding configuration.\nYou can use `extends` on any service together with other configuration keys. " + + "The `extends` value must be a dictionary defined with a required `service` and an optional `file` key."), + 'extra_hosts': ("Add hostname mappings. Use the same values as the docker client `--add-host` parameter."), + 'labels': ("Add metadata to containers using Docker labels. You can either use an array or a dictionary.\n" + + "It's recommended that you use reverse-DNS notation to prevent your labels from conflicting with those used by other software."), + 'log_driver': ("Specify a logging driver for the service's containers, as with the `--log-driver` option for docker run. The default value is json-file."), + 'log_opt': ("Specify logging options with `log_opt` for the logging driver, as with the `--log-opt` option for docker run."), + 'security_opt': ("Override the default labeling scheme for each container."), + 'volume_driver': ("If you use a volume name (instead of a volume path), you may also specify a `volume_driver`.") +}; +//# sourceMappingURL=dockerComposeKeyInfo.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeParser.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeParser.js new file mode 100644 index 00000000..890de4e8 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerCompose/dockerComposeParser.js @@ -0,0 +1,75 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var parser_1 = require('../parser'); +var DockerComposeParser = (function (_super) { + __extends(DockerComposeParser, _super); + function DockerComposeParser() { + var parseRegex = /\:+$/g; + _super.call(this, parseRegex); + } + DockerComposeParser.prototype.parseLine = function (textLine) { + var r = []; + var lastTokenEndIndex = 0, lastPushedToken = null; + var emit = function (end, type) { + if (end <= lastTokenEndIndex) { + return; + } + if (lastPushedToken && lastPushedToken.type === type) { + // merge with last pushed token + lastPushedToken.endIndex = end; + lastTokenEndIndex = end; + return; + } + lastPushedToken = { + startIndex: lastTokenEndIndex, + endIndex: end, + type: type + }; + r.push(lastPushedToken); + lastTokenEndIndex = end; + }; + var inString = false; + var idx = textLine.firstNonWhitespaceCharacterIndex; + var line = textLine.text; + for (var i = idx, len = line.length; i < len; i++) { + var ch = line.charAt(i); + if (inString) { + if (ch === '"' && line.charAt(i - 1) !== '\\') { + inString = false; + emit(i + 1, parser_1.TokenType.String); + } + continue; + } + if (ch === '"') { + emit(i, parser_1.TokenType.Text); + inString = true; + continue; + } + if (ch === '#') { + // Comment the rest of the line + emit(i, parser_1.TokenType.Text); + emit(line.length, parser_1.TokenType.Comment); + break; + } + if (ch === ':') { + emit(i + 1, parser_1.TokenType.Key); + } + if (ch === ' ' || ch === '\t') { + emit(i, parser_1.TokenType.Text); + emit(i + 1, parser_1.TokenType.Whitespace); + } + } + emit(line.length, parser_1.TokenType.Text); + return r; + }; + return DockerComposeParser; +}(parser_1.Parser)); +exports.DockerComposeParser = DockerComposeParser; +//# sourceMappingURL=dockerComposeParser.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerExtension.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerExtension.js new file mode 100644 index 00000000..2ada3c8c --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerExtension.js @@ -0,0 +1,24 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +"use strict"; +var dockerHoverProvider_1 = require('./dockerHoverProvider'); +var dockerfileCompletionItemProvider_1 = require('./dockerfile/dockerfileCompletionItemProvider'); +var dockerComposeCompletionItemProvider_1 = require('./dockerCompose/dockerComposeCompletionItemProvider'); +var dockerfileKeyInfo_1 = require('./dockerfile/dockerfileKeyInfo'); +var dockerComposeKeyInfo_1 = require('./dockerCompose/dockerComposeKeyInfo'); +var dockerComposeParser_1 = require('./dockerCompose/dockerComposeParser'); +var dockerfileParser_1 = require('./dockerfile/dockerfileParser'); +var vscode = require('vscode'); +function activate(ctx) { + var DOCKERFILE_MODE_ID = { language: 'dockerfile', scheme: 'file' }; + var dockerHoverProvider = new dockerHoverProvider_1.DockerHoverProvider(new dockerfileParser_1.DockerfileParser(), dockerfileKeyInfo_1.DOCKERFILE_KEY_INFO); + ctx.subscriptions.push(vscode.languages.registerHoverProvider(DOCKERFILE_MODE_ID, dockerHoverProvider)); + ctx.subscriptions.push(vscode.languages.registerCompletionItemProvider(DOCKERFILE_MODE_ID, new dockerfileCompletionItemProvider_1.DockerfileCompletionItemProvider(), '.')); + var YAML_MODE_ID = { language: 'yaml', scheme: 'file', pattern: '**/docker-compose*.yml' }; + var yamlHoverProvider = new dockerHoverProvider_1.DockerHoverProvider(new dockerComposeParser_1.DockerComposeParser(), dockerComposeKeyInfo_1.DOCKER_COMPOSE_KEY_INFO); + ctx.subscriptions.push(vscode.languages.registerHoverProvider(YAML_MODE_ID, yamlHoverProvider)); + ctx.subscriptions.push(vscode.languages.registerCompletionItemProvider(YAML_MODE_ID, new dockerComposeCompletionItemProvider_1.DockerComposeCompletionItemProvider(), '.')); +} +exports.activate = activate; +//# sourceMappingURL=dockerExtension.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerHoverProvider.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerHoverProvider.js new file mode 100644 index 00000000..9159c379 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerHoverProvider.js @@ -0,0 +1,68 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var vscode_1 = require('vscode'); +var parser = require('./parser'); +var suggestHelper = require('./helpers/suggestSupportHelper'); +var DockerHoverProvider = (function () { + // Provide the parser you want to use as well as keyinfo dictionary. + function DockerHoverProvider(wordParser, keyInfo) { + this._parser = wordParser; + this._keyInfo = keyInfo; + } + DockerHoverProvider.prototype.provideHover = function (document, position, token) { + var line = document.lineAt(position.line); + if (line.text.length === 0) { + return Promise.resolve(null); + } + var tokens = this._parser.parseLine(line); + return this._computeInfoForLineWithTokens(line.text, tokens, position); + }; + DockerHoverProvider.prototype._computeInfoForLineWithTokens = function (line, tokens, position) { + var _this = this; + var possibleTokens = this._parser.tokensAtColumn(tokens, position.character); + return Promise.all(possibleTokens.map(function (tokenIndex) { return _this._computeInfoForToken(line, tokens, tokenIndex); })).then(function (results) { + return possibleTokens.map(function (tokenIndex, arrayIndex) { + return { + startIndex: tokens[tokenIndex].startIndex, + endIndex: tokens[tokenIndex].endIndex, + result: results[arrayIndex] + }; + }); + }).then(function (results) { + var r = results.filter(function (r) { return !!r.result; }); + if (r.length === 0) { + return null; + } + var range = new vscode_1.Range(position.line, r[0].startIndex, position.line, r[0].endIndex); + r[0].result.then(function (t) { + var hover = new vscode_1.Hover(t, range); + return hover; + }); + }); + }; + DockerHoverProvider.prototype._computeInfoForToken = function (line, tokens, tokenIndex) { + // ------------- + // Detect hovering on a key + if (tokens[tokenIndex].type === parser.TokenType.Key) { + var keyName = this._parser.keyNameFromKeyToken(this._parser.tokenValue(line, tokens[tokenIndex])).trim(); + var r = this._keyInfo[keyName]; + if (r) { + return Promise.resolve([r]); + } + } + // ------------- + // Detect <> + // Detect <> + var helper = new suggestHelper.SuggestSupportHelper(); + var r2 = helper.getImageNameHover(line, this._parser, tokens, tokenIndex); + if (r2) { + return r2; + } + return null; + }; + return DockerHoverProvider; +}()); +exports.DockerHoverProvider = DockerHoverProvider; +//# sourceMappingURL=dockerHoverProvider.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerHubApi.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerHubApi.js new file mode 100644 index 00000000..282c1354 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerHubApi.js @@ -0,0 +1,119 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var https = require('https'); +function tagsForImage(image) { + var tags = []; + if (image.is_automated) { + tags.push('Automated'); + } + else if (image.is_trusted) { + tags.push('Trusted'); + } + else if (image.is_official) { + tags.push('Official'); + } + if (tags.length > 0) { + return '[' + tags.join('] [') + ']'; + } + return ''; +} +exports.tagsForImage = tagsForImage; +function searchImageInRegistryHub(imageName, cache) { + return invokeHubSearch(imageName, 1, cache).then(function (data) { + if (data.results.length === 0) { + return null; + } + return data.results[0]; + }); +} +exports.searchImageInRegistryHub = searchImageInRegistryHub; +var popular = [ + { "is_automated": false, "name": "redis", "is_trusted": false, "is_official": true, "star_count": 1300, "description": "Redis is an open source key-value store that functions as a data structure server." }, + { "is_automated": false, "name": "ubuntu", "is_trusted": false, "is_official": true, "star_count": 2600, "description": "Ubuntu is a Debian-based Linux operating system based on free software." }, + { "is_automated": false, "name": "wordpress", "is_trusted": false, "is_official": true, "star_count": 582, "description": "The WordPress rich content management system can utilize plugins, widgets, and themes." }, + { "is_automated": false, "name": "mysql", "is_trusted": false, "is_official": true, "star_count": 1300, "description": "MySQL is a widely used, open-source relational database management system (RDBMS)." }, + { "is_automated": false, "name": "mongo", "is_trusted": false, "is_official": true, "star_count": 1100, "description": "MongoDB document databases provide high availability and easy scalability." }, + { "is_automated": false, "name": "centos", "is_trusted": false, "is_official": true, "star_count": 1600, "description": "The official build of CentOS." }, + { "is_automated": false, "name": "node", "is_trusted": false, "is_official": true, "star_count": 1200, "description": "Node.js is a JavaScript-based platform for server-side and networking applications." }, + { "is_automated": false, "name": "nginx", "is_trusted": false, "is_official": true, "star_count": 1600, "description": "Official build of Nginx." }, + { "is_automated": false, "name": "postgres", "is_trusted": false, "is_official": true, "star_count": 1200, "description": "The PostgreSQL object-relational database system provides reliability and data integrity." }, + { "is_automated": true, "name": "microsoft/aspnet", "is_trusted": true, "is_official": false, "star_count": 277, "description": "ASP.NET is an open source server-side Web application framework" } +]; +function searchImagesInRegistryHub(prefix, cache) { + if (prefix.length === 0) { + // return the popular images if user invoked intellisense + // right after typing the keyword and ':' (e.g. 'image:'). + return Promise.resolve(popular.slice(0)); + } + // Do an image search on Docker hub and return the results + return invokeHubSearch(prefix, 100, cache).then(function (data) { + return data.results; + }); +} +exports.searchImagesInRegistryHub = searchImagesInRegistryHub; +// https://registry.hub.docker.com/v1/search?q=redis&n=1 +// { +// "num_pages": 10, +// "num_results": 10, +// "results": [ +// { +// "is_automated": false, +// "name": "redis", +// "is_trusted": false, +// "is_official": true, +// "star_count": 830, +// "description": "Redis is an open source key-value store that functions as a data structure server." +// } +// ], +// "page_size": 1, +// "query": "redis", +// "page": 1 +// } +function invokeHubSearch(imageName, count, cache) { + // https://registry.hub.docker.com/v1/search?q=redis&n=1 + return fetchHttpsJson({ + hostname: 'registry.hub.docker.com', + port: 443, + path: '/v1/search?q=' + encodeURIComponent(imageName) + '&n=' + count, + method: 'GET', + }, cache); +} +var JSON_CACHE = {}; +function fetchHttpsJson(opts, cache) { + if (!cache) { + return doFetchHttpsJson(opts); + } + var cache_key = (opts.method + ' ' + opts.hostname + ' ' + opts.path); + if (!JSON_CACHE[cache_key]) { + JSON_CACHE[cache_key] = doFetchHttpsJson(opts); + } + // new promise to avoid cancelling + return new Promise(function (resolve, reject) { + JSON_CACHE[cache_key].then(resolve, reject); + }); +} +function doFetchHttpsJson(opts) { + opts.headers = opts.headers || {}; + opts.headers['Accept'] = 'application/json'; + return httpsRequestAsPromise(opts).then(function (data) { + return JSON.parse(data); + }); +} +function httpsRequestAsPromise(opts) { + return new Promise(function (resolve, reject) { + var req = https.request(opts, function (res) { + var data = ''; + res.on('data', function (d) { + data += d; + }); + res.on('end', function () { + resolve(data); + }); + }); + req.end(); + req.on('error', reject); + }); +} +//# sourceMappingURL=dockerHubApi.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileCompletionItemProvider.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileCompletionItemProvider.js new file mode 100644 index 00000000..d1cc9083 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileCompletionItemProvider.js @@ -0,0 +1,25 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var helper = require('../helpers/suggestSupportHelper'); +// IntelliSense +var DockerfileCompletionItemProvider = (function () { + function DockerfileCompletionItemProvider() { + this.triggerCharacters = []; + this.excludeTokens = []; + } + DockerfileCompletionItemProvider.prototype.provideCompletionItems = function (document, position, token) { + var dockerSuggestSupport = new helper.SuggestSupportHelper(); + var textLine = document.lineAt(position.line); + // Matches strings like: 'FROM imagename' + var fromTextDocker = textLine.text.match(/^\s*FROM\s*([^"]*)$/); + if (fromTextDocker) { + return dockerSuggestSupport.suggestImages(fromTextDocker[1]); + } + return Promise.resolve([]); + }; + return DockerfileCompletionItemProvider; +}()); +exports.DockerfileCompletionItemProvider = DockerfileCompletionItemProvider; +//# sourceMappingURL=dockerfileCompletionItemProvider.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileKeyInfo.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileKeyInfo.js new file mode 100644 index 00000000..36e9c18b --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileKeyInfo.js @@ -0,0 +1,27 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +"use strict"; +// https://docs.docker.com/reference/builder/ +exports.DOCKERFILE_KEY_INFO = { + 'FROM': ("Sets the **Base Image** for subsequent instructions."), + 'MAINTAINER': ("Set the **Author** field of the generated images."), + 'RUN': ("Executes any commands in a new layer on top of the current image and commits the results."), + 'CMD': ("Provides defaults for an executing container."), + 'LABEL': ("Adds metadata to an image. A **LABEL** is a key-value pair."), + 'EXPOSE': ("Informs Docker that the container will listen on the specified network ports at runtime."), + 'ENV': ("Sets the environment variable `key` to the value `value`."), + 'ADD': ("The **ADD** instruction copies new files, directories or remote file URLs from `src` and adds them " + + "to the filesystem of the container at the path `dest`."), + 'COPY': ("Copies new files or directories from `src` and adds them to the filesystem of the container at the path `dest`."), + 'ENTRYPOINT': ("Configures a container that will run as an executable."), + 'VOLUME': ("Creates a mount point with the specified name and marks it as holding externally mounted volumes " + + "from native host or other containers."), + 'USER': ("Sets the user name or UID to use when running the image and for any `RUN`, `CMD` and `ENTRYPOINT` " + + "instructions that follow it in the Dockerfile."), + 'WORKDIR': ("Sets the working directory for any `RUN`, `CMD`, `ENTRYPOINT`, `COPY` and `ADD` instructions that follow it in the Dockerfile."), + 'ONBUILD': ("Adds to the image a trigger instruction to be executed at a later time, when the image is used as the " + + "base for another build."), + 'STOPSIGNAL': ("Sets the system call signal that will be sent to the container to exit.") +}; +//# sourceMappingURL=dockerfileKeyInfo.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileParser.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileParser.js new file mode 100644 index 00000000..2248624e --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/dockerfile/dockerfileParser.js @@ -0,0 +1,51 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var parser_1 = require('../parser'); +var DockerfileParser = (function (_super) { + __extends(DockerfileParser, _super); + function DockerfileParser() { + var parseRegex = /\ +$/g; + _super.call(this, parseRegex); + } + DockerfileParser.prototype.parseLine = function (textLine) { + if (textLine.isEmptyOrWhitespace) { + return null; + } + var startIndex = textLine.firstNonWhitespaceCharacterIndex; + // Check for comment + if (textLine.text.charAt(startIndex) === '#') { + return null; + } + var tokens = []; + var previousTokenIndex = 0; + var keyFound = false; + for (var j = startIndex, len = textLine.text.length; j < len; j++) { + var ch = textLine.text.charAt(j); + if (ch === ' ' || ch === '\t') { + previousTokenIndex = j; + tokens.push({ + startIndex: 0, + endIndex: j, + type: parser_1.TokenType.Key + }); + break; + } + } + tokens.push({ + startIndex: previousTokenIndex, + endIndex: textLine.text.length, + type: parser_1.TokenType.String + }); + return tokens; + }; + return DockerfileParser; +}(parser_1.Parser)); +exports.DockerfileParser = DockerfileParser; +//# sourceMappingURL=dockerfileParser.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/helpers/suggestSupportHelper.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/helpers/suggestSupportHelper.js new file mode 100644 index 00000000..b196bc87 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/helpers/suggestSupportHelper.js @@ -0,0 +1,90 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var vscode = require('vscode'); +var hub = require('../dockerHubApi'); +var parser = require('../parser'); +var SuggestSupportHelper = (function () { + function SuggestSupportHelper() { + } + SuggestSupportHelper.prototype.suggestImages = function (word) { + return hub.searchImagesInRegistryHub(word, true).then(function (results) { + return results.map(function (image) { + var stars = ''; + if (image.star_count > 0) { + stars = ' ' + image.star_count + ' ' + (image.star_count > 1 ? 'stars' : 'star'); + } + return { + label: image.name, + kind: vscode.CompletionItemKind.Value, + detail: hub.tagsForImage(image) + stars, + insertText: image.name, + documentation: image.description, + }; + }); + }); + }; + SuggestSupportHelper.prototype.searchImageInRegistryHub = function (imageName) { + return hub.searchImageInRegistryHub(imageName, true).then(function (result) { + if (result) { + var r = []; + var tags = hub.tagsForImage(result); + // Name, tags and stars. + var nameString = ''; + if (tags.length > 0) { + nameString = '**' + result.name + ' ' + tags + '** '; + } + else { + nameString = '**' + result.name + '**'; + } + if (result.star_count) { + var plural = (result.star_count > 1); + nameString += '**' + String(result.star_count) + (plural ? ' stars' : ' star') + '**'; + } + r.push(nameString); + // Description + r.push(result.description); + return r; + } + }); + }; + SuggestSupportHelper.prototype.getImageNameHover = function (line, _parser, tokens, tokenIndex) { + // ------------- + // Detect <> + // Detect <> + var originalValue = _parser.tokenValue(line, tokens[tokenIndex]); + var keyToken = null; + tokenIndex--; + while (tokenIndex >= 0) { + var type = tokens[tokenIndex].type; + if (type === parser.TokenType.String || type === parser.TokenType.Text) { + return null; + } + if (type === parser.TokenType.Key) { + keyToken = _parser.tokenValue(line, tokens[tokenIndex]); + break; + } + tokenIndex--; + } + if (!keyToken) { + return null; + } + var keyName = _parser.keyNameFromKeyToken(keyToken); + if (keyName === 'image' || keyName === 'FROM') { + var imageName = originalValue.replace(/^"/, '').replace(/"$/, ''); + return this.searchImageInRegistryHub(imageName).then(function (results) { + if (results[0] && results[1]) { + return ['**DockerHub:**', results[0], '**DockerRuntime**', results[1]]; + } + if (results[0]) { + return results[0]; + } + return results[1]; + }); + } + }; + return SuggestSupportHelper; +}()); +exports.SuggestSupportHelper = SuggestSupportHelper; +//# sourceMappingURL=suggestSupportHelper.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/parser.js b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/parser.js new file mode 100644 index 00000000..cc38e0dc --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/out/parser.js @@ -0,0 +1,40 @@ +/*--------------------------------------------------------- + * Copyright (C) Microsoft Corporation. All rights reserved. + *--------------------------------------------------------*/ +'use strict'; +var Parser = (function () { + function Parser(parseTokenRegex) { + this._tokenParseRegex = parseTokenRegex; + } + Parser.prototype.keyNameFromKeyToken = function (keyToken) { + return keyToken.replace(this._tokenParseRegex, ''); + }; + Parser.prototype.tokenValue = function (line, token) { + return line.substring(token.startIndex, token.endIndex); + }; + Parser.prototype.tokensAtColumn = function (tokens, charIndex) { + for (var i = 0, len = tokens.length; i < len; i++) { + var token = tokens[i]; + if (token.endIndex < charIndex) { + continue; + } + if (token.endIndex === charIndex && i + 1 < len) { + return [i, i + 1]; + } + return [i]; + } + // should not happen: no token found? => return the last one + return [tokens.length - 1]; + }; + return Parser; +}()); +exports.Parser = Parser; +(function (TokenType) { + TokenType[TokenType["Whitespace"] = 0] = "Whitespace"; + TokenType[TokenType["Text"] = 1] = "Text"; + TokenType[TokenType["String"] = 2] = "String"; + TokenType[TokenType["Comment"] = 3] = "Comment"; + TokenType[TokenType["Key"] = 4] = "Key"; +})(exports.TokenType || (exports.TokenType = {})); +var TokenType = exports.TokenType; +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/package.json b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/package.json new file mode 100644 index 00000000..2c004834 --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/package.json @@ -0,0 +1,70 @@ +{ + "name": "vscode-docker", + "version": "0.0.6", + "publisher": "PeterJausovec", + "displayName": "Dockerfile and Docker Compose File (yml) Support", + "description": "Adds syntax highlighting, snippets and description on hover for Dockerfiles and Docker compose files.", + "license": "SEE LICENSE IN LICENSE.md", + "icon": "images/docker_icon.svg", + "galleryBanner": { + "color": "#5c2d91", + "theme": "dark" + }, + "homepage": "https://github.com/Microsoft/vscode-docker/blob/master/README.md", + "bugs": { + "url": "https://github.com/Microsoft/vscode-docker/issues" + }, + "categories": [ + "Languages" + ], + "private": true, + "repository": { + "type": "git", + "url": "https://github.com/Microsoft/vscode-docker.git" + }, + "activationEvents": [ + "onLanguage:dockerfile", + "onLanguage:yaml" + ], + "main": "./out/dockerExtension", + "contributes": { + "snippets": [ + { + "language": "dockerfile", + "path": "./snippets/dockerfile.json" + } + ], + "languages": [ + { + "id": "dockerfile", + "aliases": [ + "Dockerfile" + ], + "filenamePatterns": [ + "dockerfile*.*", + "Dockerfile*.*" + ] + } + ] + }, + "engines": { + "vscode": "^0.10.8" + }, + "scripts": { + "vscode:prepublish": "tsc", + "postinstall": "node ./node_modules/vscode/bin/install", + "compile": "node ./node_modules/vscode/bin/compile -watch -p ./" + }, + "extensionDependencies": [ + "vscode.docker", + "vscode.yaml" + ], + "devDependencies": { + "vscode": "0.11.x" + }, + "__metadata": { + "id": "0479fc1c-3d67-49f9-b087-fb9069afe48f", + "publisherId": "bc3f1075-3ced-4395-9b1b-3f0ecaee83be", + "publisherDisplayName": "Microsoft" + } +} \ No newline at end of file diff --git a/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/snippets/dockerfile.json b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/snippets/dockerfile.json new file mode 100644 index 00000000..695d68dd --- /dev/null +++ b/.vscode/extensions/PeterJausovec.vscode-docker-0.0.6/snippets/dockerfile.json @@ -0,0 +1,114 @@ +{ + "FROM": { + "prefix": "FROM", + "body": [ + "FROM ${baseImage}", + "$0" + ], + "description": "FROM" + }, + "MAINTAINER": { + "prefix": "MAINTAINER", + "body": [ + "MAINTAINER ${name}", + "$0" + ], + "description": "MAINTAINER" + }, + "RUN": { + "prefix": "RUN", + "body": [ + "RUN ${cmd}", + "$0" + ], + "description": "RUN" + }, + "CMD": { + "prefix": "CMD", + "body": [ + "CMD ${command}", + "$0" + ], + "description": "CMD" + }, + "LABEL": { + "prefix": "LABEL", + "body": [ + "LABEL ${key}=${value}", + "$0" + ], + "description": "LABEL" + }, + "EXPOSE": { + "prefix": "EXPOSE", + "body": [ + "EXPOSE ${port}", + "$0" + ], + "description": "EXPOSE" + }, + "ENV": { + "prefix": "ENV", + "body": [ + "ENV ${key}=${value}", + "$0" + ], + "description": "ENV" + }, + "ADD": { + "prefix": "ADD", + "body": [ + "ADD ${source} ${dest}", + "$0" + ], + "description": "ADD" + }, + "COPY": { + "prefix": "COPY", + "body": [ + "COPY ${source} ${dest}", + "$0" + ], + "description": "COPY" + }, + "ENTRYPOINT": { + "prefix": "ENTRYPOINT", + "body": [ + "ENTRYPOINT ${command}", + "$0" + ], + "description": "ENTRYPOINT" + }, + "VOLUME": { + "prefix": "VOLUME", + "body": [ + "VOLUME ${name}", + "$0" + ], + "description": "VOLUME" + }, + "USER": { + "prefix": "USER", + "body": [ + "USER ${daemon}", + "$0" + ], + "description": "USER" + }, + "WORKDIR": { + "prefix": "WORKDIR", + "body": [ + "WORKDIR ${path}", + "$0" + ], + "description": "WORKDIR" + }, + "ONBUILD": { + "prefix": "ONBUILD", + "body": [ + "ONBUILD ${instruction}", + "$0" + ], + "description": "ONBUILD" + } +} \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/.vsixmanifest b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/.vsixmanifest new file mode 100644 index 00000000..ef49bb56 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/.vsixmanifest @@ -0,0 +1,32 @@ + + + + + Path Intellisense + Visual Studio Code plugin that autocompletes filenames + + Other + Public + + + + + + + + + + + + extension/LICENSE.txt + extension/icon/path-intellisense.png + + + + + + + + + + diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/LICENSE.txt b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/LICENSE.txt new file mode 100644 index 00000000..e8a3f8bc --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Christian Kohler + +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/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/README.md b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/README.md new file mode 100644 index 00000000..15d16cfb --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/README.md @@ -0,0 +1,39 @@ +# Path Intellisense +Visual Studio Code plugin that autocompletes filenames. + +## Installation +In the command palette (cmd-shift-p) select Install Extension and choose Path Intellisense. + +## Usage +![IDE](http://i.giphy.com/iaHeUiDeTUZuo.gif) + +## Node packages intellisense +Use [npm intellisense](https://marketplace.visualstudio.com/items?itemName=christian-kohler.npm-intellisense) + +## Contributing +Something missing? Found a bug? - Create a pull request or an issue. +[Github](https://github.com/ChristianKohler/PathIntellisense) + +## Settings +### File extension in import statements +Path Intellisense removes the file extension by default if the statement is a import statement. To enable file extensions set the following setting to true: + +```javascript +{ + "path-intellisense.extensionOnImport": true, +} +``` + +## History +* v1.0.2 - Fixed Bug #15 #16 +* v1.0.1 - Fixed compatibility with VS Code 1.3 +* v1.0.0 - Added .. on top of each suggestion, Removed trailing slash, bugs fixed +* v0.2.0 - Remove file extension within imports (configurable) +* v0.1.0 - Added slash after folders, group by folder and files, file icon +* v0.0.5 - Fixed windows path issue +* v0.0.3 - Fixed unknown publisher issue +* v0.0.2 - Updated Readme.md +* v0.0.1 - Initial + +## License +This software is released under [MIT License](http://www.opensource.org/licenses/mit-license.php) \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/icon/path-intellisense.png b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/icon/path-intellisense.png new file mode 100644 index 00000000..60daa853 Binary files /dev/null and b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/icon/path-intellisense.png differ diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/icon/path-intellisense.sketch b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/icon/path-intellisense.sketch new file mode 100644 index 00000000..22d0e95a Binary files /dev/null and b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/icon/path-intellisense.sketch differ diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/FileInfo.js b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/FileInfo.js new file mode 100644 index 00000000..982fd3d6 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/FileInfo.js @@ -0,0 +1,12 @@ +"use strict"; +var fs_1 = require('fs'); +var path_1 = require('path'); +var FileInfo = (function () { + function FileInfo(path, file) { + this.file = file; + this.isFile = fs_1.statSync(path_1.join(path, file)).isFile(); + } + return FileInfo; +}()); +exports.FileInfo = FileInfo; +//# sourceMappingURL=FileInfo.js.map \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/PathCompletionItem.js b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/PathCompletionItem.js new file mode 100644 index 00000000..b116c297 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/PathCompletionItem.js @@ -0,0 +1,43 @@ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var vscode_1 = require('vscode'); +var vscode_2 = require('vscode'); +var withExtension = vscode_2.workspace.getConfiguration('path-intellisense')['extensionOnImport']; +var PathCompletionItem = (function (_super) { + __extends(PathCompletionItem, _super); + function PathCompletionItem(fileInfo, isImport, documentExtension) { + _super.call(this, fileInfo.file); + this.kind = vscode_1.CompletionItemKind.File; + this.addGroupByFolderFile(fileInfo); + this.removeExtension(fileInfo, isImport, documentExtension); + this.addSlashForFolder(fileInfo); + } + PathCompletionItem.prototype.addGroupByFolderFile = function (fileInfo) { + this.sortText = (fileInfo.isFile ? 'b' : 'a') + "_" + fileInfo.file; + }; + PathCompletionItem.prototype.addSlashForFolder = function (fileInfo) { + if (!fileInfo.isFile) { + this.label = fileInfo.file + "/"; + this.insertText = fileInfo.file; + } + }; + PathCompletionItem.prototype.removeExtension = function (fileInfo, isImport, documentExtension) { + if (!fileInfo.isFile || withExtension || !isImport) { + return; + } + var fragments = fileInfo.file.split('.'); + var extension = fragments[fragments.length - 1]; + if (extension !== documentExtension) { + return; + } + var index = fileInfo.file.lastIndexOf('.'); + this.insertText = index != -1 ? fileInfo.file.substring(0, index) : fileInfo.file; + }; + return PathCompletionItem; +}(vscode_1.CompletionItem)); +exports.PathCompletionItem = PathCompletionItem; +//# sourceMappingURL=PathCompletionItem.js.map \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/PathIntellisense.js b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/PathIntellisense.js new file mode 100644 index 00000000..684d8808 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/PathIntellisense.js @@ -0,0 +1,39 @@ +"use strict"; +var text_parser_1 = require('./text-parser'); +var fs_functions_1 = require('./fs-functions'); +var PathCompletionItem_1 = require('./PathCompletionItem'); +var UpCompletionItem_1 = require('./UpCompletionItem'); +var PathIntellisense = (function () { + function PathIntellisense(getChildrenOfPath) { + this.getChildrenOfPath = getChildrenOfPath; + } + PathIntellisense.prototype.provideCompletionItems = function (document, position) { + var line = document.getText(document.lineAt(position).range); + var isImport = text_parser_1.isImportOrRequire(line); + var documentExtension = fs_functions_1.extractExtension(document); + var textWithinString = text_parser_1.getTextWithinString(line, position.character); + var path = fs_functions_1.getPath(document.fileName, textWithinString); + if (this.shouldProvide(textWithinString, isImport)) { + return this.getChildrenOfPath(path).then(function (children) { + return [ + new UpCompletionItem_1.UpCompletionItem() + ].concat(children.map(function (child) { return new PathCompletionItem_1.PathCompletionItem(child, isImport, documentExtension); })); + }); + } + else { + return Promise.resolve([]); + } + }; + PathIntellisense.prototype.shouldProvide = function (textWithinString, isImport) { + if (!textWithinString || textWithinString.length === 0) { + return false; + } + if (isImport && textWithinString[0] !== '.') { + return false; + } + return true; + }; + return PathIntellisense; +}()); +exports.PathIntellisense = PathIntellisense; +//# sourceMappingURL=PathIntellisense.js.map \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/UpCompletionItem.js b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/UpCompletionItem.js new file mode 100644 index 00000000..e0e91374 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/UpCompletionItem.js @@ -0,0 +1,17 @@ +"use strict"; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var vscode_1 = require('vscode'); +var UpCompletionItem = (function (_super) { + __extends(UpCompletionItem, _super); + function UpCompletionItem() { + _super.call(this, '..'); + this.kind = vscode_1.CompletionItemKind.File; + } + return UpCompletionItem; +}(vscode_1.CompletionItem)); +exports.UpCompletionItem = UpCompletionItem; +//# sourceMappingURL=UpCompletionItem.js.map \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/extension.js b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/extension.js new file mode 100644 index 00000000..df39c612 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/extension.js @@ -0,0 +1,14 @@ +'use strict'; +var vscode_1 = require('vscode'); +var PathIntellisense_1 = require('./PathIntellisense'); +var fs_functions_1 = require('./fs-functions'); +function activate(context) { + var provider = new PathIntellisense_1.PathIntellisense(fs_functions_1.getChildrenOfPath); + var triggers = ['/', '"', '\'']; + context.subscriptions.push(vscode_1.languages.registerCompletionItemProvider.apply(vscode_1.languages, ['*', provider].concat(triggers))); +} +exports.activate = activate; +function deactivate() { +} +exports.deactivate = deactivate; +//# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/fs-functions.js b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/fs-functions.js new file mode 100644 index 00000000..801b4042 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/fs-functions.js @@ -0,0 +1,50 @@ +"use strict"; +var fs_1 = require('fs'); +var path_1 = require('path'); +var FileInfo_1 = require('./FileInfo'); +function getChildrenOfPath(path) { + return readdirPromise(path) + .then(function (files) { return files.filter(notHidden).map(function (f) { return new FileInfo_1.FileInfo(path, f); }); }) + .catch(function () { return []; }); +} +exports.getChildrenOfPath = getChildrenOfPath; +function getPath(fileName, text) { + console.log(fileName); + console.log(text); + console.log(path_1.normalize(text)); + console.log(fileName.substring(0, fileName.lastIndexOf(path_1.sep))); + console.log(text.substring(0, text.lastIndexOf(path_1.sep))); + console.log(path_1.normalize(text).substring(0, path_1.normalize(text).lastIndexOf(path_1.sep))); + console.log('===='); + return path_1.resolve(fileName.substring(0, fileName.lastIndexOf(path_1.sep)), path_1.normalize(text).substring(0, path_1.normalize(text).lastIndexOf(path_1.sep))); + ; +} +exports.getPath = getPath; +function extractExtension(document) { + if (document.isUntitled) { + return undefined; + } + var fragments = document.fileName.split('.'); + var extension = fragments[fragments.length - 1]; + if (!extension || extension.length > 3) { + return undefined; + } + return extension; +} +exports.extractExtension = extractExtension; +function readdirPromise(path) { + return new Promise(function (resolve, reject) { + fs_1.readdir(path, function (error, files) { + if (error) { + reject(error); + } + else { + resolve(files); + } + }); + }); +} +function notHidden(filename) { + return filename[0] !== '.'; +} +//# sourceMappingURL=fs-functions.js.map \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/text-parser.js b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/text-parser.js new file mode 100644 index 00000000..a604d313 --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/out/src/text-parser.js @@ -0,0 +1,20 @@ +"use strict"; +function isInString(text, character) { + var inSingleQuoationString = (text.substring(0, character).match(/\'/g) || []).length % 2 === 1; + var inDoubleQuoationString = (text.substring(0, character).match(/\"/g) || []).length % 2 === 1; + return inSingleQuoationString || inDoubleQuoationString; +} +exports.isInString = isInString; +function isImportOrRequire(text) { + var isImport = text.substring(0, 6) === 'import'; + var isRequire = text.indexOf('require(') != -1; + return isImport || isRequire; +} +exports.isImportOrRequire = isImportOrRequire; +function getTextWithinString(text, position) { + var textToPosition = text.substring(0, position); + var quoatationPosition = Math.max(textToPosition.lastIndexOf('\"'), textToPosition.lastIndexOf('\'')); + return quoatationPosition != -1 ? textToPosition.substring(quoatationPosition + 1, textToPosition.length) : undefined; +} +exports.getTextWithinString = getTextWithinString; +//# sourceMappingURL=text-parser.js.map \ No newline at end of file diff --git a/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/package.json b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/package.json new file mode 100644 index 00000000..01f2f40e --- /dev/null +++ b/.vscode/extensions/christian-kohler.path-intellisense-1.0.2/package.json @@ -0,0 +1,50 @@ +{ + "name": "path-intellisense", + "displayName": "Path Intellisense", + "description": "Visual Studio Code plugin that autocompletes filenames", + "version": "1.0.2", + "publisher": "christian-kohler", + "engines": { + "vscode": "^1.0.0" + }, + "homepage": "https://github.com/ChristianKohler/PathIntellisense", + "repository": { + "type": "git", + "url": "https://github.com/ChristianKohler/PathIntellisense.git" + }, + "categories": [ + "Other" + ], + "activationEvents": [ + "*" + ], + "contributes": { + "configuration": { + "type": "object", + "title": "path-intellisense", + "properties": { + "path-intellisense.extensionOnImport": { + "type": "boolean", + "default": false, + "description": "Adds the file extension to a import statements" + } + } + } + }, + "main": "./out/src/extension", + "icon": "icon/path-intellisense.png", + "scripts": { + "vscode:prepublish": "node ./node_modules/vscode/bin/compile", + "compile": "node ./node_modules/vscode/bin/compile -watch -p ./", + "postinstall": "node ./node_modules/vscode/bin/install" + }, + "devDependencies": { + "typescript": "^1.8.5", + "vscode": "^0.11.0" + }, + "__metadata": { + "id": "a41c1549-4053-44d4-bf30-60fc809b4a86", + "publisherId": "a892fb38-060b-475f-9e73-2e06a8a17a68", + "publisherDisplayName": "Christian Kohler" + } +} \ No newline at end of file diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/.vsixmanifest b/.vscode/extensions/codezombiech.gitignore-0.2.0/.vsixmanifest new file mode 100644 index 00000000..ca966854 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/.vsixmanifest @@ -0,0 +1,32 @@ + + + + + gitignore + Language support for .gitignore files. Lets you pull .gitignore files from the https://github.com/github/gitignore repository. + vscode + Languages,Other + Public + + + + + + + + + + + + extension/LICENSE.txt + extension/icon.png + + + + + + + + + + diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/CHANGELOG.md b/.vscode/extensions/codezombiech.gitignore-0.2.0/CHANGELOG.md new file mode 100644 index 00000000..2c014a0c --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/CHANGELOG.md @@ -0,0 +1,31 @@ +# Changelog + +## v0.1.0 + +Basic implementation that allows pulling a single `.gitignore` file + + +## v0.1.2 + +- Fixed unhandled error in the case no workspace is open + + +## v0.1.3 + +- Added icon + + +## v0.1.4 + +- Fixed url to github repository +- Added url to github issues +- Exposed a setting named "gitignore.cacheExpirationInterval" that controls how long the `.gitignore` files retrieved from the github repository are stored in cache. Defaults to 3600 seconds. +- Fixed cancellation of the `Add gitignore` command not beeing handled correctly + +## v0.1.5 + +- Properly declared the exposed settings in the package.json. This way the user gets support from Visual Studio Code when authoring the settings files. + +## v0.2.0 + +- Added language support for `.gitignore` files diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/LICENSE.txt b/.vscode/extensions/codezombiech.gitignore-0.2.0/LICENSE.txt new file mode 100644 index 00000000..5a5523be --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Marc-André Bühler + +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/.vscode/extensions/codezombiech.gitignore-0.2.0/README.md b/.vscode/extensions/codezombiech.gitignore-0.2.0/README.md new file mode 100644 index 00000000..4b313b43 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/README.md @@ -0,0 +1,51 @@ +# gitignore extension for Visual Studio Code + +A extension for Visual Studio Code that assists you in working with `.gitignore` files. + + +## Features + +- Language support for `.gitignore` files +- Add local `.gitignore` by pulling file from the the [github/gitignore](https://github.com/github/gitignore) repository. + + +## Usage + +Start command palette (with Ctrl+Shift+P or F1) and start typing `Add gitignore` + + +## Settings + +```JavaScript +{ + // Number of seconds the list of `.gitignore` files retrieved from github will be cached + "gitignore.cacheExpirationInterval": 3600 +} +``` + + +## Roadmap + +### v0.1 +Basic implementation that allows to pull a single `.gitignore` file + +### v0.2 +Add language support for `.gitignore` files + +### v0.3 +Support adding multiple .gitignore files and merge it to a `.gitignore` file + + +## Changelog + +See CHANGELOG.md + + +## License + +See LICENSE file + + +## Credits + +Icon based on the Git logo by Jason Long diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/gitignore.configuration.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/gitignore.configuration.json new file mode 100644 index 00000000..6a29b9dd --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/gitignore.configuration.json @@ -0,0 +1,6 @@ +{ + "comments": { + // symbol used for single line comment. Remove this entry if your language does not support line comments + "lineComment": "#" + } +} diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/icon.png b/.vscode/extensions/codezombiech.gitignore-0.2.0/icon.png new file mode 100644 index 00000000..386be5b3 Binary files /dev/null and b/.vscode/extensions/codezombiech.gitignore-0.2.0/icon.png differ diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/icon/icon.png b/.vscode/extensions/codezombiech.gitignore-0.2.0/icon/icon.png new file mode 100644 index 00000000..b8866313 Binary files /dev/null and b/.vscode/extensions/codezombiech.gitignore-0.2.0/icon/icon.png differ diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/icon/icon.xcf b/.vscode/extensions/codezombiech.gitignore-0.2.0/icon/icon.xcf new file mode 100644 index 00000000..e79bf2c8 Binary files /dev/null and b/.vscode/extensions/codezombiech.gitignore-0.2.0/icon/icon.xcf differ diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/.npmignore b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/.npmignore new file mode 100644 index 00000000..988771c1 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/.npmignore @@ -0,0 +1,5 @@ +.settings.xml +.settings +.c9revisions +doc/ +node_modules/ diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/LICENSE b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/LICENSE new file mode 100644 index 00000000..277d0573 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/LICENSE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2012 Cloud9 IDE, Inc. (Mike de Boer) + +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/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/README.md b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/README.md new file mode 100644 index 00000000..378fdd43 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/README.md @@ -0,0 +1,173 @@ +# JavaScript GitHub API for Node.JS + +A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API. + +## Installation + + Install with the Node.JS package manager [npm](http://npmjs.org/) ![NPM version](https://badge.fury.io/js/github.svg): + + $ npm install github + +or + + Install via git clone: + + $ git clone git://github.com/mikedeboer/node-github.git + $ cd node-github + $ npm install + +## Documentation + +You can find the docs for the API of this client at [http://mikedeboer.github.com/node-github/](http://mikedeboer.github.com/node-github/) + +Additionally, the [official Github documentation](https://developer.github.com/v3/) +is a very useful resource. + +## Example + +Print all followers of the user "mikedeboer" to the console. +```javascript +var GitHubApi = require("github"); + +var github = new GitHubApi({ + // required + version: "3.0.0", + // optional + debug: true, + protocol: "https", + host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub + pathPrefix: "/api/v3", // for some GHEs; none for GitHub + timeout: 5000, + headers: { + "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent + } +}); +github.user.getFollowingFromUser({ + // optional: + // headers: { + // "cookie": "blahblah" + // }, + user: "mikedeboer" +}, function(err, res) { + console.log(JSON.stringify(res)); +}); +``` + +First the _GitHubApi_ class is imported from the _node-github_ module. This class provides +access to all of GitHub's APIs (e.g. user, issues or repo APIs). The _getFollowingFromUser_ +method lists all followers of a given GitHub user. Is is part of the user API. It +takes the user name as first argument and a callback as last argument. Once the +follower list is returned from the server, the callback is called. + +Like in Node.JS, callbacks are always the last argument. If the functions fails an +error object is passed as first argument to the callback. + +## Authentication + +Most GitHub API calls don't require authentication. As a rule of thumb: If you +can see the information by visiting the site without being logged in, you don't +have to be authenticated to retrieve the same information through the API. Of +course calls, which change data or read sensitive information have to be authenticated. + +You need the GitHub user name and the API key for authentication. The API key can +be found in the user's _Account Settings_ page. + +This example shows how to authenticate and then change _location_ field of the +account settings to _Argentina_: +```javascript +github.authenticate({ + type: "basic", + username: username, + password: password +}); +github.user.update({ + location: "Argentina" +}, function(err) { + console.log("done!"); +}); +``` +Note that the _authenticate_ method is synchronous because it only stores the +credentials for the next request. + +Other examples for the various authentication methods: +```javascript +// OAuth2 +github.authenticate({ + type: "oauth", + token: token +}); + +// OAuth2 Key/Secret +github.authenticate({ + type: "oauth", + key: "clientID", + secret: "clientSecret" +}) + +// Deprecated Gihub API token (seems not to be working with the v3 API) +github.authenticate({ + type: "token", + token: token +}); +``` + +### Creating tokens for your application +[Create a new authorization](http://developer.github.com/v3/oauth/#create-a-new-authorization) for your application giving it access to the wanted scopes you need instead of relying on username / password and is the way to go if you have [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) on. + +For example: + +1. Use github.authenticate() to auth with GitHub using your username / password +2. Create an application token programmatically with the scopes you need and, if you use two-factor authentication send the `X-GitHub-OTP` header with the one-time-password you get on your token device. + +```javascript +github.authorization.create({ + scopes: ["user", "public_repo", "repo", "repo:status", "gist"], + note: "what this auth is for", + note_url: "http://url-to-this-auth-app", + headers: { + "X-GitHub-OTP": "two-factor-code" + } +}, function(err, res) { + if (res.token) { + //save and use res.token as in the Oauth process above from now on + } +}); +``` + +## Implemented GitHub APIs + +* Gists: 100% +* Git Data: 100% +* Issues: 100% +* Orgs: 100% +* Pull Requests: 100% +* Repos: 100% +* Users: 100% +* Events: 100% +* Search: 100% +* Markdown: 100% +* Rate Limit: 100% +* Releases: 100% +* Gitignore: 100% +* Meta: 100% +* Emojis: 100% + +## Running the Tests + +The unit tests are based on the [mocha](http://visionmedia.github.com/mocha/) +module, which may be installed via npm. To run the tests make sure that the +npm dependencies are installed by running `npm install` from the project directory. + +Before running unit tests: +```shell +npm install mocha -g +``` +At the moment, test classes can only be run separately. This will e.g. run the Issues Api test: +```shell +mocha api/v3.0.0/issuesTest.js +``` +Note that a connection to the internet is required to run the tests. + +## LICENSE + +MIT license. See the LICENSE file for details. diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v2.0.0/routes.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v2.0.0/routes.json new file mode 100644 index 00000000..49d1a202 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v2.0.0/routes.json @@ -0,0 +1,3 @@ +{ + +} diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/authorization.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/authorization.js new file mode 100644 index 00000000..ca61fdfe --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/authorization.js @@ -0,0 +1,255 @@ +/** + * mixin authorization + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var authorization = module.exports = { + authorization: {} +}; + +(function() { + /** section: github + * authorization#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getAll = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * authorization#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * authorization#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - scopes (Array): Optional. A list of scopes that this authorization is in. + * - note (String): Optional. A note to remind you what the OAuth token is for. + * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. + **/ + this.create = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * authorization#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - scopes (Array): Optional. A list of scopes that this authorization is in. + * - add_scopes (Array): Optional. A list of scopes to add to this authorization. + * - remove_scopes (Array): Optional. A list of scopes to remove from this authorization. + * - note (String): Optional. A note to remind you what the OAuth token is for. + * - note_url (String): Optional. A URL to remind you what app the OAuth token is for. + **/ + this.update = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * authorization#delete(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.delete = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(authorization.authorization); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/authorizationTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/authorizationTest.js new file mode 100644 index 00000000..29b0b8da --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/authorizationTest.js @@ -0,0 +1,258 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[authorization]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + this.timeout(10000); + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "basic", + username: "mikedeboertest", + password: "test1324" + }); + }); + + it("should successfully execute GET /authorizations (getAll)", function(next) { + client.authorization.create( + { + scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], + note: "Authorization created to unit tests auth", + note_url: "https://github.com/ajaxorg/node-github" + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.authorization.getAll( + { + page: "1", + per_page: "100" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 1); + + client.authorization["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.authorization.getAll( + { + page: "1", + per_page: "100" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 0); + + next(); + } + ); + } + ); + } + ); + } + ); + }); + + it("should successfully execute GET /authorizations/:id (get)", function(next) { + client.authorization.create( + { + scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], + note: "Authorization created to unit tests auth", + note_url: "https://github.com/ajaxorg/node-github" + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.authorization.get( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.id, id); + Assert.equal(res.note, "Authorization created to unit tests auth"); + Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); + + client.authorization["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.authorization.get( + { + id: id + }, + function(err, res) { + Assert.equal(err.code, 404); + next(); + } + ); + } + ); + } + ); + } + ); + }); + + it("should successfully execute POST /authorizations (create)", function(next) { + client.authorization.create( + { + scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], + note: "Authorization created to unit tests auth", + note_url: "https://github.com/ajaxorg/node-github" + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.authorization.get( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.id, id); + Assert.equal(res.note, "Authorization created to unit tests auth"); + Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); + + client.authorization["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.authorization.get( + { + id: id + }, + function(err, res) { + Assert.equal(err.code, 404); + next(); + } + ); + } + ); + } + ); + } + ); + }); + + it("should successfully execute PATCH /authorizations/:id (update)", function(next) { + client.authorization.create( + { + scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], + note: "Authorization created to unit tests auth", + note_url: "https://github.com/ajaxorg/node-github" + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.authorization.update( + { + id: id, + remove_scopes: ["repo"], + note: "changed" + }, + function(err, res) { + Assert.equal(err, null); + + client.authorization.get( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.id, id); + Assert.ok(res.scopes.indexOf("repo") === -1); + Assert.equal(res.note, "changed"); + Assert.equal(res.note_url, "https://github.com/ajaxorg/node-github"); + + client.authorization["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.authorization.get( + { + id: id + }, + function(err, res) { + Assert.equal(err.code, 404); + next(); + } + ); + } + ); + } + ); + } + ); + } + ); + }); + + it("should successfully execute DELETE /authorizations/:id (delete)", function(next) { + client.authorization.create( + { + scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], + note: "Authorization created to unit tests auth", + note_url: "https://github.com/ajaxorg/node-github" + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.authorization["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.authorization.get( + { + id: id + }, + function(err, res) { + Assert.equal(err.code, 404); + next(); + } + ); + } + ); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/events.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/events.js new file mode 100644 index 00000000..f0dfbb1e --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/events.js @@ -0,0 +1,495 @@ +/** + * mixin events + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var events = module.exports = { + events: {} +}; + +(function() { + /** section: github + * events#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getFromRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromRepo = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getFromRepoIssues(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromRepoIssues = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getFromRepoNetwork(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromRepoNetwork = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getFromOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromOrg = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getReceived(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getReceived = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getReceivedPublic(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getReceivedPublic = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getFromUserPublic(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromUserPublic = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * events#getFromUserOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromUserOrg = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(events.events); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/eventsTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/eventsTest.js new file mode 100644 index 00000000..0c4a7320 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/eventsTest.js @@ -0,0 +1,212 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[events]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /events (get)", function(next) { + client.events.get( + { + page: 1, + per_page: 30 + }, + function(err, res) { + // other assertions go here + Assert.equal(err, null); + Assert.ok(res.length > 1); + Assert.equal(typeof res[0].type, "string"); + Assert.equal(typeof res[0].created_at, "string"); + Assert.equal(typeof res[0]["public"], "boolean"); + Assert.equal(typeof res[0].id, "string"); + Assert.ok("actor" in res[0]); + Assert.ok("repo" in res[0]); + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/events (getFromRepo)", function(next) { + client.events.getFromRepo( + { + user: "mikedeboertest", + repo: "node_chat" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 5); + // this is the lastly listed event + var last = res.pop(); + Assert.equal(last.type, "ForkEvent"); + Assert.equal(last.created_at, "2012-10-05T15:03:11Z"); + Assert.equal(last.id, "1607304921"); + Assert.equal(last["public"], true); + Assert.equal(last.actor.login, "mikedeboer"); + Assert.equal(last.repo.name, "mikedeboertest/node_chat"); + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/events (getFromRepoIssues)", function(next) { + client.events.getFromRepoIssues( + { + user: "mikedeboertest", + repo: "node_chat" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 4); + // this is the lastly listed event + var last = res.pop(); + Assert.equal(last.event, "referenced"); + Assert.equal(last.created_at, "2012-10-05T15:05:31Z"); + Assert.equal(last.id, "26276344"); + Assert.equal(last.actor.login, "mikedeboertest"); + Assert.equal(last.issue.title, "Macaroni"); + Assert.equal(last.issue.number, 1); + Assert.equal(last.issue.state, "closed"); + next(); + } + ); + }); + + it("should successfully execute GET /networks/:user/:repo/events (getFromRepoNetwork)", function(next) { + client.events.getFromRepoNetwork( + { + user: "mikedeboertest", + repo: "node_chat" + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res.length > 1); + var last = res.pop(); + Assert.equal(typeof last.id, "string"); + Assert.equal(typeof last.created_at, "string"); + Assert.equal(typeof last.actor, "object"); + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/events (getFromOrg)", function(next) { + client.events.getFromOrg( + { + org: "ajaxorg" + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res.length > 1); + var last = res.pop(); + Assert.equal(typeof last.id, "string"); + Assert.equal(typeof last.created_at, "string"); + Assert.equal(typeof last.actor, "object"); + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/received_events (getReceived)", function(next) { + client.events.getReceived( + { + user: "mikedeboertest" + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res.length > 0); + var last = res.pop(); + Assert.equal(typeof last.id, "string"); + Assert.equal(typeof last.created_at, "string"); + Assert.equal(typeof last.actor, "object"); + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/received_events/public (getReceivedPublic)", function(next) { + client.events.getReceivedPublic( + { + user: "mikedeboertest" + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res.length > 0); + var last = res.pop(); + Assert.equal(typeof last.id, "string"); + Assert.equal(typeof last.created_at, "string"); + Assert.equal(typeof last.actor, "object"); + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/events (getFromUser)", function(next) { + client.events.getFromUser( + { + user: "mikedeboertest" + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res.length > 1); + var last = res.pop(); + Assert.equal(typeof last.id, "string"); + Assert.equal(typeof last.created_at, "string"); + Assert.equal(typeof last.actor, "object"); + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/events/public (getFromUserPublic)", function(next) { + client.events.getFromUserPublic( + { + user: "mikedeboertest" + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res.length > 1); + var last = res.pop(); + Assert.equal(typeof last.id, "string"); + Assert.equal(typeof last.created_at, "string"); + Assert.equal(typeof last.actor, "object"); + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/events/orgs/:org (getFromUserOrg)", function(next) { + client.events.getFromUserOrg( + { + user: "mikedeboer", + org: "ajaxorg" + }, + function(err, res) { + // we're not logged in as `mikedeboer` right now, so github API does not allow + // us to see the resource. + Assert.equal(err.code, 404); + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gists.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gists.js new file mode 100644 index 00000000..724b8c34 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gists.js @@ -0,0 +1,801 @@ +/** + * mixin gists + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var gists = module.exports = { + gists: {} +}; + +(function() { + /** section: github + * gists#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ + this.getAll = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ + this.getFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - description (String): Optional. + * - public (Boolean): Required. + * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + **/ + this.create = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#edit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - description (String): Optional. + * - files (Json): Required. Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content' + **/ + this.edit = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#public(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ + this.public = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#starred(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ + this.starred = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#star(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.star = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#deleteStar(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.deleteStar = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#checkStar(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.checkStar = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#fork(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.fork = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#delete(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.delete = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#getComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - gist_id (String): Required. Id (SHA1 hash) of the gist. + **/ + this.getComments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#getComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - gist_id (String): Required. Id (SHA1 hash) of the gist. + * - id (String): Required. + **/ + this.getComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#createComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - gist_id (String): Required. Id (SHA1 hash) of the gist. + * - body (String): Required. + **/ + this.createComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#editComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - gist_id (String): Required. Id (SHA1 hash) of the gist. + * - id (String): Required. + * - body (String): Required. + **/ + this.editComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gists#deleteComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - gist_id (String): Required. Id (SHA1 hash) of the gist. + * - id (String): Required. + **/ + this.deleteComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(gists.gists); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gistsTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gistsTest.js new file mode 100644 index 00000000..d47d28f3 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gistsTest.js @@ -0,0 +1,605 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[gists]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + timeout(5000); + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /gists (getAll)", function(next) { + client.gists.getAll( + {}, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 1); + var gist = res.pop(); + Assert.equal(gist.user.login, "mikedeboertest"); + Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); + Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); + Assert.equal(gist.public, false); + Assert.equal(gist.id, "77dc15615eab09a79b61"); + + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/gists (getFromUser)", function(next) { + client.gists.getFromUser( + { + user: "mikedeboertest" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 1); + var gist = res.pop(); + Assert.equal(gist.user.login, "mikedeboertest"); + Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); + Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); + Assert.equal(gist.public, false); + Assert.equal(gist.id, "77dc15615eab09a79b61"); + next(); + } + ); + }); + + it("should successfully execute POST /gists (create)", function(next) { + client.gists.create( + { + description: "Another bowl of pasta", + public: "false", + files: { + "ravioli.js": { + "content": "alert(\"want some ketchup with that?\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.get( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.user.login, "mikedeboertest"); + Assert.equal(res.html_url, "https://gist.github.com/" + id); + Assert.equal(res.public, false); + Assert.equal(res.id, id); + Assert.equal(res.description, "Another bowl of pasta"); + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute PATCH /gists/:id (edit)", function(next) { + client.gists.create( + { + description: "Another bowl of pasta", + public: "false", + files: { + "ravioli.js": { + "content": "alert(\"want some ketchup with that?\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.edit( + { + id: id, + description: "changed", + files: { + "ravioli.js": { + "content": "alert(\"no ketchup, please.\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + + client.gists.get( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.user.login, "mikedeboertest"); + Assert.equal(res.html_url, "https://gist.github.com/" + id); + Assert.equal(res.public, false); + Assert.equal(res.id, id); + Assert.equal(res.description, "changed"); + Assert.equal(res.files["ravioli.js"].content, "alert(\"no ketchup, please.\");"); + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + } + ); + }); +/* + it("should successfully execute GET /gists/public (public)", function(next) { + client.gists.public( + {}, + function(err, res) { + Assert.equal(err, null); + console.log(res); + next(); + } + ); + }); +*/ + it("should successfully execute GET /gists/starred (starred)", function(next) { + client.gists.starred( + {}, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 1); + var gist = res.pop(); + Assert.equal(gist.user.login, "mikedeboertest"); + Assert.equal(gist.html_url, "https://gist.github.com/77dc15615eab09a79b61"); + Assert.equal(gist.created_at, "2012-10-05T16:10:40Z"); + Assert.equal(gist.public, false); + Assert.equal(gist.id, "77dc15615eab09a79b61"); + + next(); + } + ); + }); + + it("should successfully execute GET /gists/:id (get)", function(next) { + client.gists.create( + { + description: "Another bowl of pasta", + public: "false", + files: { + "ravioli.js": { + "content": "alert(\"want some ketchup with that?\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.get( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.user.login, "mikedeboertest"); + Assert.equal(res.html_url, "https://gist.github.com/" + id); + Assert.equal(res.public, false); + Assert.equal(res.id, id); + Assert.equal(res.description, "Another bowl of pasta"); + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute PUT /gists/:id/star (star)", function(next) { + client.gists.create( + { + description: "Another bowl of pasta", + public: "false", + files: { + "ravioli.js": { + "content": "alert(\"want some ketchup with that?\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.star( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.gists.checkStar( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + //TODO: NO RESULT HERE??? + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + } + ); + }); + + it("should successfully execute DELETE /gists/:id/star (deleteStar)", function(next) { + client.gists.create( + { + description: "Another bowl of pasta", + public: "false", + files: { + "ravioli.js": { + "content": "alert(\"want some ketchup with that?\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.star( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.gists.deleteStar( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + } + ); + }); + + it("should successfully execute GET /gists/:id/star (checkStar)", function(next) { + client.gists.create( + { + description: "Another bowl of pasta", + public: "false", + files: { + "ravioli.js": { + "content": "alert(\"want some ketchup with that?\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.star( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute POST /gists/:id/fork (fork)", function(next) { + client.gists.fork( + { + id: "3047099" + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + Assert.equal(res.git_pull_url, "git://gist.github.com/" + id + ".git"); + Assert.equal(res.git_push_url, "git@gist.github.com:" + id + ".git"); + Assert.equal(res.description, "Why to call resume() after next()"); + Assert.equal(typeof res.files["resume_after_next.md"], "object"); + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + }); + + it("should successfully execute DELETE /gists/:id (delete)", function(next) { + client.gists.create( + { + description: "Another bowl of pasta", + public: "false", + files: { + "ravioli.js": { + "content": "alert(\"want some ketchup with that?\");" + } + } + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists["delete"]( + { + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + }); + + it("should successfully execute GET /gists/:gist_id/comments/:id (getComments)", function(next) { + client.gists.createComment( + { + gist_id: "3047099", + body: "This is a test comment.", + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.getComments( + { + gist_id: "3047099" + }, + function(err, res) { + var comment = res.pop(); + Assert.equal(err, null); + Assert.equal(comment.user.login, "mikedeboertest"); + Assert.equal(comment.id, id); + Assert.equal(comment.body, "This is a test comment."); + + client.gists["deleteComment"]( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute GET /gists/:gist_id/comments/:id (getComment)", function(next) { + client.gists.createComment( + { + gist_id: "3047099", + body: "This is a test comment.", + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.getComment( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.user.login, "mikedeboertest"); + Assert.equal(res.id, id); + Assert.equal(res.body, "This is a test comment."); + + client.gists["deleteComment"]( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute POST /gists/:gist_id/comments (createComment)", function(next) { + client.gists.createComment( + { + gist_id: "3047099", + body: "This is a test comment.", + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.getComment( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.user.login, "mikedeboertest"); + Assert.equal(res.id, id); + Assert.equal(res.body, "This is a test comment."); + + client.gists["deleteComment"]( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute PATCH /gists/:gist_id/comments/:id (editComment)", function(next) { + client.gists.createComment( + { + gist_id: "3047099", + body: "This is a test comment.", + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists.editComment( + { + gist_id: "3047099", + id: id, + body: "This comment has been edited." + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + client.gists.getComment( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.user.login, "mikedeboertest"); + Assert.equal(res.id, id); + Assert.equal(res.body, "This comment has been edited."); + + client.gists["deleteComment"]( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + } + ); + } + ); + }); + + it("should successfully execute DELETE /gists/:gist_id/comments/:id (deleteComment)", function(next) { + client.gists.createComment( + { + gist_id: "3047099", + body: "This is a test comment.", + }, + function(err, res) { + Assert.equal(err, null); + var id = res.id; + + client.gists["deleteComment"]( + { + gist_id: "3047099", + id: id + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitdata.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitdata.js new file mode 100644 index 00000000..584cc123 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitdata.js @@ -0,0 +1,650 @@ +/** + * mixin gitdata + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var gitdata = module.exports = { + gitdata: {} +}; + +(function() { + /** section: github + * gitdata#getBlob(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getBlob = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#createBlob(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - content (String): Required. + * - encoding (String): Required. + **/ + this.createBlob = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#getCommit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ + this.getCommit = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#createCommit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - message (String): Required. String of the commit message + * - tree (String): Required. String of the SHA of the tree object this commit points to + * - parents (Array): Required. Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided. + * - author (Json): Optional. + * - committer (Json): Optional. + **/ + this.createCommit = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#getReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + **/ + this.getReference = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#getAllReferences(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getAllReferences = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#createReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - sha (String): Required. + **/ + this.createReference = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#updateReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - sha (String): Required. + * - force (Boolean): Optional. Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work. + **/ + this.updateReference = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#deleteReference(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Required. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + **/ + this.deleteReference = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#getTag(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ + this.getTag = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#createTag(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - tag (String): Required. String of the tag + * - message (String): Required. String of the tag message + * - object (String): Required. String of the SHA of the git object this is tagging + * - type (String): Required. String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob. + * - tagger (Json): Required. JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged + **/ + this.createTag = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#getTree(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - recursive (Boolean): Optional. + **/ + this.getTree = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitdata#createTree(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - tree (Json): Required. Array of Hash objects (of path, mode, type and sha) specifying a tree structure + * - base_tree (String): Optional. String of the SHA1 of the tree you want to update with new data + **/ + this.createTree = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(gitdata.gitdata); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitdataTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitdataTest.js new file mode 100644 index 00000000..c9f7fbce --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitdataTest.js @@ -0,0 +1,480 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[gitdata]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /repos/:user/:repo/git/blobs/:sha (getBlob)", function(next) { + // found an object after executing: + // git rev-list --all | xargs -l1 git diff-tree -r -c -M -C --no-commit-id | awk '{print $3}' + client.gitdata.getBlob( + { + user: "mikedeboertest", + repo: "node_chat", + sha: "8433b682c95edf3fd81f5ee217dc9c874db35e4b" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.sha, "8433b682c95edf3fd81f5ee217dc9c874db35e4b"); + Assert.equal(res.size, 2654); + Assert.equal(res.encoding, "base64"); + + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/git/blobs (createBlob)", function(next) { + client.gitdata.createBlob( + { + user: "mikedeboertest", + repo: "node_chat", + content: "test", + encoding: "utf-8" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(typeof res.sha, "string"); + var sha = res.sha; + + client.gitdata.getBlob( + { + user: "mikedeboertest", + repo: "node_chat", + sha: sha + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.sha, sha); + Assert.equal(res.size, 4); + Assert.equal(res.encoding, "base64"); + + next(); + } + ); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/git/commits/:sha (getCommit)", function(next) { + client.gitdata.getCommit( + { + user: "mikedeboertest", + repo: "node_chat", + sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.author.date, "2012-10-05T08:05:31-07:00"); + Assert.equal(res.author.name, "Mike de Boer"); + Assert.equal(res.parents[0].sha, "221140b288a3c64949594c58420cb4ab289b0756"); + Assert.equal(res.parents[1].sha, "d2836429f4ff7de033c8bc0d16d22d55f2ea39c3"); + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/git/commits (createCommit)", function(next) { + // got valid tree reference by executing + // git cat-file -p HEAD + client.gitdata.createCommit( + { + user: "mikedeboertest", + repo: "node_chat", + message: "test", + tree: "8ce4393a319b60bc6179509e0c46dee83c179f9f", + parents: [], + author: { + name: "test-chef", + email: "test-chef@pasta-nirvana.it", + date: "2008-07-09T16:13:30+12:00" + }, + committer: { + name: "test-minion", + email: "test-minion@pasta-nirvana.it", + date: "2008-07-09T16:13:30+12:00" + } + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.author.name, "test-chef"); + Assert.equal(res.author.email, "test-chef@pasta-nirvana.it"); + Assert.equal(res.committer.name, "test-minion"); + Assert.equal(res.committer.email, "test-minion@pasta-nirvana.it"); + Assert.equal(res.message, "test"); + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/git/refs/:ref (getReference)", function(next) { + client.gitdata.getReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/master" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.ref, "refs/heads/master"); + Assert.equal(res.object.type, "commit"); + Assert.equal(res.object.sha, "17e0734295ffd8174f91f04ba8e8f8e51954b793"); + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/git/refs (getAllReferences)", function(next) { + client.gitdata.getAllReferences( + { + user: "mikedeboertest", + repo: "node_chat" + }, + function(err, res) { + Assert.equal(err, null); + var ref = res[0]; + Assert.equal(ref.ref, "refs/heads/master"); + Assert.equal(ref.object.type, "commit"); + Assert.equal(ref.object.sha, "17e0734295ffd8174f91f04ba8e8f8e51954b793"); + next(); + } + ); + }); +/* +DISABLED temporarily due to Internal Server Error from Github! + + it("should successfully execute POST /repos/:user/:repo/git/refs (createReference)", function(next) { + client.gitdata.createReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/tagliatelle", + sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" + }, + function(err, res) { + Assert.equal(err, null); + console.log(res); + + // other assertions go here + client.gitdata.deleteReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/tagliatelle" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + } + ); + });*/ + + it("should successfully execute PATCH /repos/:user/:repo/git/refs/:ref (updateReference)", function(next) { + client.gitdata.getReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/master" + }, + function(err, res) { + Assert.equal(err, null); + var sha = res.object.sha; + + // do `force=true` because we go backward in history, which yields a warning + // that it's not a reference that can be fast-forwarded to. + client.gitdata.updateReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/master", + sha: "221140b288a3c64949594c58420cb4ab289b0756", + force: true + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.ref, "refs/heads/master"); + Assert.equal(res.object.type, "commit"); + Assert.equal(res.object.sha, "221140b288a3c64949594c58420cb4ab289b0756"); + + client.gitdata.updateReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/master", + sha: sha, + force: false + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.ref, "refs/heads/master"); + Assert.equal(res.object.type, "commit"); + Assert.equal(res.object.sha, sha); + + next(); + } + ); + } + ); + } + ); + + }); +/* +DISABLED temporarily due to Internal Server Error from Github! + + it("should successfully execute DELETE /repos/:user/:repo/git/refs/:ref (deleteReference)", function(next) { + client.gitdata.createReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/tagliatelle", + sha: "17e0734295ffd8174f91f04ba8e8f8e51954b793" + }, + function(err, res) { + Assert.equal(err, null); + console.log(res); + + // other assertions go here + client.gitdata.deleteReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "heads/tagliatelle" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + } + ); + });*/ + + it("should successfully execute GET /repos/:user/:repo/git/tags/:sha (getTag)", function(next) { + client.gitdata.createTag( + { + user: "mikedeboertest", + repo: "node_chat", + tag: "test-pasta", + message: "Grandma's secret sauce", + object: "17e0734295ffd8174f91f04ba8e8f8e51954b793", + type: "commit", + tagger: { + name: "test-chef", + email: "test-chef@pasta-nirvana.it", + date: "2008-07-09T16:13:30+12:00" + } + }, + function(err, res) { + Assert.equal(err, null); + var sha = res.sha; + + client.gitdata.getTag( + { + user: "mikedeboertest", + repo: "node_chat", + sha: sha + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.tag, "test-pasta"); + Assert.equal(res.message, "Grandma's secret sauce"); + Assert.equal(res.sha, sha); + Assert.equal(res.tagger.name, "test-chef"); + Assert.equal(res.tagger.email, "test-chef@pasta-nirvana.it"); + + // other assertions go here + client.gitdata.deleteReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "tags/" + sha + }, + function(err, res) { + //Assert.equal(err, null); + // NOTE: Github return 'Validation Failed' error codes back, which makes no sense to me. + // ask the guys what's up here... + Assert.equal(err.code, 422); + + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/git/tags (createTag)", function(next) { + client.gitdata.createTag( + { + user: "mikedeboertest", + repo: "node_chat", + tag: "test-pasta", + message: "Grandma's secret sauce", + object: "17e0734295ffd8174f91f04ba8e8f8e51954b793", + type: "commit", + tagger: { + name: "test-chef", + email: "test-chef@pasta-nirvana.it", + date: "2008-07-09T16:13:30+12:00" + } + }, + function(err, res) { + Assert.equal(err, null); + var sha = res.sha; + + client.gitdata.getTag( + { + user: "mikedeboertest", + repo: "node_chat", + sha: sha + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.tag, "test-pasta"); + Assert.equal(res.message, "Grandma's secret sauce"); + Assert.equal(res.sha, sha); + Assert.equal(res.tagger.name, "test-chef"); + Assert.equal(res.tagger.email, "test-chef@pasta-nirvana.it"); + + // other assertions go here + client.gitdata.deleteReference( + { + user: "mikedeboertest", + repo: "node_chat", + ref: "tags/" + sha + }, + function(err, res) { + //Assert.equal(err, null); + // NOTE: Github return 'Validation Failed' error codes back, which makes no sense to me. + // ask the guys what's up here... + Assert.equal(err.code, 422); + + next(); + } + ); + } + ); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/git/trees/:sha (getTree)", function(next) { + client.gitdata.getTree( + { + user: "mikedeboertest", + repo: "node_chat", + sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", + recursive: false + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.tree[0].type, "blob"); + Assert.equal(res.tree[0].path, "LICENSE-MIT"); + Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); + Assert.equal(res.tree[0].mode, "100644"); + Assert.equal(res.tree[0].size, 1075); + + client.gitdata.getTree( + { + user: "mikedeboertest", + repo: "node_chat", + sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", + recursive: true + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.tree[0].type, "blob"); + Assert.equal(res.tree[0].path, "LICENSE-MIT"); + Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); + Assert.equal(res.tree[0].mode, "100644"); + Assert.equal(res.tree[0].size, 1075); + + next(); + } + ); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/git/trees (createTree)", function(next) { + client.gitdata.getTree( + { + user: "mikedeboertest", + repo: "node_chat", + sha: "8ce4393a319b60bc6179509e0c46dee83c179f9f", + recursive: false + }, + function(err, res) { + Assert.equal(err, null); + var file = res.tree[0]; + + client.gitdata.createTree( + { + base_tree: "8ce4393a319b60bc6179509e0c46dee83c179f9f", + user: "mikedeboertest", + repo: "node_chat", + tree: [ + { + path: file.path, + mode: "100755", + type: file.type, + sha: file.sha + } + ] + }, + function(err, res) { + Assert.equal(err, null); + var sha = res.sha; + + client.gitdata.getTree( + { + user: "mikedeboertest", + repo: "node_chat", + sha: sha, + recursive: true + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.tree[0].type, "blob"); + Assert.equal(res.tree[0].path, "LICENSE-MIT"); + Assert.equal(res.tree[0].sha, "f30a31de94635399f42fd05f91f6ed3ff2f013d6"); + Assert.equal(res.tree[0].mode, "100755"); + Assert.equal(res.tree[0].size, 1075); + + next(); + } + ); + } + ); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitignore.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitignore.js new file mode 100644 index 00000000..3caa4b0c --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitignore.js @@ -0,0 +1,112 @@ +/** + * mixin gitignore + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var gitignore = module.exports = { + gitignore: {} +}; + +(function() { + /** section: github + * gitignore#templates(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ + this.templates = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * gitignore#template(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - name (String): Required. The name of the .gitignore template to get + **/ + this.template = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(gitignore.gitignore); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitignoreTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitignoreTest.js new file mode 100644 index 00000000..e533eb4c --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/gitignoreTest.js @@ -0,0 +1,54 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[gitignore]", function() { + var client; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + }); + + it("should successfully execute GET /gitignore/templates (templates)", function(next) { + client.gitignore.templates( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + Assert.ifError(err); + Assert(Array.isArray(res)); + Assert(res.length > 10); + next(); + } + ); + }); + + it("should successfully execute GET /gitignore/templates/:name (template)", function(next) { + client.gitignore.template( + { + name: "C" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + Assert.ifError(err); + Assert('name' in res); + Assert('source' in res); + Assert(typeof res.source === 'string'); + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/index.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/index.js new file mode 100644 index 00000000..5ce2480f --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/index.js @@ -0,0 +1,40 @@ +/** + * class Github + * + * A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API. + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var Fs = require("fs"); +var Util = require("./../../util"); +var error = require("./../../error"); + +var GithubHandler = module.exports = function(client) { + this.client = client; + this.routes = JSON.parse(Fs.readFileSync(__dirname + "/routes.json", "utf8")); +}; + +var proto = { + sendError: function(err, block, msg, callback) { + if (this.client.debug) + Util.log(err, block, msg.user, "error"); + if (typeof err == "string") + err = new error.InternalServerError(err); + if (callback) + callback(err); + } +}; + +["gists", "gitdata", "issues", "authorization", "orgs", "statuses", "pullRequests", "repos", "user", "events", "releases", "search", "markdown", "gitignore", "misc"].forEach(function(api) { + Util.extend(proto, require("./" + api)); +}); + +GithubHandler.prototype = proto; diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/issues.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/issues.js new file mode 100644 index 00000000..68d8ac0e --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/issues.js @@ -0,0 +1,1246 @@ +/** + * mixin issues + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var issues = module.exports = { + issues: {} +}; + +(function() { + /** section: github + * issues#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - filter (String): Optional. Validation rule: ` ^(all|assigned|created|mentioned|subscribed)$ `. + * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. + * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high + * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getAll = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#repoIssues(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - milestone (String): Optional. Validation rule: ` ^([0-9]+|none|\*)$ `. + * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. + * - assignee (String): Optional. String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User. + * - creator (String): Optional. The user that created the issue. + * - mentioned (String): Optional. String User login. + * - labels (String): Optional. String list of comma separated Label names. Example: bug,ui,@high + * - sort (String): Optional. Validation rule: ` ^(created|updated|comments)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.repoIssues = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getRepoIssue(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ + this.getRepoIssue = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - body (String): Optional. + * - assignee (String): Optional. Login for the user that this issue should be assigned to. + * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. + * - labels (Json): Optional. Array of strings - Labels to associate with this issue. + **/ + this.create = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#edit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - title (String): Optional. + * - body (String): Optional. + * - assignee (String): Optional. Login for the user that this issue should be assigned to. + * - milestone (Number): Optional. Milestone to associate this issue with. Validation rule: ` ^[0-9]+$ `. + * - labels (Json): Optional. Array of strings - Labels to associate with this issue. + * - state (String): Optional. open or closed Validation rule: ` ^(open|closed)$ `. + **/ + this.edit = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#repoComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sort (String): Optional. Validation rule: ` ^(created|updated)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.repoComments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getComments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#createComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + **/ + this.createComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#editComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - body (String): Required. + **/ + this.editComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#deleteComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.deleteComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getEvents(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getEvents = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getRepoEvents(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getRepoEvents = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getEvent(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getEvent = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getLabels(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getLabels = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + **/ + this.getLabel = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#createLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - color (String): Required. 6 character hex code, without a leading #. + **/ + this.createLabel = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#updateLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - color (String): Required. 6 character hex code, without a leading #. + **/ + this.updateLabel = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#deleteLabel(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + **/ + this.deleteLabel = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getIssueLabels(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ + this.getIssueLabels = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getAllMilestones(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - sort (String): Optional. due_date, completeness, default: due_date Validation rule: ` ^(due_date|completeness)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getAllMilestones = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#getMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ + this.getMilestone = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#createMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - description (String): Optional. + * - due_on (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ + this.createMilestone = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#updateMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - title (String): Required. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - description (String): Optional. + * - due_on (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ + this.updateMilestone = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * issues#deleteMilestone(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ + this.deleteMilestone = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(issues.issues); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/issuesTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/issuesTest.js new file mode 100644 index 00000000..c9f217bf --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/issuesTest.js @@ -0,0 +1,423 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[issues]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /issues (getAll)", function(next) { + client.issues.getAll( + { + filter: "created", + state: "open", + labels: "", + sort: "updated", + direction: "asc" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 1); + var issue = res[0]; + Assert.equal(issue.title, "My First Issue"); + Assert.equal(issue.number, 2); + Assert.equal(issue.state, "open"); + Assert.equal(issue.body, "Willing to start a debate on the best recipe of macaroni."); + Assert.equal(issue.assignee.login, "mikedeboertest"); + + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues (repoIssues)", function(next) { + client.issues.repoIssues( + { + user: "mikedeboertest", + repo: "node_chat", + state: "open", + sort: "updated", + direction: "asc" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.length, 1); + var issue = res[0]; + Assert.equal(issue.title, "My First Issue"); + Assert.equal(issue.number, 2); + Assert.equal(issue.state, "open"); + Assert.equal(issue.body, "Willing to start a debate on the best recipe of macaroni."); + Assert.equal(issue.assignee.login, "mikedeboertest"); + + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/:number (getRepoIssue)", function(next) { + client.issues.getRepoIssue( + { + user: "mikedeboertest", + repo: "node_chat", + number: 2 + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.title, "My First Issue"); + Assert.equal(res.number, 2); + Assert.equal(res.state, "open"); + Assert.equal(res.body, "Willing to start a debate on the best recipe of macaroni."); + Assert.equal(res.assignee.login, "mikedeboertest"); + + next(); + } + ); + }); +/* + it("should successfully execute POST /repos/:user/:repo/issues (create)", function(next) { + client.issues.create( + { + user: "String", + repo: "String", + title: "String", + body: "String", + assignee: "String", + milestone: "Number", + labels: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo/issues/:number (edit)", function(next) { + client.issues.edit( + { + user: "String", + repo: "String", + number: "Number", + title: "String", + body: "String", + assignee: "String", + milestone: "Number", + labels: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/:number/comments (getComments)", function(next) { + client.issues.getComments( + { + user: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/comments/:id (getComment)", function(next) { + client.issues.getComment( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/issues/:number/comments (createComment)", function(next) { + client.issues.createComment( + { + user: "String", + repo: "String", + number: "Number", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo/issues/comments/:id (editComment)", function(next) { + client.issues.editComment( + { + user: "String", + repo: "String", + id: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/issues/comments/:id (deleteComment)", function(next) { + client.issues.deleteComment( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/:number/events (getEvents)", function(next) { + client.issues.getEvents( + { + user: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/events (getRepoEvents)", function(next) { + client.issues.getRepoEvents( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/issues/events/:id (getEvent)", function(next) { + client.issues.getEvent( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/labels (getLabels)", function(next) { + client.issues.getLabels( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/labels/:name (getLabel)", function(next) { + client.issues.getLabel( + { + user: "String", + repo: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/labels (createLabel)", function(next) { + client.issues.createLabel( + { + user: "String", + repo: "String", + name: "String", + color: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/labels/:name (updateLabel)", function(next) { + client.issues.updateLabel( + { + user: "String", + repo: "String", + name: "String", + color: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/labels/:name (deleteLabel)", function(next) { + client.issues.deleteLabel( + { + user: "String", + repo: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/milestones (getAllMilestones)", function(next) { + client.issues.getAllMilestones( + { + user: "String", + repo: "String", + state: "String", + sort: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/milestones/:number (getMilestone)", function(next) { + client.issues.getMilestone( + { + user: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/milestones (createMilestone)", function(next) { + client.issues.createMilestone( + { + user: "String", + repo: "String", + title: "String", + state: "String", + description: "String", + due_on: "Date" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo/milestones/:number (updateMilestone)", function(next) { + client.issues.updateMilestone( + { + user: "String", + repo: "String", + number: "Number", + title: "String", + state: "String", + description: "String", + due_on: "Date" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/milestones/:number (deleteMilestone)", function(next) { + client.issues.deleteMilestone( + { + user: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + });*/ +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/markdown.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/markdown.js new file mode 100644 index 00000000..c7882c95 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/markdown.js @@ -0,0 +1,114 @@ +/** + * mixin markdown + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var markdown = module.exports = { + markdown: {} +}; + +(function() { + /** section: github + * markdown#render(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - text (String): Required. The Markdown text to render + * - mode (String): Optional. The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly. Validation rule: ` ^(markdown|gfm)$ `. + * - context (String): Optional. The repository context, only taken into account when rendering as `gfm` + **/ + this.render = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * markdown#renderRaw(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - data (String): Required. Raw data to send as the body of the request + **/ + this.renderRaw = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(markdown.markdown); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/markdownTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/markdownTest.js new file mode 100644 index 00000000..29846a0f --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/markdownTest.js @@ -0,0 +1,56 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[markdown]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + /*client.authenticate({ + type: "oauth", + token: token + });*/ + }); + + it("should successfully execute POST /markdown (render)", function(next) { + client.markdown.render( + { + text: "Hello world github/linguist#1 **cool**, and #1!", + mode: "gfm", + context: "github/gollem" + }, + function(err, res) { + Assert.equal(err, null); + console.log(res); + next(); + } + ); + }); + + it("should successfully execute POST /markdown/raw (render)", function(next) { + client.markdown.renderRaw( + { + data: "Hello world github/linguist#1 **cool**, and #1!" + }, + function(err, res) { + Assert.equal(err, null); + console.log(res); + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/misc.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/misc.js new file mode 100644 index 00000000..6d3723b2 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/misc.js @@ -0,0 +1,157 @@ +/** + * mixin misc + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var misc = module.exports = { + misc: {} +}; + +(function() { + /** section: github + * misc#emojis(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ + this.emojis = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * misc#meta(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ + this.meta = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * misc#rateLimit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ + this.rateLimit = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(misc.misc); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/miscTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/miscTest.js new file mode 100644 index 00000000..6cee44f2 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/miscTest.js @@ -0,0 +1,69 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[misc]", function() { + var client; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + }); + + it("should successfully execute GET /emojis (emojis)", function(next) { + client.misc.emojis( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + Assert.ifError(err); + // A common emoji on github + Assert('shipit' in res); + next(); + } + ); + }); + + it("should successfully execute GET /meta (meta)", function(next) { + client.misc.meta( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + Assert('hooks' in res); + Assert('git' in res); + next(); + } + ); + }); + + it("should successfully execute GET /rate_limit (rateLimit)", function(next) { + client.misc.rateLimit( + {}, + function(err, res) { + Assert.equal(err, null); + Assert('resources' in res); + Assert('core' in res.resources); + Assert(typeof res.resources.core.limit === 'number'); + Assert(typeof res.resources.core.remaining === 'number'); + Assert(typeof res.resources.core.reset === 'number'); + Assert('search' in res.resources); + Assert(typeof res.resources.search.limit === 'number'); + Assert(typeof res.resources.search.remaining === 'number'); + Assert(typeof res.resources.search.reset === 'number'); + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/orgs.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/orgs.js new file mode 100644 index 00000000..e584c4ea --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/orgs.js @@ -0,0 +1,1140 @@ +/** + * mixin orgs + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var orgs = module.exports = { + orgs: {} +}; + +(function() { + /** section: github + * orgs#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - billing_email (String): Optional. Billing email address. This address is not publicized. + * - company (String): Optional. + * - email (String): Optional. Publicly visible email address. + * - location (String): Optional. + * - name (String): Optional. + **/ + this.update = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getMembers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - filter (String): Optional. Validation rule: ` ^(all|2fa_disabled)$ `. + **/ + this.getMembers = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ + this.getMember = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#removeMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ + this.removeMember = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getPublicMembers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + **/ + this.getPublicMembers = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getPublicMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ + this.getPublicMember = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#publicizeMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ + this.publicizeMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#concealMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - user (String): Required. + **/ + this.concealMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getTeams(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getTeams = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.getTeam = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#createTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - name (String): Required. + * - repo_names (Array): Optional. Array of strings + * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. + **/ + this.createTeam = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#updateTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - name (String): Required. + * - permission (String): Optional. `pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories. Validation rule: ` ^(pull|push|admin)$ `. + **/ + this.updateTeam = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#deleteTeam(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.deleteTeam = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getTeamMembers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getTeamMembers = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getTeamMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ + this.getTeamMember = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#addTeamMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ + this.addTeamMember = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#deleteTeamMember(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ + this.deleteTeamMember = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#addTeamMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + **/ + this.addTeamMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getTeamRepos(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getTeamRepos = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#getTeamRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getTeamRepo = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#addTeamRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + **/ + this.addTeamRepo = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * orgs#deleteTeamRepo(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - user (String): Required. + * - repo (String): Required. + **/ + this.deleteTeamRepo = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(orgs.orgs); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/orgsTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/orgsTest.js new file mode 100644 index 00000000..44faeed8 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/orgsTest.js @@ -0,0 +1,361 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[orgs]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /users/:user/orgs (getFromUser)", function(next) { + client.orgs.getFromUser( + { + user: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org (get)", function(next) { + client.orgs.get( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /orgs/:org (update)", function(next) { + client.orgs.update( + { + org: "String", + billing_email: "String", + company: "String", + email: "String", + location: "String", + name: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/members (getMembers)", function(next) { + client.orgs.getMembers( + { + org: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/members/:user (getMember)", function(next) { + client.orgs.getMember( + { + org: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/members/:user (removeMember)", function(next) { + client.orgs.removeMember( + { + org: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/public_members (getPublicMembers)", function(next) { + client.orgs.getPublicMembers( + { + org: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/public_members/:user (getPublicMember)", function(next) { + client.orgs.getPublicMember( + { + org: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /orgs/:org/public_members/:user (publicizeMembership)", function(next) { + client.orgs.publicizeMembership( + { + org: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /orgs/:org/public_members/:user (concealMembership)", function(next) { + client.orgs.concealMembership( + { + org: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/teams (getTeams)", function(next) { + client.orgs.getTeams( + { + org: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id (getTeam)", function(next) { + client.orgs.getTeam( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /orgs/:org/teams (createTeam)", function(next) { + client.orgs.createTeam( + { + org: "String", + name: "String", + repo_names: "Array", + permission: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /teams/:id (updateTeam)", function(next) { + client.orgs.updateTeam( + { + id: "String", + name: "String", + permission: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /teams/:id (deleteTeam)", function(next) { + client.orgs.deleteTeam( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/members (getTeamMembers)", function(next) { + client.orgs.getTeamMembers( + { + id: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/members/:user (getTeamMember)", function(next) { + client.orgs.getTeamMember( + { + id: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /teams/:id/members/:user (addTeamMember)", function(next) { + client.orgs.addTeamMember( + { + id: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /teams/:id/members/:user (deleteTeamMember)", function(next) { + client.orgs.deleteTeamMember( + { + id: "String", + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/repos (getTeamRepos)", function(next) { + client.orgs.getTeamRepos( + { + id: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /teams/:id/repos/:user/:repo (getTeamRepo)", function(next) { + client.orgs.getTeamRepo( + { + id: "String", + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /teams/:id/repos/:user/:repo (addTeamRepo)", function(next) { + client.orgs.addTeamRepo( + { + id: "String", + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /teams/:id/repos/:user/:repo (deleteTeamRepo)", function(next) { + client.orgs.deleteTeamRepo( + { + id: "String", + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/pullRequests.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/pullRequests.js new file mode 100644 index 00000000..56c095f9 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/pullRequests.js @@ -0,0 +1,757 @@ +/** + * mixin pullRequests + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var pullRequests = module.exports = { + pullRequests: {} +}; + +(function() { + /** section: github + * pullRequests#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - state (String): Optional. open, closed, or all Validation rule: ` ^(open|closed|all)$ `. + * - head (String): Optional. + * - base (String): Optional. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - sort (String): Optional. Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created` Validation rule: ` ^(created|updated|popularity|long-running)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + **/ + this.getAll = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - body (String): Optional. + * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. The branch (or git ref) where your changes are implemented. + **/ + this.create = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#createFromIssue(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - issue (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. The branch (or git ref) where your changes are implemented. + **/ + this.createFromIssue = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - state (String): Optional. Validation rule: ` ^(open|closed)$ `. + * - title (String): Required. + * - body (String): Optional. + **/ + this.update = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#getCommits(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getCommits = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#getFiles(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFiles = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#getMerged(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getMerged = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#merge(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - commit_message (String): Optional. The message that will be used for the merge commit + **/ + this.merge = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#getComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getComments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#getComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ + this.getComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#createComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + * - commit_id (String): Required. Sha of the commit to comment on. + * - path (String): Required. Relative path of the file to comment on. + * - position (Number): Required. Column index in the diff to comment on. + **/ + this.createComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#createCommentReply(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + * - in_reply_to (Number): Required. + **/ + this.createCommentReply = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#updateComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + * - body (String): Required. + **/ + this.updateComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * pullRequests#deleteComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - number (Number): Required. Validation rule: ` ^[0-9]+$ `. + **/ + this.deleteComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(pullRequests.pullRequests); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/pullRequestsTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/pullRequestsTest.js new file mode 100644 index 00000000..0b47fe8e --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/pullRequestsTest.js @@ -0,0 +1,281 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[pullRequests]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /repos/:user/:repo/pulls (getAll)", function(next) { + client.pullRequests.getAll( + { + user: "String", + repo: "String", + base: "String", + head: "String", + state: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/pulls/:number (get)", function(next) { + client.pullRequests.get( + { + user: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/pulls (create)", function(next) { + client.pullRequests.create( + { + user: "String", + repo: "String", + title: "String", + body: "String", + base: "String", + head: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/pulls (createFromIssue)", function(next) { + client.pullRequests.createFromIssue( + { + user: "String", + repo: "String", + issue: "Number", + base: "String", + head: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo/pulls/:number (update)", function(next) { + client.pullRequests.update( + { + user: "String", + repo: "String", + number: "Number", + state: "String", + title: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/pulls/:number/commits (getCommits)", function(next) { + client.pullRequests.getCommits( + { + user: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/pulls/:number/files (getFiles)", function(next) { + client.pullRequests.getFiles( + { + user: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/pulls/:number/merge (getMerged)", function(next) { + client.pullRequests.getMerged( + { + user: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:user/:repo/pulls/:number/merge (merge)", function(next) { + client.pullRequests.merge( + { + user: "String", + repo: "String", + number: "Number", + commit_message: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/pulls/:number/comments (getComments)", function(next) { + client.pullRequests.getComments( + { + user: "String", + repo: "String", + number: "Number", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/pulls/comments/:number (getComment)", function(next) { + client.pullRequests.getComment( + { + user: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/pulls/:number/comments (createComment)", function(next) { + client.pullRequests.createComment( + { + user: "String", + repo: "String", + number: "Number", + body: "String", + commit_id: "String", + path: "String", + position: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/pulls/:number/comments (createCommentReply)", function(next) { + client.pullRequests.createCommentReply( + { + user: "String", + repo: "String", + number: "Number", + body: "String", + in_reply_to: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo/pulls/comments/:number (updateComment)", function(next) { + client.pullRequests.updateComment( + { + user: "String", + repo: "String", + number: "Number", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/pulls/comments/:number (deleteComment)", function(next) { + client.pullRequests.deleteComment( + { + user: "String", + repo: "String", + number: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/releases.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/releases.js new file mode 100644 index 00000000..1d83380e --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/releases.js @@ -0,0 +1,507 @@ +/** + * mixin releases + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var releases = module.exports = { + releases: {} +}; + +(function() { + /** section: github + * releases#listReleases(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.listReleases = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#getRelease(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + **/ + this.getRelease = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#createRelease(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - repo (String): Required. + * - tag_name (String): Required. String of the tag + * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * - name (String): Optional. + * - body (String): Optional. + * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false + * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false + **/ + this.createRelease = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#editRelease(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + * - tag_name (String): Required. String of the tag + * - target_commitish (String): Optional. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master). + * - name (String): Optional. + * - body (String): Optional. + * - draft (Boolean): Optional. true to create a draft (unpublished) release, false to create a published one. Default: false + * - prerelease (Boolean): Optional. true to identify the release as a prerelease. false to identify the release as a full release. Default: false + **/ + this.editRelease = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#deleteRelease(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + **/ + this.deleteRelease = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#listAssets(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + **/ + this.listAssets = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#getAsset(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + **/ + this.getAsset = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#uploadAsset(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + * - name (String): Required. the file name of the asset + **/ + this.uploadAsset = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#editAsset(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + * - name (String): Required. + * - label (String): Optional. An alternate short description of the asset. Used in place of the filename. + **/ + this.editAsset = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * releases#deleteAsset(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - owner (String): Required. + * - id (Number): Required. + * - repo (String): Required. + **/ + this.deleteAsset = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(releases.releases); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/releasesTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/releasesTest.js new file mode 100644 index 00000000..9b7e44e1 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/releasesTest.js @@ -0,0 +1,262 @@ + /* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); +var fs = require("fs"); +var mime = require("mime"); + +describe("[releases]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + var owner = "greggman"; + var repo = "test"; + var haveWriteAccess = true; // set to false if the authenticated person below does not have write access to the repo above + var releaseIdWithAsset = 393621; // Some release id from the repo above that has at least 1 asset. + var filePathToUpload = __filename; + var fileSizeToUpload = fs.statSync(filePathToUpload).size; + + var releaseId; // release id found when listing releases. Used for get release + var newReleaseId; // release id created when creating release, used for edit and delete release + var assetId; // asset id found when listing assets. Used for get asset + var newAssetId; // asset id used when creating asset. Used for edit and delete asset + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases (listReleases)", function(next) { + client.releases.listReleases( + { + owner: owner, + repo: repo, + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res instanceof Array); + if (res instanceof Array && res.length > 0) { + releaseId = res[0].id; + } + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/:id (getRelease)", function(next) { + if (!releaseId) { + next(); + return; + } + client.releases.getRelease( + { + owner: owner, + id: releaseId, + repo: repo + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.id, releaseId); + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/releases (createRelease)", function(next) { + if (!haveWriteAccess) { + next(); + return; + } + client.releases.createRelease( + { + owner: owner, + repo: repo, + tag_name: "node-github-tag", + target_commitish: "master", + name: "node-github-name", + body: "node-github-body", + draft: false, + prerelease: true, + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.tag_name, "node-github-tag"); + Assert.equal(res.target_commitish, "master"); + Assert.equal(res.name, "node-github-name"); + Assert.equal(res.body, "node-github-body"); + Assert.equal(res.assets.length, 0); + Assert.ok(res.prerelease); + Assert.ok(!res.draft); + newReleaseId = res.id; + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/releases/:id (editRelease)", function(next) { + if (!haveWriteAccess) { + next(); + return; + } + client.releases.editRelease( + { + owner: owner, + id: newReleaseId, + repo: repo, + tag_name: "node-github-new-tag", + target_commitish: "master", + name: "node-github-new-name", + body: "node-github-new-body", + draft: true, + prerelease: true, + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.id, newReleaseId); + Assert.equal(res.tag_name, "node-github-new-tag"); + Assert.equal(res.target_commitish, "master"); + Assert.equal(res.name, "node-github-new-name"); + Assert.equal(res.body, "node-github-new-body"); + Assert.equal(res.assets.length, 0); + Assert.ok(res.prerelease); + Assert.ok(res.draft); + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/releases/:id (deleteRelease)", function(next) { + if (!haveWriteAccess) { + next(); + return; + } + client.releases.deleteRelease( + { + owner: owner, + repo: repo, + id: newReleaseId, + }, + function(err, res) { + Assert.equal(err, null); + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/:id/assets (listAssets)", function(next) { + client.releases.listAssets( + { + owner: owner, + id: releaseIdWithAsset, + repo: repo + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res instanceof Array); + if (res instanceof Array && res.length > 0) { + assetId = res[0].id; + } + next(); + } + ); + }); + + it("should successfully execute GET /repos/:owner/:repo/releases/assets/:id (getAsset)", function(next) { + if (!assetId) { + next(); + return; + } + client.releases.getAsset( + { + owner: owner, + id: assetId, + repo: repo + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.id, assetId); + next(); + } + ); + }); + + it("should successfully execute POST /repos/:owner/:repo/releases/:id/assets (uploadAsset)", function(next) { + var name = "somenameornot.zip"; + client.releases.uploadAsset( + { + owner: owner, + id: releaseIdWithAsset, + repo: repo, + name: name, + filePath: filePathToUpload + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.content_type, mime.lookup(name)); // matches extension of name, not filePath + Assert.equal(res.state, "uploaded"); + Assert.equal(res.size, fileSizeToUpload); + Assert.equal(res.name, name); + newAssetId = res.id; + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:owner/:repo/releases/assets/:id (editAsset)", function(next) { + if (!newAssetId) { + next(); + return; + } + var newName = "somenewname.zip"; + client.releases.editAsset( + { + owner: owner, + id: newAssetId, + repo: repo, + name: newName, + label: "foo" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.state, "uploaded"); + Assert.equal(res.size, fileSizeToUpload); + Assert.equal(res.name, newName); + Assert.equal(res.label, "foo"); + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:owner/:repo/releases/assets/:id (deleteAsset)", function(next) { + if (!newAssetId) { + next(); + return; + } + client.releases.deleteAsset( + { + owner: owner, + id: newAssetId, + repo: repo + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/repos.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/repos.js new file mode 100644 index 00000000..4229d18d --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/repos.js @@ -0,0 +1,3548 @@ +/** + * mixin repos + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var repos = module.exports = { + repos: {} +}; + +(function() { + /** section: github + * repos#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - type (String): Optional. Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`. Validation rule: ` ^(all|owner|public|private|member)$ `. + * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getAll = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - type (String): Optional. Possible values: `all`, `owner`, `member`. Default: `public`. Validation rule: ` ^(all|owner|member)$ `. + * - sort (String): Optional. Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`. Validation rule: ` ^(created|updated|pushed|full_name)$ `. + * - direction (String): Optional. Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getFromOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - type (String): Optional. Possible values: `all`, `public`, `member`. Default: `all`. Validation rule: ` ^(all|public|member)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFromOrg = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - name (String): Required. + * - description (String): Optional. + * - homepage (String): Optional. + * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * - has_issues (Boolean): Optional. True to enable issues for this repository, false to disable them. Default is true. + * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. + * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. + * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false + * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + **/ + this.create = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createFromOrg(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - name (String): Required. + * - description (String): Optional. + * - homepage (String): Optional. + * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * - has_issues (Boolean): Optional. True to enable issues for this repository, false to disable them. Default is true. + * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. + * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. + * - auto_init (Boolean): Optional. True to create an initial commit with empty README. Default is false + * - gitignore_template (String): Optional. Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided. + * - team_id (Number): Optional. The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization. Validation rule: ` ^[0-9]+$ `. + **/ + this.createFromOrg = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#one(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.one = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - description (String): Optional. + * - homepage (String): Optional. + * - private (Boolean): Optional. True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false. + * - has_issues (Boolean): Optional. True to enable issues for this repository, false to disable them. Default is true. + * - has_wiki (Boolean): Optional. True to enable the wiki for this repository, false to disable it. Default is true. + * - has_downloads (Boolean): Optional. True to enable downloads for this repository, false to disable them. Default is true. + * - default_branch (String): Optional. Updates the default branch for this repository. + **/ + this.update = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#delete(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.delete = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#merge(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. The branch (or git ref) where your changes are implemented. + * - commit_message (String): Optional. Commit message to use for the merge commit. If omitted, a default message will be used. + **/ + this.merge = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getContributors(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - anon (Boolean): Optional. Set to 1 or true to include anonymous contributors in results. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getContributors = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getLanguages(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getLanguages = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getTeams(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getTeams = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getTags(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getTags = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getBranches(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getBranches = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getBranch(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - branch (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getBranch = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getCollaborators(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getCollaborators = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getCollaborator(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. + **/ + this.getCollaborator = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#addCollaborator(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. + **/ + this.addCollaborator = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#removeCollaborator(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - collabuser (String): Required. + **/ + this.removeCollaborator = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getCommits(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Optional. Sha or branch to start listing commits from. + * - path (String): Optional. Only commits containing this file path will be returned. + * - author (String): Optional. GitHub login or email address by which to filter by commit author. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + * - since (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + * - until (Date): Optional. Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ + **/ + this.getCommits = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getCommit(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ + this.getCommit = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getAllCommitComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getAllCommitComments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getCommitComments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getCommitComments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - body (String): Required. + * - commit_id (String): Required. Sha of the commit to comment on. + * - path (String): Optional. Relative path of the file to comment on. + * - position (Number): Optional. Line index in the diff to comment on. + * - line (Number): Optional. Line number in the file to comment on. Defaults to 1. + **/ + this.createCommitComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getCommitComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#updateCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - body (String): Required. + **/ + this.updateCommitComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#compareCommits(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - base (String): Required. The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo. + * - head (String): Required. The branch (or git ref) where your changes are implemented. + **/ + this.compareCommits = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#deleteCommitComment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.deleteCommitComment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getReadme(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. + **/ + this.getReadme = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getContent(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Optional. The content path. + * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. + **/ + this.getContent = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createContent(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - content (String): Optional. + * - message (String): Optional. + * - path (String): Optional. The content path. + * - ref (String): Optional. The String name of the Commit/Branch/Tag. Defaults to master. + **/ + this.createContent = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createFile(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required. The content path. + * - message (String): Required. The commit message. + * - content (String): Required. The new file content, Base64 encoded. + * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). + * - author (Json): Optional. + * - committer (Json): Optional. + **/ + this.createFile = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#updateFile(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required. The content path. + * - message (String): Required. The commit message. + * - content (String): Required. The updated file content, Base64 encoded. + * - sha (String): Required. The blob SHA of the file being replaced. + * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). + * - author (Json): Optional. + * - committer (Json): Optional. + **/ + this.updateFile = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#deleteFile(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - path (String): Required. The content path. + * - message (String): Required. The commit message. + * - sha (String): Required. The blob SHA of the file being removed. + * - branch (String): Optional. The branch name. If not provided, uses the repository’s default branch (usually master). + * - author (Json): Optional. + * - committer (Json): Optional. + **/ + this.deleteFile = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getArchiveLink(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - ref (String): Optional. String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected. + * - archive_format (String): Required. Either tarball or zipball Validation rule: ` ^(tarball|zipball)$ `. + **/ + this.getArchiveLink = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getDownloads(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getDownloads = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getDownload(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getDownload = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#deleteDownload(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.deleteDownload = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getForks(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sort (String): Optional. Possible values: `newest`, `oldest`, `watchers`, default: `newest`. Validation rule: ` ^(newest|oldest|watchers)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getForks = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#fork(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - organization (String): Optional. Organization login. The repository will be forked into this organization. + **/ + this.fork = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getKeys(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getKeys = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - title (String): Required. + * - key (String): Required. + **/ + this.createKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#updateKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - title (String): Required. + * - key (String): Required. + **/ + this.updateKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#deleteKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.deleteKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStargazers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getStargazers = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStarred(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getStarred = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStarredFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getStarredFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStarring(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getStarring = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#star(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.star = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#unStar(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.unStar = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getWatchers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getWatchers = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getWatched(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getWatched = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getWatchedFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getWatchedFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getWatching(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getWatching = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#watch(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.watch = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#unWatch(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.unWatch = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getHooks(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getHooks = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getHook = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - name (String): Required. + * - config (Json): Required. A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * - events (Array): Optional. Determines what events the hook is triggered for. Default: `['push']`. + * - active (Boolean): Optional. Determines whether the hook is actually triggered on pushes. + **/ + this.createHook = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#updateHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + * - name (String): Required. + * - config (Json): Required. A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically. + * - events (Array): Optional. Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`. + * - add_events (Array): Optional. Determines a list of events to be added to the list of events that the Hook triggers for. + * - remove_events (Array): Optional. Determines a list of events to be removed from the list of events that the Hook triggers for. + * - active (Boolean): Optional. Determines whether the hook is actually triggered on pushes. + **/ + this.updateHook = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#testHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.testHook = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#deleteHook(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.deleteHook = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsContributors(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsContributors = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsCommitActivity(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsCommitActivity = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsCodeFrequency(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsCodeFrequency = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsParticipation(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsParticipation = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getStatsPunchCard(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + **/ + this.getStatsPunchCard = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getDeployments(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - sha (String): Optional. The short or long sha that was recorded at creation time. Default: none. + * - ref (String): Optional. The name of the ref. This can be a branch, tag, or sha. Default: none. + * - task (String): Optional. The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none. + * - environment (String): Optional. The name of the environment that was deployed to. e.g. staging or production. Default: none. + * - user (String): Required. + * - repo (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getDeployments = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createDeployment(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - ref (String): Required. The ref to deploy. This can be a branch, tag, or sha. + * - task (String): Required. The named task to execute. e.g. deploy or deploy:migrations. Default: deploy + * - auto_merge (Boolean): Optional. Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true + * - required_contexts (Array): Optional. Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts. + * - payload (String): Optional. Optional JSON payload with extra information about the deployment. Default: '' + * - environment (String): Optional. The name of the environment that was deployed to. e.g. staging or production. Default: none. + * - description (String): Optional. Optional short description. Default: '' + * - user (String): Required. + * - repo (String): Required. + **/ + this.createDeployment = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#getDeploymentStatuses(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.getDeploymentStatuses = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * repos#createDeploymentStatus(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - state (String): Optional. The state of the status. Can be one of pending, success, error, or failure. + * - target_url (String): Optional. The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: '' + * - description (String): Optional. A short description of the status. Default: '' + * - user (String): Required. + * - repo (String): Required. + * - id (String): Required. + **/ + this.createDeploymentStatus = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(repos.repos); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/reposTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/reposTest.js new file mode 100644 index 00000000..356fab65 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/reposTest.js @@ -0,0 +1,1126 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[repos]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /user/repos (getAll)", function(next) { + client.repos.getAll( + { + type: "String", + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/repos (getFromUser)", function(next) { + client.repos.getFromUser( + { + user: "String", + type: "String", + sort: "String", + direction: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /orgs/:org/repos (getFromOrg)", function(next) { + client.repos.getFromOrg( + { + org: "String", + type: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /user/repos (create)", function(next) { + client.repos.create( + { + name: "String", + description: "String", + homepage: "String", + private: "Boolean", + has_issues: "Boolean", + has_wiki: "Boolean", + has_downloads: "Boolean", + auto_init: "Boolean", + gitignore_template: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /orgs/:org/repos (createFromOrg)", function(next) { + client.repos.createFromOrg( + { + org: "String", + name: "String", + description: "String", + homepage: "String", + private: "Boolean", + has_issues: "Boolean", + has_wiki: "Boolean", + has_downloads: "Boolean", + auto_init: "Boolean", + gitignore_template: "String", + team_id: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo (get)", function(next) { + client.repos.get( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo (update)", function(next) { + client.repos.update( + { + user: "String", + repo: "String", + name: "String", + description: "String", + homepage: "String", + private: "Boolean", + has_issues: "Boolean", + has_wiki: "Boolean", + has_downloads: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo (delete)", function(next) { + client.repos.delete( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/merges (merge)", function(next) { + client.repos.merge( + { + user: "String", + repo: "String", + base: "String", + head: "String", + commit_message: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/contributors (getContributors)", function(next) { + client.repos.getContributors( + { + user: "String", + repo: "String", + anon: "Boolean", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/languages (getLanguages)", function(next) { + client.repos.getLanguages( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/teams (getTeams)", function(next) { + client.repos.getTeams( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/tags (getTags)", function(next) { + client.repos.getTags( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/branches (getBranches)", function(next) { + client.repos.getBranches( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/branches/:branch (getBranch)", function(next) { + client.repos.getBranches( + { + user: "String", + repo: "String", + branch: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/collaborators (getCollaborators)", function(next) { + client.repos.getCollaborators( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/collaborators/:collabuser (getCollaborator)", function(next) { + client.repos.getCollaborator( + { + user: "String", + repo: "String", + collabuser: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:user/:repo/collaborators/:collabuser (addCollaborator)", function(next) { + client.repos.addCollaborator( + { + user: "String", + repo: "String", + collabuser: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/collaborators/:collabuser (removeCollaborator)", function(next) { + client.repos.removeCollaborator( + { + user: "String", + repo: "String", + collabuser: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/commits (getCommits)", function(next) { + client.repos.getCommits( + { + user: "String", + repo: "String", + sha: "String", + path: "String", + page: "Number", + per_page: "Number", + author: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/commits/:sha (getCommit)", function(next) { + client.repos.getCommit( + { + user: "String", + repo: "String", + sha: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/comments (getAllCommitComments)", function(next) { + client.repos.getAllCommitComments( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/commits/:sha/comments (getCommitComments)", function(next) { + client.repos.getCommitComments( + { + user: "String", + repo: "String", + sha: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/commits/:sha/comments (createCommitComment)", function(next) { + client.repos.createCommitComment( + { + user: "String", + repo: "String", + sha: "String", + body: "String", + commit_id: "String", + path: "String", + position: "Number", + line: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/comments/:id (getCommitComment)", function(next) { + client.repos.getCommitComment( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo/comments/:id (updateCommitComment)", function(next) { + client.repos.updateCommitComment( + { + user: "String", + repo: "String", + id: "String", + body: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/compare/:base...:head (compareCommits)", function(next) { + client.repos.compareCommits( + { + user: "String", + repo: "String", + base: "String", + head: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/comments/:id (deleteCommitComment)", function(next) { + client.repos.deleteCommitComment( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/readme (getReadme)", function(next) { + client.repos.getReadme( + { + user: "String", + repo: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/contents/:path (getContent)", function(next) { + client.repos.getContent( + { + user: "String", + repo: "String", + path: "String", + ref: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + it("should successfully execute GET /repos/:user/:repo/contents/:path (createContent)", function(next) { + client.repos.getContent( + { + user: "String", + repo: "String", + path: "String", + ref: "String", + content:"String", + message:"String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:user/:repo/contents/:path (createFile)", function(next) { + client.repos.createFile( + { + user: "String", + repo: "String", + path: "String", + message: "String", + content: "String", + branch: "String", + author: "Json", + committer: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:user/:repo/contents/:path (updateFile)", function(next) { + client.repos.updateFile( + { + user: "String", + repo: "String", + path: "String", + message: "String", + content: "String", + sha: "String", + branch: "String", + author: "Json", + committer: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/contents/:path (deleteFile)", function(next) { + client.repos.deleteFile( + { + user: "String", + repo: "String", + path: "String", + message: "String", + sha: "String", + branch: "String", + author: "Json", + committer: "Json" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/:archive_format/:ref (getArchiveLink)", function(next) { + client.repos.getArchiveLink( + { + user: "String", + repo: "String", + archive_format: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/downloads (getDownloads)", function(next) { + client.repos.getDownloads( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/downloads/:id (getDownload)", function(next) { + client.repos.getDownload( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/downloads/:id (deleteDownload)", function(next) { + client.repos.deleteDownload( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/forks (getForks)", function(next) { + client.repos.getForks( + { + user: "String", + repo: "String", + sort: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/forks (fork)", function(next) { + client.repos.fork( + { + user: "String", + repo: "String", + organization: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/keys (getKeys)", function(next) { + client.repos.getKeys( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/keys/:id (getKey)", function(next) { + client.repos.getKey( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/keys (createKey)", function(next) { + client.repos.createKey( + { + user: "String", + repo: "String", + title: "String", + key: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /repos/:user/:repo/keys/:id (updateKey)", function(next) { + client.repos.updateKey( + { + user: "String", + repo: "String", + id: "String", + title: "String", + key: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/keys/:id (deleteKey)", function(next) { + client.repos.deleteKey( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stargazers (getStargazers)", function(next) { + client.repos.getStargazers( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/starred (getStarred)", function(next) { + client.repos.getStarred( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/starred (getStarredFromUser)", function(next) { + client.repos.getStarredFromUser( + { + user: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/starred/:user/:repo (getStarring)", function(next) { + client.repos.getStarring( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /user/starred/:user/:repo (watch)", function(next) { + client.repos.watch( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/starred/:user/:repo (unWatch)", function(next) { + client.repos.unWatch( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/watchers (getWatchers)", function(next) { + client.repos.getWatchers( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/watched (getWatched)", function(next) { + client.repos.getWatched( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/watched (getWatchedFromUser)", function(next) { + client.repos.getWatchedFromUser( + { + user: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/watched/:user/:repo (getWatching)", function(next) { + client.repos.getWatching( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /user/watched/:user/:repo (watch)", function(next) { + client.repos.watch( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/watched/:user/:repo (unWatch)", function(next) { + client.repos.unWatch( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/hooks (getHooks)", function(next) { + client.repos.getHooks( + { + user: "String", + repo: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/hooks/:id (getHook)", function(next) { + client.repos.getHook( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/hooks (createHook)", function(next) { + client.repos.createHook( + { + user: "String", + repo: "String", + name: "String", + config: "Json", + events: "Array", + active: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /repos/:user/:repo/hooks/:id (updateHook)", function(next) { + client.repos.updateHook( + { + user: "String", + repo: "String", + id: "String", + name: "String", + config: "Json", + events: "Array", + add_events: "Array", + remove_events: "Array", + active: "Boolean" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/hooks/:id/test (testHook)", function(next) { + client.repos.testHook( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /repos/:user/:repo/hooks/:id (deleteHook)", function(next) { + client.repos.deleteHook( + { + user: "String", + repo: "String", + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/contributors (getStatsContributors)", function(next) { + client.repos.getStatsContributors( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/commit_activity (getStatsCommitActivity)", function(next) { + client.repos.getStatsCommitActivity( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/code_frequency (getStatsCodeFrequency)", function(next) { + client.repos.getStatsCodeFrequency( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/participation (getStatsParticipation)", function(next) { + client.repos.getStatsParticipation( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/stats/punch_card (getStatsPunchCard)", function(next) { + client.repos.getStatsPunchCard( + { + user: "String", + repo: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/routes.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/routes.json new file mode 100644 index 00000000..f82c8bfa --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/routes.json @@ -0,0 +1,3914 @@ +{ + "defines": { + "constants": { + "name": "Github", + "description": "A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API.", + "protocol": "https", + "host": "api.github.com", + "port": 443, + "dateFormat": "YYYY-MM-DDTHH:MM:SSZ", + "requestFormat": "json", + "requestMedia": "application/vnd.github.v3+json" + }, + "response-headers": [ + "X-RateLimit-Limit", + "X-RateLimit-Remaining", + "X-RateLimit-Reset", + "X-Oauth-Scopes", + "Link", + "Location", + "Last-Modified", + "Etag", + "Status" + ], + "request-headers": [ + "If-Modified-Since", + "If-None-Match", + "Cookie", + "User-Agent", + "Accept", + "X-GitHub-OTP" + ], + "params": { + "files": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'" + }, + "user": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "org": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "repo": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "branch": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "sha": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "gist_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Id (SHA1 hash) of the gist." + }, + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected." + }, + "number": { + "type": "Number", + "required": true, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "" + }, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "direction": { + "type": "String", + "required": false, + "validation": "^(asc|desc)$", + "invalidmsg": "asc or desc, default: desc.", + "description": "" + }, + "since": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + }, + "until": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed)$", + "invalidmsg": "open, closed, default: open", + "description": "" + }, + "color": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "6 character hex code, without a leading #.", + "description": "6 character hex code, without a leading #." + }, + "permission": { + "type": "String", + "required": false, + "validation": "^(pull|push|admin)$", + "invalidmsg": "", + "description": "`pull` - team members can pull, but not push or administer this repositories (Default), `push` - team members can pull and push, but not administer this repositores, `admin` - team members can pull, push and administer these repositories." + }, + "base": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The branch (or git ref) you want your changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repo that requests a merge to a base of another repo." + }, + "head": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The branch (or git ref) where your changes are implemented." + }, + "commit_id": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "Sha of the commit to comment on.", + "description": "Sha of the commit to comment on." + }, + "line": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "Line index in the diff to comment on.", + "description": "Line index in the diff to comment on." + }, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "Relative path of the file to comment on.", + "description": "Relative path of the file to comment on." + }, + "position": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "Column index in the diff to comment on.", + "description": "Column index in the diff to comment on." + }, + "body": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "homepage": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "private": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to create a private repository, false to create a public one. Creating private repositories requires a paid GitHub account. Default is false." + }, + "has_issues": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to enable issues for this repository, false to disable them. Default is true." + }, + "has_wiki": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to enable the wiki for this repository, false to disable it. Default is true." + }, + "has_downloads": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to enable downloads for this repository, false to disable them. Default is true." + }, + "default_branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Updates the default branch for this repository." + }, + "collabuser": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "key": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "page": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "Page number of the results to fetch." + }, + "per_page": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "A custom page size up to 100. Default is 30." + }, + "scopes": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A list of scopes that this authorization is in." + }, + "note": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A note to remind you what the OAuth token is for." + }, + "note_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A URL to remind you what app the OAuth token is for." + }, + "auto_init": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "True to create an initial commit with empty README. Default is false" + }, + "gitignore_template": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Desired language or platform .gitignore template to apply. Ignored if auto_init parameter is not provided." + }, + "content": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "message": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "order": { + "type": "String", + "required": false, + "validation": "^(asc|desc)$", + "invalidmsg": "The sort order if sort parameter is provided. One of asc or desc. Default: desc", + "description": "asc or desc" + }, + "q": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Search Term", + "combined": true + }, + "data": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Raw data to send as the body of the request" + } + } + }, + + "gists": { + "get-all": { + "url": "/gists", + "method": "GET", + "params": { + "$page": null, + "$per_page": null, + "$since": null + } + }, + + "get-from-user": { + "url": "/users/:user/gists", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null, + "$since": null + } + }, + + "create": { + "url": "/gists", + "method": "POST", + "params": { + "$description": null, + "public": { + "type": "Boolean", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$files": null + } + }, + + "edit": { + "url": "/gists/:id", + "method": "PATCH", + "params": { + "$id": null, + "$description": null, + "$files": null + } + }, + + "public": { + "url": "/gists/public", + "method": "GET", + "params": { + "$since": null + } + }, + + "starred": { + "url": "/gists/starred", + "method": "GET", + "params": { + "$since": null + } + }, + + "get": { + "url": "/gists/:id", + "method": "GET", + "params": { + "$id": null + } + }, + + "star": { + "url": "/gists/:id/star", + "method": "PUT", + "params": { + "$id": null + } + }, + + "delete-star": { + "url": "/gists/:id/star", + "method": "DELETE", + "params": { + "$id": null + } + }, + + "check-star": { + "url": "/gists/:id/star", + "method": "GET", + "params": { + "$id": null + } + }, + + "fork": { + "url": "/gists/:id/fork", + "method": "POST", + "params": { + "$id": null + } + }, + + "delete": { + "url": "/gists/:id", + "method": "DELETE", + "params": { + "$id": null + } + }, + + "get-comments": { + "url": "/gists/:gist_id/comments", + "method": "GET", + "params": { + "$gist_id": null + } + }, + + "get-comment": { + "url": "/gists/:gist_id/comments/:id", + "method": "GET", + "params": { + "$gist_id": null, + "$id": null + } + }, + + "create-comment": { + "url": "/gists/:gist_id/comments", + "method": "POST", + "params": { + "$gist_id": null, + "$body": null + } + }, + + "edit-comment": { + "url": "/gists/:gist_id/comments/:id", + "method": "PATCH", + "params": { + "$gist_id": null, + "$id": null, + "$body": null + } + }, + + "delete-comment": { + "url": "/gists/:gist_id/comments/:id", + "method": "DELETE", + "params": { + "$gist_id": null, + "$id": null + } + } + }, + + "gitdata": { + "get-blob": { + "url": "/repos/:user/:repo/git/blobs/:sha", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null, + "$page": null, + "$per_page": null + } + }, + + "create-blob": { + "url": "/repos/:user/:repo/git/blobs", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "content": { + "type": "String", + "required": true, + "allow-empty": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "encoding": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "get-commit": { + "url": "/repos/:user/:repo/git/commits/:sha", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null + } + }, + + "create-commit": { + "url": "/repos/:user/:repo/git/commits", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the commit message" + }, + "tree": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the SHA of the tree object this commit points to" + }, + "parents": { + "type": "Array", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Array of the SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided, for a merge commit, an array of more than one should be provided." + }, + "author": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "get-reference": { + "url": "/repos/:user/:repo/git/refs/:ref", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$ref": null + } + }, + + "get-all-references": { + "url": "/repos/:user/:repo/git/refs", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "create-reference": { + "url": "/repos/:user/:repo/git/refs", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$ref": null, + "$sha": null + } + }, + + "update-reference": { + "url": "/repos/:user/:repo/git/refs/:ref", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$ref": null, + "$sha": null, + "force": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Boolean indicating whether to force the update or to make sure the update is a fast-forward update. The default is false, so leaving this out or setting it to false will make sure you’re not overwriting work." + } + } + }, + + "delete-reference": { + "url": "/repos/:user/:repo/git/refs/:ref", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$ref": null + } + }, + + "get-tag": { + "url": "/repos/:user/:repo/git/tags/:sha", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null + } + }, + + "create-tag": { + "url": "/repos/:user/:repo/git/tags", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "tag": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag" + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag message" + }, + "object": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the SHA of the git object this is tagging" + }, + "type": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the type of the object we’re tagging. Normally this is a commit but it can also be a tree or a blob." + }, + "tagger": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "JSON object that contains the following keys: `name` - String of the name of the author of the tag, `email` - String of the email of the author of the tag, `date` - Timestamp of when this object was tagged" + } + } + }, + + "get-tree": { + "url": "/repos/:user/:repo/git/trees/:sha", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null, + "recursive": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "create-tree": { + "url": "/repos/:user/:repo/git/trees", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "tree": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Array of Hash objects (of path, mode, type and sha) specifying a tree structure" + }, + "base_tree": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String of the SHA1 of the tree you want to update with new data" + } + } + } + }, + + "issues": { + "get-all": { + "url": "/issues", + "method": "GET", + "params": { + "filter": { + "type": "String", + "required": false, + "validation": "^(all|assigned|created|mentioned|subscribed)$", + "invalidmsg": "", + "description": "" + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all" + }, + "labels": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String list of comma separated Label names. Example: bug,ui,@high" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|comments)$", + "invalidmsg": "created, updated, comments, default: created.", + "description": "" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + } + }, + + "repo-issues": { + "url": "/repos/:user/:repo/issues", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "milestone": { + "type": "String", + "required": false, + "validation": "^([0-9]+|none|\\*)$", + "invalidmsg": "", + "description": "" + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all" + }, + "assignee": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String User login, `none` for Issues with no assigned User. `*` for Issues with any assigned User." + }, + "creator": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The user that created the issue." + }, + "mentioned": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String User login." + }, + "labels": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String list of comma separated Label names. Example: bug,ui,@high" + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|comments)$", + "invalidmsg": "created, updated, comments, default: created.", + "description": "" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + } + }, + + "get-repo-issue": { + "url": "/repos/:user/:repo/issues/:number", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null + } + }, + + "create": { + "url": "/repos/:user/:repo/issues", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "assignee": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Login for the user that this issue should be assigned to." + }, + "milestone": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "Milestone to associate this issue with." + }, + "labels": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Array of strings - Labels to associate with this issue." + } + } + }, + + "edit": { + "url": "/repos/:user/:repo/issues/:number", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "title": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "assignee": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Login for the user that this issue should be assigned to." + }, + "milestone": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "Milestone to associate this issue with." + }, + "labels": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Array of strings - Labels to associate with this issue." + }, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed)$", + "invalidmsg": "open, closed, default: open", + "description": "open or closed" + } + } + }, + + "repo-comments": { + "url": "/repos/:user/:repo/issues/comments", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated)$", + "invalidmsg": "created, updated, default: created.", + "description": "" + }, + "$direction": null, + "$since": null, + "$page": null, + "$per_page": null + } + }, + + "get-comments": { + "url": "/repos/:user/:repo/issues/:number/comments", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + } + }, + + "get-comment": { + "url": "/repos/:user/:repo/issues/comments/:id", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "create-comment": { + "url": "/repos/:user/:repo/issues/:number/comments", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "body": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "edit-comment": { + "url": "/repos/:user/:repo/issues/comments/:id", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$id": null, + "body": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "delete-comment": { + "url": "/repos/:user/:repo/issues/comments/:id", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "get-events": { + "url": "/repos/:user/:repo/issues/:number/events", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + } + }, + + "get-repo-events": { + "url": "/repos/:user/:repo/issues/events", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-event": { + "url": "/repos/:user/:repo/issues/events/:id", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "get-labels": { + "url": "/repos/:user/:repo/labels", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-label": { + "url": "/repos/:user/:repo/labels/:name", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$name": null + } + }, + + "create-label": { + "url": "/repos/:user/:repo/labels", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$name": null, + "$color": null + } + }, + + "update-label": { + "url": "/repos/:user/:repo/labels/:name", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$name": null, + "$color": null + } + }, + + "delete-label": { + "url": "/repos/:user/:repo/labels/:name", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$name": null + } + }, + + "get-issue-labels": { + "url": "/repos/:user/:repo/issues/:number/labels", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null + } + }, + + "get-all-milestones": { + "url": "/repos/:user/:repo/milestones", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$state": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(due_date|completeness)$", + "invalidmsg": "due_date, completeness, default: due_date", + "description": "due_date, completeness, default: due_date" + }, + "$page": null, + "$per_page": null + } + }, + + "get-milestone": { + "url": "/repos/:user/:repo/milestones/:number", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null + } + }, + + "create-milestone": { + "url": "/repos/:user/:repo/milestones", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$state": null, + "$description": null, + "due_on": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + } + } + }, + + "update-milestone": { + "url": "/repos/:user/:repo/milestones/:number", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$state": null, + "$description": null, + "due_on": { + "type": "Date", + "required": false, + "validation": "", + "invalidmsg": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ", + "description": "Timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ" + } + } + }, + + "delete-milestone": { + "url": "/repos/:user/:repo/milestones/:number", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$number": null + } + } + }, + + "authorization": { + "get-all": { + "url": "/authorizations", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + "get": { + "url": "/authorizations/:id", + "method": "GET", + "params": { + "$id": null + } + }, + "create": { + "url": "/authorizations", + "method": "POST", + "params": { + "$scopes": null, + "$note": null, + "$note_url": null + } + }, + "update": { + "url": "/authorizations/:id", + "method": "PATCH", + "params": { + "$id": null, + "$scopes": null, + "add_scopes": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A list of scopes to add to this authorization." + }, + "remove_scopes": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A list of scopes to remove from this authorization." + }, + "$note": null, + "$note_url": null + } + }, + "delete": { + "url": "/authorizations/:id", + "method": "DELETE", + "params": { + "$id": null + } + } + }, + + "orgs": { + "get-from-user": { + "url": "/users/:user/orgs", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get": { + "url": "/orgs/:org", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + } + }, + + "update": { + "url": "/orgs/:org", + "method": "PATCH", + "params": { + "$org": null, + "billing_email": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Billing email address. This address is not publicized." + }, + "company": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "email": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Publicly visible email address." + }, + "location": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "get-members": { + "url": "/orgs/:org/members", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null, + "filter": { + "type": "String", + "required": false, + "validation": "^(all|2fa_disabled)$", + "invalidmsg": "all, 2fa_disabled, default: all", + "description": "" + } + } + }, + + "get-member": { + "url": "/orgs/:org/members/:user", + "method": "GET", + "params": { + "$org": null, + "$user": null + } + }, + + "remove-member": { + "url": "/orgs/:org/members/:user", + "method": "DELETE", + "params": { + "$org": null, + "$user": null + } + }, + + "get-public-members": { + "url": "/orgs/:org/public_members", + "method": "GET", + "params": { + "$org": null + } + }, + + "get-public-member": { + "url": "/orgs/:org/public_members/:user", + "method": "GET", + "params": { + "$org": null, + "$user": null + } + }, + + "publicize-membership": { + "url": "/orgs/:org/public_members/:user", + "method": "PUT", + "params": { + "$org": null, + "$user": null + } + }, + + "conceal-membership": { + "url": "/orgs/:org/public_members/:user", + "method": "DELETE", + "params": { + "$org": null, + "$user": null + } + }, + + "get-teams": { + "url": "/orgs/:org/teams", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + } + }, + + "get-team": { + "url": "/teams/:id", + "method": "GET", + "params": { + "$id": null + } + }, + + "create-team": { + "url": "/orgs/:org/teams", + "method": "POST", + "params": { + "$org": null, + "$name": null, + "repo_names": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Array of strings" + }, + "$permission": null + } + }, + + "update-team": { + "url": "/teams/:id", + "method": "PATCH", + "params": { + "$id": null, + "$name": null, + "$permission": null + } + }, + + "delete-team": { + "url": "/teams/:id", + "method": "DELETE", + "params": { + "$id": null + } + }, + + "get-team-members": { + "url": "/teams/:id/members", + "method": "GET", + "params": { + "$id": null, + "$page": null, + "$per_page": null + } + }, + + "get-team-member": { + "url": "/teams/:id/members/:user", + "method": "GET", + "params": { + "$id": null, + "$user": null + } + }, + + "add-team-member": { + "url": "/teams/:id/members/:user", + "method": "PUT", + "params": { + "$id": null, + "$user": null + } + }, + + "delete-team-member": { + "url": "/teams/:id/members/:user", + "method": "DELETE", + "params": { + "$id": null, + "$user": null + } + }, + + "add-team-membership": { + "url": "/teams/:id/memberships/:user", + "method": "PUT", + "params": { + "$id": null, + "$user": null + } + }, + + "get-team-repos": { + "url": "/teams/:id/repos", + "method": "GET", + "params": { + "$id": null, + "$page": null, + "$per_page": null + } + }, + + "get-team-repo": { + "url": "/teams/:id/repos/:user/:repo", + "method": "GET", + "params": { + "$id": null, + "$user": null, + "$repo": null + } + }, + + "add-team-repo": { + "url": "/teams/:id/repos/:user/:repo", + "method": "PUT", + "params": { + "$id": null, + "$user": null, + "$repo": null + } + }, + + "delete-team-repo": { + "url": "/teams/:id/repos/:user/:repo", + "method": "DELETE", + "params": { + "$id": null, + "$user": null, + "$repo": null + } + } + }, + + "statuses": { + "get": { + "url": "/repos/:user/:repo/commits/:sha/statuses", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null + } + }, + + "get-combined": { + "url": "/repos/:user/:repo/commits/:sha/status", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null + } + }, + + "create": { + "url": "/repos/:user/:repo/statuses/:sha", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$sha": null, + "state": { + "type": "String", + "required": true, + "validation": "^(pending|success|error|failure)$", + "invalidmsg": "", + "description": "State of the status - can be one of pending, success, error, or failure." + }, + "target_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status." + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Short description of the status." + }, + "context": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A string label to differentiate this status from the status of other systems." + } + } + } + }, + + "pull-requests": { + "get-all": { + "url": "/repos/:user/:repo/pulls", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "state": { + "type": "String", + "required": false, + "validation": "^(open|closed|all)$", + "invalidmsg": "open, closed, all, default: open", + "description": "open, closed, or all" + }, + "head": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "base": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$page": null, + "$per_page": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|popularity|long-running)$", + "invalidmsg": "Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created`", + "description": "Possible values are: `created`, `updated`, `popularity`, `long-running`, Default: `created`" + }, + "$direction": null + } + }, + + "get": { + "url": "/repos/:user/:repo/pulls/:number", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null + } + }, + + "create": { + "url": "/repos/:user/:repo/pulls", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$base": null, + "$head": null + } + }, + + "create-from-issue": { + "url": "/repos/:user/:repo/pulls", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "issue": { + "type": "Number", + "required": true, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "" + }, + "$base": null, + "$head": null + } + }, + + "update": { + "url": "/repos/:user/:repo/pulls/:number", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$state": null, + "title": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "get-commits": { + "url": "/repos/:user/:repo/pulls/:number/commits", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + } + }, + + "get-files": { + "url": "/repos/:user/:repo/pulls/:number/files", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + } + }, + + "get-merged": { + "url": "/repos/:user/:repo/pulls/:number/merge", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + } + }, + + "merge": { + "url": "/repos/:user/:repo/pulls/:number/merge", + "method": "PUT", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "commit_message": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The message that will be used for the merge commit" + } + } + }, + + "get-comments": { + "url": "/repos/:user/:repo/pulls/:number/comments", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$page": null, + "$per_page": null + } + }, + + "get-comment": { + "url": "/repos/:user/:repo/pulls/comments/:number", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$number": null + } + }, + + "create-comment": { + "url": "/repos/:user/:repo/pulls/:number/comments", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$body": null, + "$commit_id": null, + "$path": null, + "$position": null + } + }, + + "create-comment-reply": { + "url": "/repos/:user/:repo/pulls/:number/comments", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$body": null, + "in_reply_to": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "update-comment": { + "url": "/repos/:user/:repo/pulls/comments/:number", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$number": null, + "$body": null + } + }, + + "delete-comment": { + "url": "/repos/:user/:repo/pulls/comments/:number", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$number": null + } + } + }, + + "repos": { + "get-all": { + "url": "/user/repos", + "method": "GET", + "params": { + "type": { + "type": "String", + "required": false, + "validation": "^(all|owner|public|private|member)$", + "invalidmsg": "Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`.", + "description": "Possible values: `all`, `owner`, `public`, `private`, `member`. Default: `all`." + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|pushed|full_name)$", + "invalidmsg": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", + "description": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`." + }, + "$direction": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-user": { + "url": "/users/:user/repos", + "method": "GET", + "params": { + "$user": null, + "type": { + "type": "String", + "required": false, + "validation": "^(all|owner|member)$", + "invalidmsg": "Possible values: `all`, `owner`, `member`. Default: `public`.", + "description": "Possible values: `all`, `owner`, `member`. Default: `public`." + }, + "sort": { + "type": "String", + "required": false, + "validation": "^(created|updated|pushed|full_name)$", + "invalidmsg": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`.", + "description": "Possible values: `created`, `updated`, `pushed`, `full_name`. Default: `full_name`." + }, + "$direction": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-org": { + "url": "/orgs/:org/repos", + "method": "GET", + "params": { + "$org": null, + "type": { + "type": "String", + "required": false, + "validation": "^(all|public|member)$", + "invalidmsg": "Possible values: `all`, `public`, `member`. Default: `all`.", + "description": "Possible values: `all`, `public`, `member`. Default: `all`." + }, + "$page": null, + "$per_page": null + } + }, + + "create": { + "url": "/user/repos", + "method": "POST", + "params": { + "$name": null, + "$description": null, + "$homepage": null, + "$private": null, + "$has_issues": null, + "$has_wiki": null, + "$has_downloads": null, + "$auto_init": null, + "$gitignore_template": null + } + }, + + "create-from-org": { + "url": "/orgs/:org/repos", + "method": "POST", + "params": { + "$org": null, + "$name": null, + "$description": null, + "$homepage": null, + "$private": null, + "$has_issues": null, + "$has_wiki": null, + "$has_downloads": null, + "$auto_init": null, + "$gitignore_template": null, + "team_id": { + "type": "Number", + "required": false, + "validation": "^[0-9]+$", + "invalidmsg": "", + "description": "The id of the team that will be granted access to this repository. This is only valid when creating a repo in an organization." + } + } + }, + + "get": { + "url": "/repos/:user/:repo", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "one": { + "url": "/repositories/:id", + "method": "GET", + "params": { + "$id": null + } + }, + + "update": { + "url": "/repos/:user/:repo", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$name": null, + "$description": null, + "$homepage": null, + "$private": null, + "$has_issues": null, + "$has_wiki": null, + "$has_downloads": null, + "$default_branch": null + } + }, + + "delete": { + "url": "/repos/:user/:repo", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null + } + }, + + "merge": { + "url": "/repos/:user/:repo/merges", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$base": null, + "$head": null, + "commit_message": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Commit message to use for the merge commit. If omitted, a default message will be used." + } + } + }, + + "get-contributors": { + "url": "/repos/:user/:repo/contributors", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "anon": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Set to 1 or true to include anonymous contributors in results." + }, + "$page": null, + "$per_page": null + } + }, + + "get-languages": { + "url": "/repos/:user/:repo/languages", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-teams": { + "url": "/repos/:user/:repo/teams", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-tags": { + "url": "/repos/:user/:repo/tags", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-branches": { + "url": "/repos/:user/:repo/branches", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-branch": { + "url": "/repos/:user/:repo/branches/:branch", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$branch": null, + "$page": null, + "$per_page": null + } + }, + + "get-collaborators": { + "url": "/repos/:user/:repo/collaborators", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-collaborator": { + "url": "/repos/:user/:repo/collaborators/:collabuser", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$collabuser": null + } + }, + + "add-collaborator": { + "url": "/repos/:user/:repo/collaborators/:collabuser", + "method": "PUT", + "params": { + "$user": null, + "$repo": null, + "$collabuser": null + } + }, + + "remove-collaborator": { + "url": "/repos/:user/:repo/collaborators/:collabuser", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$collabuser": null + } + }, + + "get-commits": { + "url": "/repos/:user/:repo/commits", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "sha": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Sha or branch to start listing commits from." + }, + "path": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Only commits containing this file path will be returned." + }, + "author": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "GitHub login or email address by which to filter by commit author." + }, + "$page": null, + "$per_page": null, + "$since": null, + "$until": null + } + }, + + "get-commit": { + "url": "/repos/:user/:repo/commits/:sha", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null + } + }, + + "get-all-commit-comments": { + "url": "/repos/:user/:repo/comments", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-commit-comments": { + "url": "/repos/:user/:repo/commits/:sha/comments", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$sha": null, + "$page": null, + "$per_page": null + } + }, + + "create-commit-comment": { + "url": "/repos/:user/:repo/commits/:sha/comments", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$sha": null, + "$body": null, + "$commit_id": null, + "path": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Relative path of the file to comment on." + }, + "position": { + "type": "Number", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Line index in the diff to comment on." + }, + "line": { + "type": "Number", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Line number in the file to comment on. Defaults to 1." + } + } + }, + + "get-commit-comment": { + "url": "/repos/:user/:repo/comments/:id", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "update-commit-comment": { + "url": "/repos/:user/:repo/comments/:id", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$id": null, + "$body": null + } + }, + + "compare-commits": { + "url": "/repos/:user/:repo/compare/:base...:head", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$base": null, + "$head": null + } + }, + + "delete-commit-comment": { + "url": "/repos/:user/:repo/comments/:id", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "get-readme": { + "url": "/repos/:user/:repo/readme", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The String name of the Commit/Branch/Tag. Defaults to master." + } + } + }, + + "get-content": { + "url": "/repos/:user/:repo/contents/:path", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "path": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The String name of the Commit/Branch/Tag. Defaults to master." + } + } + }, + "create-content": { + "url": "/repos/:user/:repo/contents/:path", + "method": "PUT", + "params": { + "$user": null, + "$repo": null, + "$content":null, + "$message":null, + "path": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The String name of the Commit/Branch/Tag. Defaults to master." + } + } + }, + + "create-file": { + "url": "/repos/:user/:repo/contents/:path", + "method": "PUT", + "params": { + "$user": null, + "$repo": null, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The commit message." + }, + "content": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The new file content, Base64 encoded." + }, + "branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." + }, + "author": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "update-file": { + "url": "/repos/:user/:repo/contents/:path", + "method": "PUT", + "params": { + "$user": null, + "$repo": null, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The commit message." + }, + "content": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The updated file content, Base64 encoded." + }, + "sha": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The blob SHA of the file being replaced." + }, + "branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." + }, + "author": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "delete-file": { + "url": "/repos/:user/:repo/contents/:path", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "path": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The content path." + }, + "message": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The commit message." + }, + "sha": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The blob SHA of the file being removed." + }, + "branch": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The branch name. If not provided, uses the repository’s default branch (usually master)." + }, + "author": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "committer": { + "type": "Json", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "get-archive-link": { + "url": "/repos/:user/:repo/:archive_format/:ref", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "String of the name of the fully qualified reference (ie: heads/master). If it doesn’t have at least one slash, it will be rejected." + }, + "archive_format": { + "type": "String", + "required": true, + "validation": "^(tarball|zipball)$", + "invalidmsg": "Either tarball or zipball", + "description": "Either tarball or zipball" + } + } + }, + + "get-downloads": { + "url": "/repos/:user/:repo/downloads", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-download": { + "url": "/repos/:user/:repo/downloads/:id", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "delete-download": { + "url": "/repos/:user/:repo/downloads/:id", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "get-forks": { + "url": "/repos/:user/:repo/forks", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(newest|oldest|watchers)$", + "invalidmsg": "Possible values: `newest`, `oldest`, `watchers`, default: `newest`.", + "description": "Possible values: `newest`, `oldest`, `watchers`, default: `newest`." + }, + "$page": null, + "$per_page": null + } + }, + + "fork": { + "url": "/repos/:user/:repo/forks", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "organization": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Organization login. The repository will be forked into this organization." + } + } + }, + + "get-keys": { + "url": "/repos/:user/:repo/keys", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-key": { + "url": "/repos/:user/:repo/keys/:id", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "create-key": { + "url": "/repos/:user/:repo/keys", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$title": null, + "$key": null + } + }, + + "update-key": { + "url": "/repos/:user/:repo/keys/:id", + "method": "PUT", + "params": { + "$user": null, + "$repo": null, + "$id": null, + "$title": null, + "$key": null + } + }, + + "delete-key": { + "url": "/repos/:user/:repo/keys/:id", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "get-stargazers": { + "url": "/repos/:user/:repo/stargazers", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-starred": { + "url": "/user/starred", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "get-starred-from-user": { + "url": "/users/:user/starred", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-starring": { + "url": "/user/starred/:user/:repo", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "star": { + "url": "/user/starred/:user/:repo", + "method": "PUT", + "params": { + "$user": null, + "$repo": null + } + }, + + "un-star": { + "url": "/user/starred/:user/:repo", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-watchers": { + "url": "/repos/:user/:repo/watchers", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-watched": { + "url": "/user/watched", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "get-watched-from-user": { + "url": "/users/:user/watched", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-watching": { + "url": "/user/watched/:user/:repo", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "watch": { + "url": "/user/watched/:user/:repo", + "method": "PUT", + "params": { + "$user": null, + "$repo": null + } + }, + + "un-watch": { + "url": "/user/watched/:user/:repo", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-hooks": { + "url": "/repos/:user/:repo/hooks", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-hook": { + "url": "/repos/:user/:repo/hooks/:id", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "create-hook": { + "url": "/repos/:user/:repo/hooks", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$name": null, + "config": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "A Hash containing key/value pairs to provide settings for this hook. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically." + }, + "events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines what events the hook is triggered for. Default: `['push']`." + }, + "active": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines whether the hook is actually triggered on pushes." + } + } + }, + + "update-hook": { + "url": "/repos/:user/:repo/hooks/:id", + "method": "PATCH", + "params": { + "$user": null, + "$repo": null, + "$id": null, + "$name": null, + "config": { + "type": "Json", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "A Hash containing key/value pairs to provide settings for this hook. Modifying this will replace the entire config object. These settings vary between the services and are defined in the github-services repo. Booleans are stored internally as `1` for true, and `0` for false. Any JSON true/false values will be converted automatically." + }, + "events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines what events the hook is triggered for. This replaces the entire array of events. Default: `['push']`." + }, + "add_events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines a list of events to be added to the list of events that the Hook triggers for." + }, + "remove_events": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines a list of events to be removed from the list of events that the Hook triggers for." + }, + "active": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Determines whether the hook is actually triggered on pushes." + } + } + }, + + "test-hook": { + "url": "/repos/:user/:repo/hooks/:id/test", + "method": "POST", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "delete-hook": { + "url": "/repos/:user/:repo/hooks/:id", + "method": "DELETE", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "get-stats-contributors": { + "url": "/repos/:user/:repo/stats/contributors", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-commit-activity": { + "url": "/repos/:user/:repo/stats/commit_activity", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-code-frequency": { + "url": "/repos/:user/:repo/stats/code_frequency", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-participation": { + "url": "/repos/:user/:repo/stats/participation", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-stats-punch-card": { + "url": "/repos/:user/:repo/stats/punch_card", + "method": "GET", + "params": { + "$user": null, + "$repo": null + } + }, + + "get-deployments": { + "url": "/repos/:user/:repo/deployments", + "method": "GET", + "params": { + "sha": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The short or long sha that was recorded at creation time. Default: none." + }, + "ref": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the ref. This can be a branch, tag, or sha. Default: none." + }, + "task": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the task for the deployment. e.g. deploy or deploy:migrations. Default: none." + }, + "environment": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the environment that was deployed to. e.g. staging or production. Default: none." + }, + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "create-deployment": { + "url": "/repos/:user/:repo/deployments", + "method": "POST", + "params": { + "ref": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The ref to deploy. This can be a branch, tag, or sha." + }, + "task": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The named task to execute. e.g. deploy or deploy:migrations. Default: deploy" + }, + "auto_merge": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional parameter to merge the default branch into the requested ref if it is behind the default branch. Default: true" + }, + "required_contexts": { + "type": "Array", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional array of status contexts verified against commit status checks. If this parameter is omitted from the parameters then all unique contexts will be verified before a deployment is created. To bypass checking entirely pass an empty array. Defaults to all unique contexts." + }, + "payload": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional JSON payload with extra information about the deployment. Default: ''" + }, + "environment": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The name of the environment that was deployed to. e.g. staging or production. Default: none." + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Optional short description. Default: ''" + }, + "$user": null, + "$repo": null + } + }, + + "get-deployment-statuses": { + "url": "/repos/:user/:repo/deployments/:id/statuses", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$id": null + } + }, + + "create-deployment-status": { + "url": "/repos/:user/:repo/deployments/:id/statuses", + "method": "POST", + "params": { + "state": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The state of the status. Can be one of pending, success, error, or failure." + }, + "target_url": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment. Default: ''" + }, + "description": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "A short description of the status. Default: ''" + }, + "$user": null, + "$repo": null, + "$id": null + } + } + }, + + "user": { + "get-all": { + "url": "/users", + "method": "GET", + "params": { + "since":{ + "type": "Number", + "required": false, + "validation": "", + "description": "The integer ID of the last User that you’ve seen." + } + } + + }, + + "get-from": { + "url": "/users/:user", + "method": "GET", + "params": { + "$user": null + } + }, + + "get": { + "url": "/user", + "method": "GET", + "params": {} + }, + + "update": { + "url": "/user", + "method": "PATCH", + "params": { + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "email": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "blog": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "company": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "location": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "hireable": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "bio": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + } + } + }, + + "get-orgs": { + "url": "/user/orgs", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "edit-organization-membership": { + "url": "/user/memberships/orgs/:org", + "method": "PATCH", + "params": { + "$org": null, + "state": { + "type": "String", + "required": true, + "validation": "^(open|closed|active)$", + "invalidmsg": "", + "description": "" + } + } + }, + + "get-teams": { + "url": "/user/teams", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "get-emails": { + "url": "/user/emails", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "add-emails": { + "url": "/user/emails", + "method": "POST", + "params": {} + }, + + "delete-emails": { + "url": "/user/emails", + "method": "DELETE", + "params": {} + }, + + "get-followers": { + "url": "/users/:user/followers", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-following-from-user": { + "url": "/users/:user/following", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-following": { + "url": "/user/following", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "get-follow-user": { + "url": "/user/following/:user", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "follow-user": { + "url": "/user/following/:user", + "method": "PUT", + "params": { + "$user": null + } + }, + + "un-follow-user": { + "url": "/user/following/:user", + "method": "DELETE", + "params": { + "$user": null + } + }, + + "get-keys": { + "url": "/user/keys", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "get-keys-from-user": { + "url": "/users/:user/keys", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-key": { + "url": "/user/keys/:id", + "method": "GET", + "params": { + "$id": null + } + }, + + "create-key": { + "url": "/user/keys", + "method": "POST", + "params": { + "$title": null, + "$key": null + } + }, + + "update-key": { + "url": "/user/keys/:id", + "method": "PATCH", + "params": { + "$id": null, + "$title": null, + "$key": null + } + }, + + "delete-key": { + "url": "/user/keys/:id", + "method": "DELETE", + "params": { + "$id": null + } + } + }, + + "events": { + "get": { + "url": "/events", + "method": "GET", + "params": { + "$page": null, + "$per_page": null + } + }, + + "get-from-repo": { + "url": "/repos/:user/:repo/events", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-repo-issues": { + "url": "/repos/:user/:repo/issues/events", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-repo-network": { + "url": "/networks/:user/:repo/events", + "method": "GET", + "params": { + "$user": null, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-org": { + "url": "/orgs/:org/events", + "method": "GET", + "params": { + "$org": null, + "$page": null, + "$per_page": null + } + }, + + "get-received": { + "url": "/users/:user/received_events", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-received-public": { + "url": "/users/:user/received_events/public", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-user": { + "url": "/users/:user/events", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-user-public": { + "url": "/users/:user/events/public", + "method": "GET", + "params": { + "$user": null, + "$page": null, + "$per_page": null + } + }, + + "get-from-user-org": { + "url": "/users/:user/events/orgs/:org", + "method": "GET", + "params": { + "$user": null, + "$org": null, + "$page": null, + "$per_page": null + } + } + }, + + "releases": { + "list-releases": { + "url": "/repos/:owner/:repo/releases", + "method": "GET", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null, + "$page": null, + "$per_page": null + } + }, + "get-release": { + "url": "/repos/:owner/:repo/releases/:id", + "method": "GET", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null + } + }, + "create-release": { + "url": "/repos/:owner/:repo/releases", + "method": "POST", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null, + "tag_name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag" + }, + "target_commitish": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)." + }, + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "draft": { + "type": "Boolean", + "validation": "", + "invalidmsg": "", + "description": "true to create a draft (unpublished) release, false to create a published one. Default: false" + }, + "prerelease": { + "type": "Boolean", + "validation": "", + "invalidmsg": "", + "description": "true to identify the release as a prerelease. false to identify the release as a full release. Default: false" + } + } + }, + "edit-release": { + "url": "/repos/:owner/:repo/releases/:id", + "method": "PATCH", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null, + "tag_name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "String of the tag" + }, + "target_commitish": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master)." + }, + "name": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "body": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "draft": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "true to create a draft (unpublished) release, false to create a published one. Default: false" + }, + "prerelease": { + "type": "Boolean", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "true to identify the release as a prerelease. false to identify the release as a full release. Default: false" + } + } + }, + "delete-release": { + "url": "/repos/:owner/:repo/releases/:id", + "method": "DELETE", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null + } + }, + "list-assets": { + "url": "/repos/:owner/:repo/releases/:id/assets", + "method": "GET", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null + } + }, + "get-asset": { + "url": "/repos/:owner/:repo/releases/assets/:id", + "method": "GET", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null + } + }, + "upload-asset": { + "url": "/repos/:owner/:repo/releases/:id/assets", + "method": "POST", + "host": "uploads.github.com", + "hasFileBody": true, + "timeout": 0, + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null, + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "the file name of the asset" + } + } + }, + "edit-asset": { + "url": "/repos/:owner/:repo/releases/assets/:id", + "method": "PATCH", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null, + "$name": null, + "label": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "An alternate short description of the asset. Used in place of the filename." + } + } + }, + "delete-asset": { + "url": "/repos/:owner/:repo/releases/assets/:id", + "method": "DELETE", + "params": { + "owner": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "id": { + "type": "Number", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "" + }, + "$repo": null + } + } + }, + + "search": { + "code": { + "url": "/search/code", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^indexed$", + "invalidmsg": "indexed only", + "description": "indexed only" + }, + "$order": null, + "$page": null, + "$per_page": null + } + }, + + "issues": { + "url": "/search/issues", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(comments|created|updated)$", + "invalidmsg": "comments, created, or updated", + "description": "comments, created, or updated" + }, + "$order": null, + "$page": null, + "$per_page": null + } + }, + + "repos": { + "url": "/search/repositories", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(stars|forks|updated)$", + "invalidmsg": "One of stars, forks, or updated. Default: results are sorted by best match.", + "description": "stars, forks, or updated" + }, + "$order": null, + "$page": null, + "$per_page": null + } + }, + + "users": { + "url": "/search/users", + "method": "GET", + "params": { + "$q": null, + "sort": { + "type": "String", + "required": false, + "validation": "^(followers|repositories|joined)$", + "invalidmsg": "Can be followers, repositories, or joined. Default: results are sorted by best match.", + "description": "followers, repositories, or joined" + }, + "$order": null, + "$page": null, + "$per_page": null + } + }, + + "email": { + "url": "/legacy/user/email/:email", + "method": "GET", + "params": { + "email": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "Email address" + } + } + } + }, + + "markdown": { + "render": { + "url": "/markdown", + "method": "POST", + "params": { + "text": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The Markdown text to render" + }, + "mode": { + "type": "String", + "required": false, + "validation": "^(markdown|gfm)$", + "invalidmsg": "", + "description": "The rendering mode, `markdown` to render a document as plain Markdown, just like README files are rendered. `gfm` to render a document as user-content, e.g. like user comments or issues are rendered. In GFM mode, hard line breaks are always taken into account, and issue and user mentions are linked accordingly." + }, + "context": { + "type": "String", + "required": false, + "validation": "", + "invalidmsg": "", + "description": "The repository context, only taken into account when rendering as `gfm`" + } + } + }, + + "render-raw": { + "url": "/markdown/raw", + "method": "POST", + "requestFormat": "raw", + "params": { + "$data": null + } + } + }, + + "gitignore": { + "templates": { + "url": "/gitignore/templates", + "method": "GET", + "params": { } + }, + "template": { + "url": "/gitignore/templates/:name", + "method": "GET", + "params": { + "name": { + "type": "String", + "required": true, + "validation": "", + "invalidmsg": "", + "description": "The name of the .gitignore template to get" + } + } + } + }, + + "misc": { + "emojis": { + "url": "/emojis", + "method": "GET", + "params": { } + }, + "meta": { + "url": "/meta", + "method": "GET", + "params": { } + }, + "rate-limit": { + "url": "/rate_limit", + "method": "GET", + "params": { } + } + } +} diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/search.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/search.js new file mode 100644 index 00000000..260cf528 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/search.js @@ -0,0 +1,263 @@ +/** + * mixin search + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var search = module.exports = { + search: {} +}; + +(function() { + /** section: github + * search#code(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - q (String): Required. Search Term + * - sort (String): Optional. indexed only Validation rule: ` ^indexed$ `. + * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.code = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * search#issues(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - q (String): Required. Search Term + * - sort (String): Optional. comments, created, or updated Validation rule: ` ^(comments|created|updated)$ `. + * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.issues = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * search#repos(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - q (String): Required. Search Term + * - sort (String): Optional. stars, forks, or updated Validation rule: ` ^(stars|forks|updated)$ `. + * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.repos = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * search#users(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - q (String): Required. Search Term + * - sort (String): Optional. followers, repositories, or joined Validation rule: ` ^(followers|repositories|joined)$ `. + * - order (String): Optional. asc or desc Validation rule: ` ^(asc|desc)$ `. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.users = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * search#email(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - email (String): Required. Email address + **/ + this.email = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(search.search); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/searchTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/searchTest.js new file mode 100644 index 00000000..f95bc2d1 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/searchTest.js @@ -0,0 +1,119 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[search]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + /*client.authenticate({ + type: "oauth", + token: token + });*/ + }); + + it("should successfully execute GET /search/code/:q (code)", function(next) { + client.search.code( + { + q: ['test', 'repo:mikedeboertest/1423836276146'].join('+') + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.items.length, 1); + var file = res.items[0]; + Assert.equal(file.name, "TEST.md"); + + next(); + } + ); + }); + + it("should successfully execute GET /search/issues/:q (issues)", function(next) { + client.search.issues( + { + q: ['debate', 'repo:mikedeboertest/node_chat', 'state:open'].join('+') + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.items.length, 1); + var issue = res.items[0]; + Assert.equal(issue.title, "My First Issue"); + Assert.equal(issue.state, "open"); + + next(); + } + ); + }); + + it("should successfully execute GET /search/repositories/:q (repos)", function(next) { + client.search.repos( + { + q: ['pasta', 'language:JavaScript'].join('+') + }, + function(err, res) { + Assert.equal(err, null); + Assert.ok(res.items.length > 0); + Assert.equal(res.items[0].language, "JavaScript"); + + next(); + } + ); + }); + + it("should successfully execute GET /search/users/:q (users)", function(next) { + client.search.users( + { + q: "mikedeboer" + }, + function(err, res) { + Assert.equal(err, null); + Assert.equal(res.items.length, 2); + var user = res.items[0]; + Assert.equal(user.login, "mikedeboer"); + + client.search.users( + { + q: "location:Jyväskylä" + }, + function(err, res) { + Assert.equal(err, null); + //XXX: this is likely to change often. I added this for + // issue #159. + Assert.equal(res.items.length, 30); + var user = res.items[0]; + Assert.equal(user.login, "bebraw"); + + next(); + } + ); + } + ); + }); + + /*it("should successfully execute GET /search/user/email/:email (email)", function(next) { + client.search.email( + { + email: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + });*/ +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/statuses.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/statuses.js new file mode 100644 index 00000000..1a376afd --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/statuses.js @@ -0,0 +1,167 @@ +/** + * mixin statuses + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var statuses = module.exports = { + statuses: {} +}; + +(function() { + /** section: github + * statuses#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * statuses#getCombined(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + **/ + this.getCombined = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * statuses#create(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - repo (String): Required. + * - sha (String): Required. + * - state (String): Required. State of the status - can be one of pending, success, error, or failure. Validation rule: ` ^(pending|success|error|failure)$ `. + * - target_url (String): Optional. Target url to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the ‘source’ of the Status. + * - description (String): Optional. Short description of the status. + * - context (String): Optional. A string label to differentiate this status from the status of other systems. + **/ + this.create = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(statuses.statuses); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/statusesTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/statusesTest.js new file mode 100644 index 00000000..5c23b4c7 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/statusesTest.js @@ -0,0 +1,76 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[statuses]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /repos/:user/:repo/commits/:sha/statuses (get)", function(next) { + client.statuses.get( + { + user: "mikedeboer", + repo: "node-github", + sha: "30d607d8fd8002427b61273f25d442c233cbf631" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /repos/:user/:repo/commits/:sha/status (get)", function(next) { + client.statuses.getCombined( + { + user: "mikedeboer", + repo: "node-github", + sha: "30d607d8fd8002427b61273f25d442c233cbf631" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /repos/:user/:repo/statuses/:sha (create)", function(next) { + client.statuses.create( + { + user: "String", + repo: "String", + sha: "String", + state: "String", + target_url: "String", + description: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/user.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/user.js new file mode 100644 index 00000000..1614cbc4 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/user.js @@ -0,0 +1,1035 @@ +/** + * mixin user + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var user = module.exports = { + user: {} +}; + +(function() { + /** section: github + * user#getAll(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - since (Number): Optional. The integer ID of the last User that you’ve seen. + **/ + this.getAll = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getFrom(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + **/ + this.getFrom = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#get(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ + this.get = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#update(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - name (String): Optional. + * - email (String): Optional. + * - blog (String): Optional. + * - company (String): Optional. + * - location (String): Optional. + * - hireable (Boolean): Optional. + * - bio (String): Optional. + **/ + this.update = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getOrgs(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getOrgs = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#editOrganizationMembership(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - org (String): Required. + * - state (String): Required. Validation rule: ` ^(open|closed|active)$ `. + **/ + this.editOrganizationMembership = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getTeams(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getTeams = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getEmails(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getEmails = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#addEmails(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ + this.addEmails = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#deleteEmails(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * No other params, simply pass an empty Object literal `{}` + **/ + this.deleteEmails = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getFollowers(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFollowers = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getFollowingFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFollowingFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getFollowing(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFollowing = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getFollowUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getFollowUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#followUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + **/ + this.followUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#unFollowUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + **/ + this.unFollowUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getKeys(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getKeys = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getKeysFromUser(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - user (String): Required. + * - page (Number): Optional. Page number of the results to fetch. Validation rule: ` ^[0-9]+$ `. + * - per_page (Number): Optional. A custom page size up to 100. Default is 30. Validation rule: ` ^[0-9]+$ `. + **/ + this.getKeysFromUser = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#getKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.getKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#createKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - title (String): Required. + * - key (String): Required. + **/ + this.createKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#updateKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + * - title (String): Required. + * - key (String): Required. + **/ + this.updateKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + + /** section: github + * user#deleteKey(msg, callback) -> null + * - msg (Object): Object that contains the parameters and their values to be sent to the server. + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * ##### Params on the `msg` object: + * + * - headers (Object): Optional. Key/ value pair of request headers to pass along with the HTTP request. Valid headers are: 'If-Modified-Since', 'If-None-Match', 'Cookie', 'User-Agent', 'Accept', 'X-GitHub-OTP'. + * - id (String): Required. + **/ + this.deleteKey = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "x-ratelimit-reset", "x-oauth-scopes", "link", "location", "last-modified", "etag", "status"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + }; + +}).call(user.user); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/userTest.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/userTest.js new file mode 100644 index 00000000..c7b7a106 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/api/v3.0.0/userTest.js @@ -0,0 +1,304 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[user]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + + it("should successfully execute GET /users/:user (getFrom)", function(next) { + client.user.getFrom( + { + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user (get)", function(next) { + client.user.get( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /user (update)", function(next) { + client.user.update( + { + name: "String", + email: "String", + blog: "String", + company: "String", + location: "String", + hireable: "Boolean", + bio: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/orgs (getOrgs)", function(next) { + client.user.getOrgs( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/teams (getTeams)", function(next) { + client.user.getTeams( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/emails (getEmails)", function(next) { + client.user.getEmails( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /user/emails (addEmails)", function(next) { + client.user.addEmails( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/emails (deleteEmails)", function(next) { + client.user.deleteEmails( + {}, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/followers (getFollowers)", function(next) { + client.user.getFollowers( + { + user: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/following (getFollowingFromUser)", function(next) { + client.user.getFollowingFromUser( + { + user: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/following (getFollowing)", function(next) { + client.user.getFollowing( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/following/:user (getFollowUser)", function(next) { + client.user.getFollowUser( + { + user: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PUT /user/following/:user (followUser)", function(next) { + client.user.followUser( + { + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/following/:user (unFollowUser)", function(next) { + client.user.unFollowUser( + { + user: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/keys (getKeys)", function(next) { + client.user.getKeys( + { + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /users/:user/keys (getKeysFromUser)", function(next) { + client.user.getKeysFromUser( + { + user: "String", + page: "Number", + per_page: "Number" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute GET /user/keys/:id (getKey)", function(next) { + client.user.getKey( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute POST /user/keys (createKey)", function(next) { + client.user.createKey( + { + title: "String", + key: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute PATCH /user/keys/:id (updateKey)", function(next) { + client.user.updateKey( + { + id: "String", + title: "String", + key: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); + + it("should successfully execute DELETE /user/keys/:id (deleteKey)", function(next) { + client.user.deleteKey( + { + id: "String" + }, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/error.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/error.js new file mode 100644 index 00000000..2da83f29 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/error.js @@ -0,0 +1,117 @@ +/** section: github + * class HttpError + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +var Util = require("util"); + +exports.HttpError = function(message, code) { + Error.call(this, message); + //Error.captureStackTrace(this, arguments.callee); + this.message = message; + this.code = code; +}; +Util.inherits(exports.HttpError, Error); + +(function() { + /** + * HttpError#toString() -> String + * + * Returns the stringified version of the error (i.e. the message). + **/ + this.toString = function() { + return this.message; + }; + + /** + * HttpError#toJSON() -> Object + * + * Returns a JSON object representation of the error. + **/ + this.toJSON = function() { + return { + code: this.code, + status: this.defaultMessage, + message: this.message + }; + }; + +}).call(exports.HttpError.prototype); + + +var statusCodes = { + 400: "Bad Request", + 401: "Unauthorized", + 402: "Payment Required", + 403: "Forbidden", + 404: "Not Found", + 405: "Method Not Allowed", + 406: "Not Acceptable", + 407: "Proxy Authentication Required", + 408: "Request Timeout", + 409: "Conflict", + 410: "Gone", + 411: "Length Required", + 412: "Precondition Failed", + 413: "Request Entity Too Large", + 414: "Request-URI Too Long", + 415: "Unsupported Media Type", + 416: "Requested Range Not Satisfiable", + 417: "Expectation Failed", + 420: "Enhance Your Calm", + 422: "Unprocessable Entity", + 423: "Locked", + 424: "Failed Dependency", + 425: "Unordered Collection", + 426: "Upgrade Required", + 428: "Precondition Required", + 429: "Too Many Requests", + 431: "Request Header Fields Too Large", + 444: "No Response", + 449: "Retry With", + 499: "Client Closed Request", + 500: "Internal Server Error", + 501: "Not Implemented", + 502: "Bad Gateway", + 503: "Service Unavailable", + 504: "Gateway Timeout", + 505: "HTTP Version Not Supported", + 506: "Variant Also Negotiates", + 507: "Insufficient Storage", + 508: "Loop Detected", + 509: "Bandwidth Limit Exceeded", + 510: "Not Extended", + 511: "Network Authentication Required" +}; + +for (var status in statusCodes) { + var defaultMsg = statusCodes[status]; + + var error = (function(defaultMsg, status) { + return function(msg) { + this.defaultMessage = defaultMsg; + exports.HttpError.call(this, msg || status + ": " + defaultMsg, status); + + if (status >= 500) + Error.captureStackTrace(this, arguments.callee); + }; + })(defaultMsg, status); + + Util.inherits(error, exports.HttpError); + + var className = toCamelCase(defaultMsg); + exports[className] = error; + exports[status] = error; +} + +function toCamelCase(str) { + return str.toLowerCase().replace(/(?:(^.)|(\s+.))/g, function(match) { + return match.charAt(match.length-1).toUpperCase(); + }); +} \ No newline at end of file diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/generate.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/generate.js new file mode 100755 index 00000000..eb1e9bad --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/generate.js @@ -0,0 +1,295 @@ +#!/usr/bin/env node +/** section: github, internal + * class ApiGenerator + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var Fs = require("fs"); +var Path = require("path"); + +var Optimist = require("optimist"); +var Util = require("./util"); + +var IndexTpl = Fs.readFileSync(__dirname + "/templates/index.js.tpl", "utf8"); +var SectionTpl = Fs.readFileSync(__dirname + "/templates/section.js.tpl", "utf8"); +var HandlerTpl = Fs.readFileSync(__dirname + "/templates/handler.js.tpl", "utf8"); +var AfterRequestTpl = Fs.readFileSync(__dirname + "/templates/after_request.js.tpl", "utf8"); +var TestSectionTpl = Fs.readFileSync(__dirname + "/templates/test_section.js.tpl", "utf8"); +var TestHandlerTpl = Fs.readFileSync(__dirname + "/templates/test_handler.js.tpl", "utf8"); + +var main = module.exports = function(versions, tests, restore) { + Util.log("Generating for versions", Object.keys(versions)); + + Object.keys(versions).forEach(function(version) { + var dir = Path.join(__dirname, "api", version); + + // If we're in restore mode, move .bak file back to their original position + // and short-circuit. + if (restore) { + var bakRE = /\.bak$/; + var files = Fs.readdirSync(dir).filter(function(file) { + return bakRE.test(file); + }).forEach(function(file) { + var from = Path.join(dir, file); + var to = Path.join(dir, file.replace(/\.bak$/, "")); + Fs.renameSync(from, to); + Util.log("Restored '" + file + "' (" + version + ")"); + }); + + return; + } + + + var routes = versions[version]; + var defines = routes.defines; + delete routes.defines; + var headers = defines["response-headers"]; + // cast header names to lowercase. + if (headers && headers.length) + headers = headers.map(function(header) { return header.toLowerCase(); }); + var sections = {}; + var testSections = {}; + + function createComment(paramsStruct, section, funcName, indent) { + var params = Object.keys(paramsStruct); + var comment = [ + indent + "/** section: github", + indent + " * " + section + "#" + funcName + "(msg, callback) -> null", + indent + " * - msg (Object): Object that contains the parameters and their values to be sent to the server.", + indent + " * - callback (Function): function to call when the request is finished " + + "with an error as first argument and result data as second argument.", + indent + " *", + indent + " * ##### Params on the `msg` object:", + indent + " *" + ]; + comment.push(indent + " * - headers (Object): Optional. Key/ value pair " + + "of request headers to pass along with the HTTP request. Valid headers are: " + + "'" + defines["request-headers"].join("', '") + "'."); + if (!params.length) + comment.push(indent + " * No other params, simply pass an empty Object literal `{}`"); + var paramName, def, line; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + Util.log("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + process.exit(1); + } + else + def = defines.params[paramName]; + } + else + def = paramsStruct[paramName]; + + line = indent + " * - " + paramName + " (" + (def.type || "mixed") + "): " + + (def.required ? "Required. " : "Optional. "); + if (def.description) + line += def.description; + if (def.validation) + line += " Validation rule: ` " + def.validation + " `."; + + comment.push(line); + } + + return comment.join("\n") + "\n" + indent + " **/"; + } + + function getParams(paramsStruct, indent) { + var params = Object.keys(paramsStruct); + if (!params.length) + return "{}"; + var values = []; + var paramName, def; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + Util.log("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + process.exit(1); + } + else + def = defines.params[paramName]; + } + else + def = paramsStruct[paramName]; + + values.push(indent + " " + paramName + ": \"" + def.type + "\""); + } + return "{\n" + values.join(",\n") + "\n" + indent + "}"; + } + + function prepareApi(struct, baseType) { + if (!baseType) + baseType = ""; + + Object.keys(struct).forEach(function(routePart) { + var block = struct[routePart]; + if (!block) + return; + var messageType = baseType + "/" + routePart; + if (block.url && block.params) { + // we ended up at an API definition part! + var parts = messageType.split("/"); + var section = Util.toCamelCase(parts[1].toLowerCase()); + if (!block.method) { + throw new Error("No HTTP method specified for " + messageType + + "in section " + section); + } + + parts.splice(0, 2); + var funcName = Util.toCamelCase(parts.join("-")); + var comment = createComment(block.params, section, funcName, " "); + + // add the handler to the sections + if (!sections[section]) + sections[section] = []; + + var afterRequest = ""; + if (headers && headers.length) { + afterRequest = AfterRequestTpl.replace("<%headers%>", "\"" + + headers.join("\", \"") + "\""); + } + sections[section].push(HandlerTpl + .replace("<%funcName%>", funcName) + .replace("<%comment%>", comment) + .replace("<%afterRequest%>", afterRequest) + ); + + // add test to the testSections + if (!testSections[section]) + testSections[section] = []; + testSections[section].push(TestHandlerTpl + .replace("<%name%>", block.method + " " + block.url + " (" + funcName + ")") + .replace("<%funcName%>", section + "." + funcName) + .replace("<%params%>", getParams(block.params, " ")) + ); + } + else { + // recurse into this block next: + prepareApi(block, messageType); + } + }); + } + + Util.log("Converting routes to functions"); + prepareApi(routes); + + Util.log("Writing files to version dir"); + var sectionNames = Object.keys(sections); + + Util.log("Writing index.js file for version " + version); + Fs.writeFileSync(Path.join(dir, "index.js"), + IndexTpl + .replace("<%name%>", defines.constants.name) + .replace("<%description%>", defines.constants.description) + .replace("<%scripts%>", "\"" + sectionNames.join("\", \"") + "\""), + "utf8"); + + Object.keys(sections).forEach(function(section) { + var def = sections[section]; + Util.log("Writing '" + section + ".js' file for version " + version); + Fs.writeFileSync(Path.join(dir, section + ".js"), SectionTpl + .replace(/<%sectionName%>/g, section) + .replace("<%sectionBody%>", def.join("\n")), + "utf8" + ); + + // When we don't need to generate tests, bail out here. + if (!tests) + return; + + def = testSections[section]; + // test if previous tests already contained implementations by checking + // if the difference in character count between the current test file + // and the newly generated one is more than twenty characters. + var body = TestSectionTpl + .replace("<%version%>", version.replace("v", "")) + .replace(/<%sectionName%>/g, section) + .replace("<%testBody%>", def.join("\n\n")); + var path = Path.join(dir, section + "Test.js"); + if (Fs.existsSync(path) && Math.abs(Fs.readFileSync(path, "utf8").length - body.length) >= 20) { + Util.log("Moving old test file to '" + path + ".bak' to preserve tests " + + "that were already implemented. \nPlease be sure te check this file " + + "and move all implemented tests back into the newly generated test!", "error"); + Fs.renameSync(path, path + ".bak"); + } + + Util.log("Writing test file for " + section + ", version " + version); + Fs.writeFileSync(path, body, "utf8"); + }); + }); +}; + +if (!module.parent) { + var argv = Optimist + .wrap(80) + .usage("Generate the implementation of the node-github module, including " + + "unit-test scaffolds.\nUsage: $0 [-r] [-v VERSION]") + .alias("r", "restore") + .describe("r", "Restore .bak files, generated by a previous run, to the original") + .alias("v", "version") + .describe("v", "Semantic version number of the API to generate. Example: '3.0.0'") + .alias("t", "tests") + .describe("t", "Also generate unit test scaffolds") + .alias("h", "help") + .describe("h", "Display this usage information") + .boolean(["r", "t", "h"]) + .argv; + + if (argv.help) { + Util.log(Optimist.help()); + process.exit(); + } + + var baseDir = Path.join(__dirname, "api"); + var availVersions = {}; + Fs.readdirSync(baseDir).forEach(function(version) { + var path = Path.join(baseDir, version, "routes.json"); + if (!Fs.existsSync(path)) + return; + var routes; + try { + routes = JSON.parse(Fs.readFileSync(path, "utf8")); + } + catch (ex) { + return; + } + if (!routes.defines) + return; + availVersions[version] = routes; + }); + + if (!Object.keys(availVersions).length) { + Util.log("No versions available to generate.", "fatal"); + process.exit(1); + } + var versions = {}; + if (argv.version) { + if (argv.version.charAt(0) != "v") + argv.version = argv.v = "v" + argv.version; + if (!availVersions[argv.version]) { + Util.log("Version '" + argv.version + "' is not available", "fatal"); + process.exit(1); + } + versions[argv.version] = availVersions[argv.version]; + } + if (!Object.keys(versions).length) { + Util.log("No versions specified via the command line, generating for all available versions."); + versions = availVersions; + } + + Util.log("Starting up..."); + main(versions, argv.tests, argv.restore); +} diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/index.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/index.js new file mode 100644 index 00000000..0c062efc --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/index.js @@ -0,0 +1,847 @@ +"use strict"; + +var error = require("./error"); +var fs = require("fs"); +var mime = require("mime"); +var Util = require("./util"); +var Url = require("url"); + +/** section: github + * class Client + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + * + * [[Client]] can load any version of the [[github]] client API, with the + * requirement that a valid routes.json definition file is present in the + * `api/[VERSION]` directory and that the routes found in this file are + * implemented as well. + * + * Upon instantiation of the [[Client]] class, the routes.json file is loaded + * from the API version specified in the configuration and, parsed and from it + * the routes for HTTP requests are extracted. For each HTTP endpoint to the + * HTTP server, a method is generated which accepts a Javascript Object + * with parameters and an optional callback to be invoked when the API request + * returns from the server or when the parameters could not be validated. + * + * When an HTTP endpoint is processed and a method is generated as described + * above, [[Client]] also sets up parameter validation with the rules as + * defined in the routes.json. A full example that illustrates how this works + * is shown below: + * + * ##### Example + * + * First, we look at a listing of a sample routes.json routes definition file: + * + * { + * "defines": { + * "constants": { + * "name": "Github", + * "description": "A Node.JS module, which provides an object oriented wrapper for the GitHub v3 API.", + * "protocol": "https", + * "host": "api.github.com", + * "port": 443, + * "dateFormat": "YYYY-MM-DDTHH:MM:SSZ", + * "requestFormat": "json" + * }, + * "response-headers": [ + * "X-RateLimit-Limit", + * "X-RateLimit-Remaining", + * "Link" + * ], + * "params": { + * "files": { + * "type": "Json", + * "required": true, + * "validation": "", + * "invalidmsg": "", + * "description": "Files that make up this gist. The key of which should be a required string filename and the value another required hash with parameters: 'content'" + * }, + * "user": { + * "type": "String", + * "required": true, + * "validation": "", + * "invalidmsg": "", + * "description": "" + * }, + * "description": { + * "type": "String", + * "required": false, + * "validation": "", + * "invalidmsg": "", + * "description": "" + * }, + * "page": { + * "type": "Number", + * "required": false, + * "validation": "^[0-9]+$", + * "invalidmsg": "", + * "description": "Page number of the results to fetch." + * }, + * "per_page": { + * "type": "Number", + * "required": false, + * "validation": "^[0-9]+$", + * "invalidmsg": "", + * "description": "A custom page size up to 100. Default is 30." + * } + * } + * }, + * + * "gists": { + * "get-from-user": { + * "url": ":user/gists", + * "method": "GET", + * "params": { + * "$user": null, + * "$page": null, + * "$per_page": null + * } + * }, + * + * "create": { + * "url": "/gists", + * "method": "POST", + * "params": { + * "$description": null, + * "public": { + * "type": "Boolean", + * "required": true, + * "validation": "", + * "invalidmsg": "", + * "description": "" + * }, + * "$files": null + * } + * } + * } + * } + * + * You probably noticed that the definition is quite verbose and the decision + * for its design was made to be verbose whilst still allowing for basic variable + * definitions and substitions for request parameters. + * + * There are two sections; 'defines' and 'gists' in this example. + * + * The `defines` section contains a list of `constants` that will be used by the + * [[Client]] to make requests to the right URL that hosts the API. + * The `gists` section defines the endpoints for calls to the API server, for + * gists specifically in this example, but the other API sections are defined in + * the exact same way. + * These definitions are parsed and methods are created that the client can call + * to make an HTTP request to the server. + * there is one endpoint defined: . + * In this example, the endpoint `gists/get-from-user` will be exposed as a member + * on the [[Client]] object and may be invoked with + * + * client.getFromUser({ + * "user": "bob" + * }, function(err, ret) { + * // do something with the result here. + * }); + * + * // or to fetch a specfic page: + * client.getFromUser({ + * "user": "bob", + * "page": 2, + * "per_page": 100 + * }, function(err, ret) { + * // do something with the result here. + * }); + * + * All the parameters as specified in the Object that is passed to the function + * as first argument, will be validated according to the rules in the `params` + * block of the route definition. + * Thus, in the case of the `user` parameter, according to the definition in + * the `params` block, it's a variable that first needs to be looked up in the + * `params` block of the `defines` section (at the top of the JSON file). Params + * that start with a `$` sign will be substituted with the param with the same + * name from the `defines/params` section. + * There we see that it is a required parameter (needs to hold a value). In other + * words, if the validation requirements are not met, an HTTP error is passed as + * first argument of the callback. + * + * Implementation Notes: the `method` is NOT case sensitive, whereas `url` is. + * The `url` parameter also supports denoting parameters inside it as follows: + * + * "get-from-user": { + * "url": ":user/gists", + * "method": "GET" + * ... + * } + **/ +var Client = module.exports = function(config) { + config.headers = config.headers || {}; + this.config = config; + this.debug = Util.isTrue(config.debug); + + this.version = config.version; + var cls = require("./api/v" + this.version); + this[this.version] = new cls(this); + + var pathPrefix = ""; + // Check if a prefix is passed in the config and strip any leading or trailing slashes from it. + if (typeof config.pathPrefix == "string") { + pathPrefix = "/" + config.pathPrefix.replace(/(^[\/]+|[\/]+$)/g, ""); + this.config.pathPrefix = pathPrefix; + } + + this.setupRoutes(); +}; + +(function() { + /** + * Client#setupRoutes() -> null + * + * Configures the routes as defined in a routes.json file of an API version + * + * [[Client#setupRoutes]] is invoked by the constructor, takes the + * contents of the JSON document that contains the definitions of all the + * available API routes and iterates over them. + * + * It first recurses through each definition block until it reaches an API + * endpoint. It knows that an endpoint is found when the `url` and `param` + * definitions are found as a direct member of a definition block. + * Then the availability of an implementation by the API is checked; if it's + * not present, this means that a portion of the API as defined in the routes.json + * file is not implemented properly, thus an exception is thrown. + * After this check, a method is attached to the [[Client]] instance + * and becomes available for use. Inside this method, the parameter validation + * and typecasting is done, according to the definition of the parameters in + * the `params` block, upon invocation. + * + * This mechanism ensures that the handlers ALWAYS receive normalized data + * that is of the correct format and type. JSON parameters are parsed, Strings + * are trimmed, Numbers and Floats are casted and checked for NaN after that. + * + * Note: Query escaping for usage with SQL products is something that can be + * implemented additionally by adding an additional parameter type. + **/ + this.setupRoutes = function() { + var self = this; + var api = this[this.version]; + var routes = api.routes; + var defines = routes.defines; + this.constants = defines.constants; + this.requestHeaders = defines["request-headers"].map(function(header) { + return header.toLowerCase(); + }); + delete routes.defines; + + function trim(s) { + if (typeof s != "string") + return s; + return s.replace(/^[\s\t\r\n]+/, "").replace(/[\s\t\r\n]+$/, ""); + } + + function parseParams(msg, paramsStruct) { + var params = Object.keys(paramsStruct); + var paramName, def, value, type; + for (var i = 0, l = params.length; i < l; ++i) { + paramName = params[i]; + if (paramName.charAt(0) == "$") { + paramName = paramName.substr(1); + if (!defines.params[paramName]) { + throw new error.BadRequest("Invalid variable parameter name substitution; param '" + + paramName + "' not found in defines block", "fatal"); + } + else { + def = paramsStruct[paramName] = defines.params[paramName]; + delete paramsStruct["$" + paramName]; + } + } + else + def = paramsStruct[paramName]; + + value = trim(msg[paramName]); + if (typeof value != "boolean" && !value) { + // we don't need to validation for undefined parameter values + // that are not required. + if (!def.required || (def["allow-empty"] && value === "")) + continue; + throw new error.BadRequest("Empty value for parameter '" + + paramName + "': " + value); + } + + // validate the value and type of parameter: + if (def.validation) { + if (!new RegExp(def.validation).test(value)) { + throw new error.BadRequest("Invalid value for parameter '" + + paramName + "': " + value); + } + } + + if (def.type) { + type = def.type.toLowerCase(); + if (type == "number") { + value = parseInt(value, 10); + if (isNaN(value)) { + throw new error.BadRequest("Invalid value for parameter '" + + paramName + "': " + msg[paramName] + " is NaN"); + } + } + else if (type == "float") { + value = parseFloat(value); + if (isNaN(value)) { + throw new error.BadRequest("Invalid value for parameter '" + + paramName + "': " + msg[paramName] + " is NaN"); + } + } + else if (type == "json") { + if (typeof value == "string") { + try { + value = JSON.parse(value); + } + catch(ex) { + throw new error.BadRequest("JSON parse error of value for parameter '" + + paramName + "': " + value); + } + } + } + else if (type == "date") { + value = new Date(value); + } + } + msg[paramName] = value; + } + } + + function prepareApi(struct, baseType) { + if (!baseType) + baseType = ""; + Object.keys(struct).forEach(function(routePart) { + var block = struct[routePart]; + if (!block) + return; + var messageType = baseType + "/" + routePart; + if (block.url && block.params) { + // we ended up at an API definition part! + var endPoint = messageType.replace(/^[\/]+/g, ""); + var parts = messageType.split("/"); + var section = Util.toCamelCase(parts[1].toLowerCase()); + parts.splice(0, 2); + var funcName = Util.toCamelCase(parts.join("-")); + + if (!api[section]) { + throw new Error("Unsupported route section, not implemented in version " + + self.version + " for route '" + endPoint + "' and block: " + + JSON.stringify(block)); + } + + if (!api[section][funcName]) { + if (self.debug) + Util.log("Tried to call " + funcName); + throw new Error("Unsupported route, not implemented in version " + + self.version + " for route '" + endPoint + "' and block: " + + JSON.stringify(block)); + } + + if (!self[section]) { + self[section] = {}; + // add a utility function 'getFooApi()', which returns the + // section to which functions are attached. + self[Util.toCamelCase("get-" + section + "-api")] = function() { + return self[section]; + }; + } + + self[section][funcName] = function(msg, callback) { + try { + parseParams(msg, block.params); + } + catch (ex) { + // when the message was sent to the client, we can + // reply with the error directly. + api.sendError(ex, block, msg, callback); + if (self.debug) + Util.log(ex.message, "fatal"); + // on error, there's no need to continue. + return; + } + + api[section][funcName].call(api, msg, block, callback); + }; + } + else { + // recurse into this block next: + prepareApi(block, messageType); + } + }); + } + + prepareApi(routes); + }; + + /** + * Client#authenticate(options) -> null + * - options (Object): Object containing the authentication type and credentials + * - type (String): One of the following: `basic` or `oauth` + * - username (String): Github username + * - password (String): Password to your account + * - token (String): OAuth2 token + * + * Set an authentication method to have access to protected resources. + * + * ##### Example + * + * // basic + * github.authenticate({ + * type: "basic", + * username: "mikedeboertest", + * password: "test1324" + * }); + * + * // or oauth + * github.authenticate({ + * type: "oauth", + * token: "e5a4a27487c26e571892846366de023349321a73" + * }); + * + * // or oauth key/ secret + * github.authenticate({ + * type: "oauth", + * key: "clientID", + * secret: "clientSecret" + * }); + * + * // or token + * github.authenticate({ + * type: "token", + * token: "userToken", + * }); + **/ + this.authenticate = function(options) { + if (!options) { + this.auth = false; + return; + } + if (!options.type || "basic|oauth|client|token".indexOf(options.type) === -1) + throw new Error("Invalid authentication type, must be 'basic', 'oauth' or 'client'"); + if (options.type == "basic" && (!options.username || !options.password)) + throw new Error("Basic authentication requires both a username and password to be set"); + if (options.type == "oauth") { + if (!options.token && !(options.key && options.secret)) + throw new Error("OAuth2 authentication requires a token or key & secret to be set"); + } + if (options.type == "token" && !options.token) + throw new Error("Token authentication requires a token to be set"); + + this.auth = options; + }; + + function getPageLinks(link) { + if (typeof link == "object" && (link.link || link.meta.link)) + link = link.link || link.meta.link; + + var links = {}; + if (typeof link != "string") + return links; + + // link format: + // '; rel="next", ; rel="last"' + link.replace(/<([^>]*)>;\s*rel="([\w]*)\"/g, function(m, uri, type) { + links[type] = uri; + }); + return links; + } + + /** + * Client#hasNextPage(link) -> null + * - link (mixed): response of a request or the contents of the Link header + * + * Check if a request result contains a link to the next page + **/ + this.hasNextPage = function(link) { + return getPageLinks(link).next; + }; + + /** + * Client#hasPreviousPage(link) -> null + * - link (mixed): response of a request or the contents of the Link header + * + * Check if a request result contains a link to the previous page + **/ + this.hasPreviousPage = function(link) { + return getPageLinks(link).prev; + }; + + /** + * Client#hasLastPage(link) -> null + * - link (mixed): response of a request or the contents of the Link header + * + * Check if a request result contains a link to the last page + **/ + this.hasLastPage = function(link) { + return getPageLinks(link).last; + }; + + /** + * Client#hasFirstPage(link) -> null + * - link (mixed): response of a request or the contents of the Link header + * + * Check if a request result contains a link to the first page + **/ + this.hasFirstPage = function(link) { + return getPageLinks(link).first; + }; + + function getPage(link, which, callback) { + var url = getPageLinks(link)[which]; + if (!url) + return callback(new error.NotFound("No " + which + " page found")); + + var api = this[this.version]; + var parsedUrl = Url.parse(url, true); + var block = { + url: parsedUrl.pathname, + method: "GET", + params: parsedUrl.query + }; + this.httpSend(parsedUrl.query, block, function(err, res) { + if (err) + return api.sendError(err, null, parsedUrl.query, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + ["x-ratelimit-limit", "x-ratelimit-remaining", "link"].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } + + if (callback) + callback(null, ret); + }); + } + + /** + * Client#getNextPage(link, callback) -> null + * - link (mixed): response of a request or the contents of the Link header + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * Get the next page, based on the contents of the `Link` header + **/ + this.getNextPage = function(link, callback) { + getPage.call(this, link, "next", callback); + }; + + /** + * Client#getPreviousPage(link, callback) -> null + * - link (mixed): response of a request or the contents of the Link header + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * Get the previous page, based on the contents of the `Link` header + **/ + this.getPreviousPage = function(link, callback) { + getPage.call(this, link, "prev", callback); + }; + + /** + * Client#getLastPage(link, callback) -> null + * - link (mixed): response of a request or the contents of the Link header + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * Get the last page, based on the contents of the `Link` header + **/ + this.getLastPage = function(link, callback) { + getPage.call(this, link, "last", callback); + }; + + /** + * Client#getFirstPage(link, callback) -> null + * - link (mixed): response of a request or the contents of the Link header + * - callback (Function): function to call when the request is finished with an error as first argument and result data as second argument. + * + * Get the first page, based on the contents of the `Link` header + **/ + this.getFirstPage = function(link, callback) { + getPage.call(this, link, "first", callback); + }; + + function getRequestFormat(hasBody, block) { + if (hasBody) + return block.requestFormat || this.constants.requestFormat; + + return "query"; + } + + function getQueryAndUrl(msg, def, format, config) { + var url = def.url; + if (config.pathPrefix && url.indexOf(config.pathPrefix) !== 0) { + url = config.pathPrefix + def.url; + } + var ret = { + query: format == "json" ? {} : format == "raw" ? msg.data : [] + }; + if (!def || !def.params) { + ret.url = url; + return ret; + } + + Object.keys(def.params).forEach(function(paramName) { + paramName = paramName.replace(/^[$]+/, ""); + if (!(paramName in msg)) + return; + + var isUrlParam = url.indexOf(":" + paramName) !== -1; + var valFormat = isUrlParam || format != "json" ? "query" : format; + var val; + if (valFormat != "json") { + if (typeof msg[paramName] == "object") { + try { + msg[paramName] = JSON.stringify(msg[paramName]); + val = encodeURIComponent(msg[paramName]); + } + catch (ex) { + return Util.log("httpSend: Error while converting object to JSON: " + + (ex.message || ex), "error"); + } + } + else if (def.params[paramName] && def.params[paramName].combined) { + // Check if this is a combined (search) string. + val = msg[paramName].split(/[\s\t\r\n]*\+[\s\t\r\n]*/) + .map(function(part) { + return encodeURIComponent(part); + }) + .join("+"); + } + else + val = encodeURIComponent(msg[paramName]); + } + else + val = msg[paramName]; + + if (isUrlParam) { + url = url.replace(":" + paramName, val); + } + else { + if (format == "json") + ret.query[paramName] = val; + else if (format != "raw") + ret.query.push(paramName + "=" + val); + } + }); + ret.url = url; + return ret; + } + + /** + * Client#httpSend(msg, block, callback) -> null + * - msg (Object): parameters to send as the request body + * - block (Object): parameter definition from the `routes.json` file that + * contains validation rules + * - callback (Function): function to be called when the request returns. + * If the the request returns with an error, the error is passed to + * the callback as its first argument (NodeJS-style). + * + * Send an HTTP request to the server and pass the result to a callback. + **/ + this.httpSend = function(msg, block, callback) { + var self = this; + var method = block.method.toLowerCase(); + var hasFileBody = block.hasFileBody; + var hasBody = !hasFileBody && ("head|get|delete".indexOf(method) === -1); + var format = getRequestFormat.call(this, hasBody, block); + var obj = getQueryAndUrl(msg, block, format, self.config); + var query = obj.query; + var url = this.config.url ? this.config.url + obj.url : obj.url; + + var path = url; + var protocol = this.config.protocol || this.constants.protocol || "http"; + var host = block.host || this.config.host || this.constants.host; + var port = this.config.port || this.constants.port || (protocol == "https" ? 443 : 80); + var proxyUrl; + if (this.config.proxy !== undefined) { + proxyUrl = this.config.proxy; + } else { + proxyUrl = process.env.HTTPS_PROXY || process.env.HTTP_PROXY; + } + if (proxyUrl) { + path = Url.format({ + protocol: protocol, + hostname: host, + port: port, + pathname: path + }); + + if (!/^(http|https):\/\//.test(proxyUrl)) + proxyUrl = "https://" + proxyUrl; + + var parsedUrl = Url.parse(proxyUrl); + protocol = parsedUrl.protocol.replace(":", ""); + host = parsedUrl.hostname; + port = parsedUrl.port || (protocol == "https" ? 443 : 80); + } + if (!hasBody && query.length) + path += "?" + query.join("&"); + + var headers = { + "host": host, + "content-length": "0" + }; + if (hasBody) { + if (format == "json") + query = JSON.stringify(query); + else if (format != "raw") + query = query.join("&"); + headers["content-length"] = Buffer.byteLength(query, "utf8"); + headers["content-type"] = format == "json" + ? "application/json; charset=utf-8" + : format == "raw" + ? "text/plain; charset=utf-8" + : "application/x-www-form-urlencoded; charset=utf-8"; + } + if (this.auth) { + var basic; + switch (this.auth.type) { + case "oauth": + if (this.auth.token) { + path += (path.indexOf("?") === -1 ? "?" : "&") + + "access_token=" + encodeURIComponent(this.auth.token); + } else { + path += (path.indexOf("?") === -1 ? "?" : "&") + + "client_id=" + encodeURIComponent(this.auth.key) + + "&client_secret=" + encodeURIComponent(this.auth.secret); + } + break; + case "token": + headers.authorization = "token " + this.auth.token; + break; + case "basic": + basic = new Buffer(this.auth.username + ":" + this.auth.password, "ascii").toString("base64"); + headers.authorization = "Basic " + basic; + break; + default: + break; + } + } + + function callCallback(err, result) { + if (callback) { + var cb = callback; + callback = undefined; + cb(err, result); + } + } + + function addCustomHeaders(customHeaders) { + Object.keys(customHeaders).forEach(function(header) { + var headerLC = header.toLowerCase(); + if (self.requestHeaders.indexOf(headerLC) == -1) + return; + headers[headerLC] = customHeaders[header]; + }); + } + addCustomHeaders(Util.extend(msg.headers || {}, this.config.headers)); + + if (!headers["user-agent"]) + headers["user-agent"] = "NodeJS HTTP Client"; + + if (!("accept" in headers)) + headers.accept = this.config.requestMedia || this.constants.requestMedia; + + var options = { + host: host, + port: port, + path: path, + method: method, + headers: headers + }; + + if (this.config.rejectUnauthorized !== undefined) + options.rejectUnauthorized = this.config.rejectUnauthorized; + + if (this.debug) + console.log("REQUEST: ", options); + + function httpSendRequest() { + var req = require(protocol).request(options, function(res) { + if (self.debug) { + console.log("STATUS: " + res.statusCode); + console.log("HEADERS: " + JSON.stringify(res.headers)); + } + res.setEncoding("utf8"); + var data = ""; + res.on("data", function(chunk) { + data += chunk; + }); + res.on("error", function(err) { + callCallback(err); + }); + res.on("end", function() { + if (res.statusCode >= 400 && res.statusCode < 600 || res.statusCode < 10) { + callCallback(new error.HttpError(data, res.statusCode)); + } else { + res.data = data; + callCallback(null, res); + } + }); + }); + + var timeout = (block.timeout !== undefined) ? block.timeout : self.config.timeout; + if (timeout) { + req.setTimeout(timeout); + } + + req.on("error", function(e) { + if (self.debug) + console.log("problem with request: " + e.message); + callCallback(e.message); + }); + + req.on("timeout", function() { + if (self.debug) + console.log("problem with request: timed out"); + callCallback(new error.GatewayTimeout()); + }); + + // write data to request body + if (hasBody && query.length) { + if (self.debug) + console.log("REQUEST BODY: " + query + "\n"); + req.write(query + "\n"); + } + + if (block.hasFileBody) { + var stream = fs.createReadStream(msg.filePath); + stream.pipe(req); + } else { + req.end(); + } + }; + + if (hasFileBody) { + fs.stat(msg.filePath, function(err, stat) { + if (err) { + callCallback(err); + } else { + headers["content-length"] = stat.size; + headers["content-type"] = mime.lookup(msg.name); + httpSendRequest(); + } + }); + } else { + httpSendRequest(); + } + }; +}).call(Client.prototype); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/.npmignore b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/.npmignore new file mode 100644 index 00000000..e69de29b diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/LICENSE b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/LICENSE new file mode 100644 index 00000000..451fc455 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Benjamin Thomas, Robert Kieffer + +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/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/README.md b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/README.md new file mode 100644 index 00000000..506fbe55 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/README.md @@ -0,0 +1,90 @@ +# mime + +Comprehensive MIME type mapping API based on mime-db module. + +## Install + +Install with [npm](http://github.com/isaacs/npm): + + npm install mime + +## Contributing / Testing + + npm run test + +## Command Line + + mime [path_string] + +E.g. + + > mime scripts/jquery.js + application/javascript + +## API - Queries + +### mime.lookup(path) +Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. + +```js +var mime = require('mime'); + +mime.lookup('/path/to/file.txt'); // => 'text/plain' +mime.lookup('file.txt'); // => 'text/plain' +mime.lookup('.TXT'); // => 'text/plain' +mime.lookup('htm'); // => 'text/html' +``` + +### mime.default_type +Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) + +### mime.extension(type) +Get the default extension for `type` + +```js +mime.extension('text/html'); // => 'html' +mime.extension('application/octet-stream'); // => 'bin' +``` + +### mime.charsets.lookup() + +Map mime-type to charset + +```js +mime.charsets.lookup('text/plain'); // => 'UTF-8' +``` + +(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) + +## API - Defining Custom Types + +Custom type mappings can be added on a per-project basis via the following APIs. + +### mime.define() + +Add custom mime/extension mappings + +```js +mime.define({ + 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], + 'application/x-my-type': ['x-mt', 'x-mtt'], + // etc ... +}); + +mime.lookup('x-sft'); // => 'text/x-some-format' +``` + +The first entry in the extensions array is returned by `mime.extension()`. E.g. + +```js +mime.extension('text/x-some-format'); // => 'x-sf' +``` + +### mime.load(filepath) + +Load mappings from an Apache ".types" format file + +```js +mime.load('./my_project.types'); +``` +The .types file format is simple - See the `types` dir for examples. diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/build/build.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/build/build.js new file mode 100644 index 00000000..ed5313e3 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/build/build.js @@ -0,0 +1,11 @@ +var db = require('mime-db'); + +var mapByType = {}; +Object.keys(db).forEach(function(key) { + var extensions = db[key].extensions; + if (extensions) { + mapByType[key] = extensions; + } +}); + +console.log(JSON.stringify(mapByType)); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/build/test.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/build/test.js new file mode 100644 index 00000000..58b9ba7c --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/build/test.js @@ -0,0 +1,57 @@ +/** + * Usage: node test.js + */ + +var mime = require('../mime'); +var assert = require('assert'); +var path = require('path'); + +// +// Test mime lookups +// + +assert.equal('text/plain', mime.lookup('text.txt')); // normal file +assert.equal('text/plain', mime.lookup('TEXT.TXT')); // uppercase +assert.equal('text/plain', mime.lookup('dir/text.txt')); // dir + file +assert.equal('text/plain', mime.lookup('.text.txt')); // hidden file +assert.equal('text/plain', mime.lookup('.txt')); // nameless +assert.equal('text/plain', mime.lookup('txt')); // extension-only +assert.equal('text/plain', mime.lookup('/txt')); // extension-less () +assert.equal('text/plain', mime.lookup('\\txt')); // Windows, extension-less +assert.equal('application/octet-stream', mime.lookup('text.nope')); // unrecognized +assert.equal('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default + +// +// Test extensions +// + +assert.equal('txt', mime.extension(mime.types.text)); +assert.equal('html', mime.extension(mime.types.htm)); +assert.equal('bin', mime.extension('application/octet-stream')); +assert.equal('bin', mime.extension('application/octet-stream ')); +assert.equal('html', mime.extension(' text/html; charset=UTF-8')); +assert.equal('html', mime.extension('text/html; charset=UTF-8 ')); +assert.equal('html', mime.extension('text/html; charset=UTF-8')); +assert.equal('html', mime.extension('text/html ; charset=UTF-8')); +assert.equal('html', mime.extension('text/html;charset=UTF-8')); +assert.equal('html', mime.extension('text/Html;charset=UTF-8')); +assert.equal(undefined, mime.extension('unrecognized')); + +// +// Test node.types lookups +// + +assert.equal('application/font-woff', mime.lookup('file.woff')); +assert.equal('application/octet-stream', mime.lookup('file.buffer')); +assert.equal('audio/mp4', mime.lookup('file.m4a')); +assert.equal('font/opentype', mime.lookup('file.otf')); + +// +// Test charsets +// + +assert.equal('UTF-8', mime.charsets.lookup('text/plain')); +assert.equal(undefined, mime.charsets.lookup(mime.types.js)); +assert.equal('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); + +console.log('\nAll tests passed'); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/cli.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/cli.js new file mode 100755 index 00000000..20b1ffeb --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/cli.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node + +var mime = require('./mime.js'); +var file = process.argv[2]; +var type = mime.lookup(file); + +process.stdout.write(type + '\n'); + diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/mime.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/mime.js new file mode 100644 index 00000000..341b6a5c --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/mime.js @@ -0,0 +1,108 @@ +var path = require('path'); +var fs = require('fs'); + +function Mime() { + // Map of extension -> mime type + this.types = Object.create(null); + + // Map of mime type -> extension + this.extensions = Object.create(null); +} + +/** + * Define mimetype -> extension mappings. Each key is a mime-type that maps + * to an array of extensions associated with the type. The first extension is + * used as the default extension for the type. + * + * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); + * + * @param map (Object) type definitions + */ +Mime.prototype.define = function (map) { + for (var type in map) { + var exts = map[type]; + for (var i = 0; i < exts.length; i++) { + if (process.env.DEBUG_MIME && this.types[exts]) { + console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + + this.types[exts] + ' to ' + type); + } + + this.types[exts[i]] = type; + } + + // Default extension is the first one we encounter + if (!this.extensions[type]) { + this.extensions[type] = exts[0]; + } + } +}; + +/** + * Load an Apache2-style ".types" file + * + * This may be called multiple times (it's expected). Where files declare + * overlapping types/extensions, the last file wins. + * + * @param file (String) path of file to load. + */ +Mime.prototype.load = function(file) { + this._loading = file; + // Read file and split into lines + var map = {}, + content = fs.readFileSync(file, 'ascii'), + lines = content.split(/[\r\n]+/); + + lines.forEach(function(line) { + // Clean up whitespace/comments, and split into fields + var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); + map[fields.shift()] = fields; + }); + + this.define(map); + + this._loading = null; +}; + +/** + * Lookup a mime type based on extension + */ +Mime.prototype.lookup = function(path, fallback) { + var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); + + return this.types[ext] || fallback || this.default_type; +}; + +/** + * Return file extension associated with a mime type + */ +Mime.prototype.extension = function(mimeType) { + var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); + return this.extensions[type]; +}; + +// Default instance +var mime = new Mime(); + +// Define built-in types +mime.define(require('./types.json')); + +// Default type +mime.default_type = mime.lookup('bin'); + +// +// Additional API specific to the default instance +// + +mime.Mime = Mime; + +/** + * Lookup a charset based on mime type. + */ +mime.charsets = { + lookup: function(mimeType, fallback) { + // Assume text types are utf8 + return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; + } +}; + +module.exports = mime; diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/package.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/package.json new file mode 100644 index 00000000..ab45e600 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/package.json @@ -0,0 +1,73 @@ +{ + "author": { + "name": "Robert Kieffer", + "email": "robert@broofa.com", + "url": "http://github.com/broofa" + }, + "scripts": { + "prepublish": "node build/build.js > types.json", + "test": "node build/test.js" + }, + "bin": { + "mime": "cli.js" + }, + "contributors": [ + { + "name": "Benjamin Thomas", + "email": "benjamin@benjaminthomas.org", + "url": "http://github.com/bentomas" + } + ], + "description": "A comprehensive library for mime-type mapping", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/broofa/node-mime/master/LICENSE" + } + ], + "dependencies": {}, + "devDependencies": { + "mime-db": "^1.2.0" + }, + "keywords": [ + "util", + "mime" + ], + "main": "mime.js", + "name": "mime", + "repository": { + "url": "git+https://github.com/broofa/node-mime.git", + "type": "git" + }, + "version": "1.3.4", + "gitHead": "1628f6e0187095009dcef4805c3a49706f137974", + "bugs": { + "url": "https://github.com/broofa/node-mime/issues" + }, + "homepage": "https://github.com/broofa/node-mime", + "_id": "mime@1.3.4", + "_shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53", + "_from": "mime@>=1.2.11 <2.0.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "broofa", + "email": "robert@broofa.com" + }, + "maintainers": [ + { + "name": "broofa", + "email": "robert@broofa.com" + }, + { + "name": "bentomas", + "email": "benjamin@benjaminthomas.org" + } + ], + "dist": { + "shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53", + "tarball": "http://registry.npmjs.org/mime/-/mime-1.3.4.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/types.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/types.json new file mode 100644 index 00000000..c674b1c8 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/node_modules/mime/types.json @@ -0,0 +1 @@ +{"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mdp"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":["woff"],"application/font-woff2":["woff2"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["dmg"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-otf":["otf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-ttf":["ttf","ttc"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["iso"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdownload":["exe","dll","com","bat","msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","wmz","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-nzb":["nzb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-research-info-systems":["ris"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp4":["mp4a","m4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-wav":["wav"],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/opentype":["otf"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jpeg":["jpeg","jpg","jpe"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-mrsid-image":["sid"],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/sgml":["sgml","sgm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["markdown","md","mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-pascal":["p","pas"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/package.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/package.json new file mode 100644 index 00000000..16d3ca1e --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/package.json @@ -0,0 +1,70 @@ +{ + "name": "github", + "version": "0.2.4", + "description": "NodeJS wrapper for the GitHub API", + "author": { + "name": "Mike de Boer", + "email": "info@mikedeboer.nl" + }, + "contributors": [ + { + "name": "Mike de Boer", + "email": "info@mikedeboer.nl" + }, + { + "name": "Fabian Jakobs", + "email": "fabian@c9.io" + } + ], + "homepage": "http://github.com/mikedeboer/node-github", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/mikedeboer/node-github.git" + }, + "engine": { + "node": ">=0.4.0" + }, + "dependencies": { + "mime": "^1.2.11" + }, + "devDependencies": { + "oauth": "~0.9.7", + "optimist": "~0.6.0", + "mocha": "~1.13.0" + }, + "main": ".", + "scripts": { + "test": "node ./test/all.js" + }, + "licenses": [ + { + "type": "The MIT License", + "url": "http://www.opensource.org/licenses/mit-license.php" + } + ], + "gitHead": "29dedb3022649c27ac1dad79326270b6b2a48047", + "bugs": { + "url": "https://github.com/mikedeboer/node-github/issues" + }, + "_id": "github@0.2.4", + "_shasum": "24fa7f0e13fa11b946af91134c51982a91ce538b", + "_from": "github@*", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "mikedeboer", + "email": "info@mikedeboer.nl" + }, + "maintainers": [ + { + "name": "mikedeboer", + "email": "info@mikedeboer.nl" + } + ], + "dist": { + "shasum": "24fa7f0e13fa11b946af91134c51982a91ce538b", + "tarball": "http://registry.npmjs.org/github/-/github-0.2.4.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/github/-/github-0.2.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/seed.yml b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/seed.yml new file mode 100644 index 00000000..80315da0 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/seed.yml @@ -0,0 +1,5 @@ +--- + name: node-github + description: NodeJS wrapper for the GitHub API + tags: git github web + version: 0.2.4 diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/after_request.js.tpl b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/after_request.js.tpl new file mode 100644 index 00000000..0e8277cc --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/after_request.js.tpl @@ -0,0 +1,11 @@ + + if (!ret) + ret = {}; + if (typeof ret == "object") { + if (!ret.meta) + ret.meta = {}; + [<%headers%>].forEach(function(header) { + if (res.headers[header]) + ret.meta[header] = res.headers[header]; + }); + } diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/handler.js.tpl b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/handler.js.tpl new file mode 100644 index 00000000..b76033e6 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/handler.js.tpl @@ -0,0 +1,24 @@ +<%comment%> + this.<%funcName%> = function(msg, block, callback) { + var self = this; + this.client.httpSend(msg, block, function(err, res) { + if (err) + return self.sendError(err, null, msg, callback); + + var ret; + try { + ret = res.data; + var contentType = res.headers["content-type"]; + if (contentType && contentType.indexOf("application/json") !== -1) + ret = JSON.parse(ret); + } + catch (ex) { + if (callback) + callback(new error.InternalServerError(ex.message), res); + return; + } +<%afterRequest%> + if (callback) + callback(null, ret); + }); + }; diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/index.js.tpl b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/index.js.tpl new file mode 100644 index 00000000..b5a585ff --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/index.js.tpl @@ -0,0 +1,40 @@ +/** + * class <%name%> + * + * <%description%> + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var Fs = require("fs"); +var Util = require("./../../util"); +var error = require("./../../error"); + +var GithubHandler = module.exports = function(client) { + this.client = client; + this.routes = JSON.parse(Fs.readFileSync(__dirname + "/routes.json", "utf8")); +}; + +var proto = { + sendError: function(err, block, msg, callback) { + if (this.client.debug) + Util.log(err, block, msg.user, "error"); + if (typeof err == "string") + err = new error.InternalServerError(err); + if (callback) + callback(err); + } +}; + +[<%scripts%>].forEach(function(api) { + Util.extend(proto, require("./" + api)); +}); + +GithubHandler.prototype = proto; diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/section.js.tpl b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/section.js.tpl new file mode 100644 index 00000000..82a7c5ea --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/section.js.tpl @@ -0,0 +1,23 @@ +/** + * mixin <%sectionName%> + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var error = require("./../../error"); +var Util = require("./../../util"); + +var <%sectionName%> = module.exports = { + <%sectionName%>: {} +}; + +(function() { +<%sectionBody%> +}).call(<%sectionName%>.<%sectionName%>); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/test_handler.js.tpl b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/test_handler.js.tpl new file mode 100644 index 00000000..f6287660 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/test_handler.js.tpl @@ -0,0 +1,10 @@ + it("should successfully execute <%name%>", function(next) { + client.<%funcName%>( + <%params%>, + function(err, res) { + Assert.equal(err, null); + // other assertions go here + next(); + } + ); + }); \ No newline at end of file diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/test_section.js.tpl b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/test_section.js.tpl new file mode 100644 index 00000000..bde8fbfe --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/templates/test_section.js.tpl @@ -0,0 +1,30 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../../index"); + +describe("[<%sectionName%>]", function() { + var client; + var token = "c286e38330e15246a640c2cf32a45ea45d93b2ba"; + + beforeEach(function() { + client = new Client({ + version: "<%version%>" + }); + client.authenticate({ + type: "oauth", + token: token + }); + }); + +<%testBody%> +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/client_test.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/client_test.js new file mode 100644 index 00000000..85305895 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/client_test.js @@ -0,0 +1,62 @@ +/* + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + */ + +"use strict"; + +var Assert = require("assert"); +var Client = require("./../index"); + +describe("[client]", function() { + var client; + var token = "e5a4a27487c26e571892846366de023349321a73"; + + beforeEach(function() { + client = new Client({ + version: "3.0.0" + }); + /*client.authenticate({ + type: "oauth", + token: token + });*/ + }); + + it("should successfully execute GET /authorizations (getAll)", function(next) { + // `aseemk` has two pages of followers right now. + client.user.getFollowers( + { + user: "aseemk" + }, + function(err, res) { + Assert.equal(err, null); + + Assert.ok(!!client.hasNextPage(res)); + Assert.ok(!!client.hasLastPage(res)); + Assert.ok(!client.hasPreviousPage(res)); + + client.getNextPage(res, function(err, res) { + Assert.equal(err, null); + + Assert.ok(!!client.hasPreviousPage(res)); + Assert.ok(!!client.hasFirstPage(res)); + Assert.ok(!client.hasNextPage(res)); + Assert.ok(!client.hasLastPage(res)); + + client.getPreviousPage(res.meta.link, function(err, res) { + Assert.equal(err, null); + + Assert.ok(!!client.hasNextPage(res)); + Assert.ok(!!client.hasLastPage(res)); + Assert.ok(!client.hasPreviousPage(res)); + next(); + }); + }); + } + ); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/example.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/example.js new file mode 100644 index 00000000..4c288862 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/example.js @@ -0,0 +1,37 @@ +/** section: github, internal + * Example + * + * Github API usage example. + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +"use strict"; + +var Client = require("./../index"); + +var github = new Client({ + debug: true, + version: "3.0.0" +}); + +github.authenticate({ + type: "basic", + username: "mikedeboer", + password: "mysecretpass" +}); + +github.user.get({}, function(err, res) { + console.log("GOT ERR?", err); + console.log("GOT RES?", res); + + github.repos.getAll({}, function(err, res) { + console.log("GOT ERR?", err); + console.log("GOT RES?", res); + }); +}); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/oauth.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/oauth.js new file mode 100644 index 00000000..3fbeadd6 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/oauth.js @@ -0,0 +1,95 @@ +/** section: github, internal + * OAuth + * + * OAuth usage example. + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +var http = require("http"); +var Url = require("url"); +var querystring = require("querystring"); + +var Client = require("../index"); +var OAuth2 = require("oauth").OAuth2; + +var github = new Client({ + version: "3.0.0" +}); + +var clientId = "e8c434a1c92e9de7ff8d"; +var secret = "1d0fcbb060e1dd86a0aa3d12265419c9bb19a333"; +var oauth = new OAuth2(clientId, secret, "https://github.com/", "login/oauth/authorize", "login/oauth/access_token"); + +// for demo purposes use one global access token +// in production this has to be stored in a user session +var accessToken = ""; + +http.createServer(function(req, res) { + var url = Url.parse(req.url); + var path = url.pathname; + var query = querystring.parse(url.query); + + if (path == "/" || path.match(/^\/user\/?$/)) { + // redirect to github if there is no access token + if (!accessToken) { + res.writeHead(303, { + Location: oauth.getAuthorizeUrl({ + redirect_uri: 'http://localhost:7878/github-callback', + scope: "user,repo,gist" + }) + }); + res.end(); + return; + } + + // use github API + github.user.get({}, function(err, user) { + if (err) { + res.writeHead(err.code); + res.end(err + ""); + return; + } + res.writeHead(200); + res.end(JSON.stringify(user)); + }); + return; + } + // URL called by github after authenticating + else if (path.match(/^\/github-callback\/?$/)) { + // upgrade the code to an access token + oauth.getOAuthAccessToken(query.code, {}, function (err, access_token, refresh_token) { + if (err) { + console.log(err); + res.writeHead(500); + res.end(err + ""); + return; + } + + accessToken = access_token; + + // authenticate github API + github.authenticate({ + type: "oauth", + token: accessToken + }); + + //redirect back + res.writeHead(303, { + Location: "/" + }); + res.end(); + }); + return; + } + + res.writeHead(404); + res.end("404 - Not found"); +}).listen(7878); + +console.log("listening at http://localhost:7878"); diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/oauth_server.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/oauth_server.js new file mode 100644 index 00000000..1a2e7cf7 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/test/oauth_server.js @@ -0,0 +1,59 @@ +"use strict"; + +var GitHubApi = require("./../index"); + +var github = new GitHubApi({ + version: "3.0.0" +}); + +/* +!!!UNCOMMENT THE FOLLOWING TO MAKE THIS SCRIPT WORK, BUT CHANGE THE CREDENTIALS TO YOUR OWN!!! +github.authenticate({ + type: "basic", + username: "mikedeboertest", + password: "test1324" +}); +*/ + +github.authorization.getAll({}, function(err, res) { + if (err) + throw err; + + var ids = res.map(function(app) { return app.id; }); + + function next(id) { + github.authorization["delete"]({ + id: id + }, function(err, res) { + if (err) + throw err; + if (ids.length) + next(ids.shift()); + else + allRemoved(); + }); + } + + next(ids.shift()); + + function allRemoved() { + github.authorization.create({ + scopes: ["user", "public_repo", "repo", "repo:status", "delete_repo", "gist"], + note: "Authorization created to create unit tests", + note_url: "https://github.com/ajaxorg/node-github" + }, function(err, res) { + if (err) + throw err; + + // you can use the token within server-side apps. + // use it by doing: + // github.authenticate({ + // type: "oauth", + // token: e5a4a27487c26e571892846366de023349321a73 + // }); + console.log("TOKEN:", res.token); + console.log(res); + }); + } + +}); \ No newline at end of file diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/util.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/util.js new file mode 100644 index 00000000..7d536d6a --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/node_modules/github/util.js @@ -0,0 +1,140 @@ +/** section: github + * class Util + * + * Copyright 2012 Cloud9 IDE, Inc. + * + * This product includes software developed by + * Cloud9 IDE, Inc (http://c9.io). + * + * Author: Mike de Boer + **/ + +var Util = require("util"); + +/** + * Util#extend(dest, src, noOverwrite) -> Object + * - dest (Object): destination object + * - src (Object): source object + * - noOverwrite (Boolean): set to `true` to overwrite values in `src` + * + * Shallow copy of properties from the `src` object to the `dest` object. If the + * `noOverwrite` argument is set to to `true`, the value of a property in `src` + * will not be overwritten if it already exists. + **/ +exports.extend = function(dest, src, noOverwrite) { + for (var prop in src) { + if (!noOverwrite || typeof dest[prop] == "undefined") + dest[prop] = src[prop]; + } + return dest; +}; + +/** + * Util#escapeRegExp(str) -> String + * - str (String): string to escape + * + * Escapes characters inside a string that will an error when it is used as part + * of a regex upon instantiation like in `new RegExp("[0-9" + str + "]")` + **/ +exports.escapeRegExp = function(str) { + return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); +}; + +/** + * Util#toCamelCase(str, [upper]) -> String + * - str (String): string to transform + * - upper (Boolean): set to `true` to transform to CamelCase + * + * Transform a string that contains spaces or dashes to camelCase. If `upper` is + * set to `true`, the string will be transformed to CamelCase. + * + * Example: + * + * Util.toCamelCase("why U no-work"); // returns 'whyUNoWork' + * Util.toCamelCase("I U no-work", true); // returns 'WhyUNoWork' + **/ +exports.toCamelCase = function(str, upper) { + str = str.toLowerCase().replace(/(?:(^.)|(\s+.)|(-.))/g, function(match) { + return match.charAt(match.length - 1).toUpperCase(); + }); + if (upper) + return str; + return str.charAt(0).toLowerCase() + str.substr(1); +}; + +/** + * Util#isTrue(c) -> Boolean + * - c (mixed): value the variable to check. Possible values: + * true The function returns true. + * 'true' The function returns true. + * 'on' The function returns true. + * 1 The function returns true. + * '1' The function returns true. + * + * Determines whether a string is true in the html attribute sense. + **/ +exports.isTrue = function(c){ + return (c === true || c === "true" || c === "on" || typeof c == "number" && c > 0 || c === "1"); +}; + +/** + * Util#isFalse(c) -> Boolean + * - c (mixed): value the variable to check. Possible values: + * false The function returns true. + * 'false' The function returns true. + * 'off' The function returns true. + * 0 The function returns true. + * '0' The function returns true. + * + * Determines whether a string is false in the html attribute sense. + **/ +exports.isFalse = function(c){ + return (c === false || c === "false" || c === "off" || c === 0 || c === "0"); +}; + +var levels = { + "info": ["\033[90m", "\033[39m"], // grey + "error": ["\033[31m", "\033[39m"], // red + "fatal": ["\033[35m", "\033[39m"], // magenta + "exit": ["\033[36m", "\033[39m"] // cyan +}; +var _slice = Array.prototype.slice; + +/** + * Util#log(arg1, [arg2], [type]) -> null + * - arg1 (mixed): messages to be printed to the standard output + * - type (String): type denotation of the message. Possible values: + * 'info', 'error', 'fatal', 'exit'. Optional, defaults to 'info'. + * + * Unified logging to the console; arguments passed to this function will put logged + * to the standard output of the current process and properly formatted. + * Any non-String object will be inspected by the NodeJS util#inspect utility + * function. + * Messages will be prefixed with its type (with corresponding font color), like so: + * + * [info] informational message + * [error] error message + * [fatal] fatal error message + * [exit] program exit message (not an error) + * + * The type of message can be defined by passing it to this function as the last/ + * final argument. If the type can not be found, this last/ final argument will be + * regarded as yet another message. + **/ +exports.log = function() { + var args = _slice.call(arguments); + var lastArg = args[args.length - 1]; + + var level = levels[lastArg] ? args.pop() : "info"; + if (!args.length) + return; + + var msg = args.map(function(arg) { + return typeof arg != "string" ? Util.inspect(arg) : arg; + }).join(" "); + var pfx = levels[level][0] + "[" + level + "]" + levels[level][1]; + + msg.split("\n").forEach(function(line) { + console.log(pfx + " " + line); + }); +}; diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/out/src/extension.js b/.vscode/extensions/codezombiech.gitignore-0.2.0/out/src/extension.js new file mode 100644 index 00000000..93487bca --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/out/src/extension.js @@ -0,0 +1,164 @@ +'use strict'; +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var vscode = require('vscode'); +var GitHubApi = require('github'); +var fs = require('fs'); +var https = require('https'); +var CancellationError = (function (_super) { + __extends(CancellationError, _super); + function CancellationError() { + _super.apply(this, arguments); + } + return CancellationError; +}(Error)); +var CacheItem = (function () { + function CacheItem(value) { + this._value = value; + this.storeDate = new Date(); + } + Object.defineProperty(CacheItem.prototype, "value", { + get: function () { + return this._value; + }, + enumerable: true, + configurable: true + }); + CacheItem.prototype.isExpired = function (expirationInterval) { + return this.storeDate.getTime() + expirationInterval * 1000 < Date.now(); + }; + return CacheItem; +}()); +var GitignoreRepository = (function () { + function GitignoreRepository(client) { + this.client = client; + var config = vscode.workspace.getConfiguration('gitignore'); + this.cacheExpirationInterval = config.get('cacheExpirationInterval', 3600); + } + /** + * Get all .gitignore files + */ + GitignoreRepository.prototype.getFiles = function () { + var _this = this; + return new Promise(function (resolve, reject) { + // If cached, return cached content + if (_this.cache && !_this.cache.isExpired(_this.cacheExpirationInterval)) { + resolve(_this.cache.value); + return; + } + // Download .gitignore files from github + _this.client.repos.getContent({ + user: 'github', + repo: 'gitignore', + path: '' + }, function (err, response) { + if (err) { + reject(err.message); + return; + } + var files = response + .filter(function (file) { + return (file.type === 'file' && file.name.endsWith('.gitignore')); + }) + .map(function (file) { + return { + label: file.name.replace(/\.gitignore/, ''), + description: file.name, + url: file.download_url + }; + }); + // Cache the retrieved gitignore files + _this.cache = new CacheItem(files); + resolve(files); + }); + }); + }; + /** + * Downloads a .gitignore from the repository to the path passed + */ + GitignoreRepository.prototype.download = function (gitignoreFile, path) { + return new Promise(function (resolve, reject) { + var file = fs.createWriteStream(path); + var request = https.get(gitignoreFile.url, function (response) { + response.pipe(file); + file.on('finish', function () { + file.close(function () { + resolve(gitignoreFile); + }); + }); + }).on('error', function (err) { + // Delete the file + fs.unlink(path); + reject(err.message); + }); + }); + }; + return GitignoreRepository; +}()); +// Create a Github API client +var client = new GitHubApi({ + version: '3.0.0', + protocol: 'https', + host: 'api.github.com', + //debug: true, + pathPrefix: '', + timeout: 5000, + headers: { + 'user-agent': 'vscode-gitignore-extension' + } +}); +// Create gitignore repository +var gitignoreRepository = new GitignoreRepository(client); +function activate(context) { + console.log('extension "gitignore" is now active!'); + var disposable = vscode.commands.registerCommand('addgitignore', function () { + // Check if workspace open + if (!vscode.workspace.rootPath) { + vscode.window.showErrorMessage('No workspace directory open'); + return; + } + Promise.resolve(vscode.window.showQuickPick(gitignoreRepository.getFiles())) + .then(function (file) { + if (!file) { + // Cancel + throw new CancellationError(); + } + var path = vscode.workspace.rootPath + '/.gitignore'; + return new Promise(function (resolve, reject) { + // Check if file exists + fs.stat(path, function (err, stats) { + if (err) { + // File does not exists -> we are fine to create it + resolve({ path: path, file: file }); + } + else { + reject('.gitignore already exists'); + } + }); + }); + }) + .then(function (s) { + // Store the file on file system + return gitignoreRepository.download(s.file, s.path); + }) + .then(function (file) { + vscode.window.showInformationMessage("Added " + file.description + " to your project root"); + }) + .catch(function (reason) { + if (reason instanceof CancellationError) { + return; + } + vscode.window.showErrorMessage(reason); + }); + }); + context.subscriptions.push(disposable); +} +exports.activate = activate; +// this method is called when your extension is deactivated +function deactivate() { +} +exports.deactivate = deactivate; +//# sourceMappingURL=extension.js.map \ No newline at end of file diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/package.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/package.json new file mode 100644 index 00000000..8a453233 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/package.json @@ -0,0 +1,83 @@ +{ + "name": "gitignore", + "displayName": "gitignore", + "description": "Language support for .gitignore files. Lets you pull .gitignore files from the https://github.com/github/gitignore repository.", + "version": "0.2.0", + "publisher": "codezombiech", + "icon": "icon.png", + "repository": { + "type": "git", + "url": "https://github.com/CodeZombieCH/vscode-gitignore" + }, + "bugs": { + "url": "https://github.com/CodeZombieCH/vscode-gitignore/issues" + }, + "license": "MIT", + "engines": { + "vscode": "^0.10.10" + }, + "categories": [ + "Languages", + "Other" + ], + "activationEvents": [ + "onCommand:addgitignore" + ], + "main": "./out/src/extension", + "contributes": { + "commands": [ + { + "command": "addgitignore", + "title": "Add gitignore" + } + ], + "configuration": { + "type": "object", + "title": "gitignore extension configuration", + "properties": { + "gitignore.cacheExpirationInterval": { + "type": "integer", + "default": 3600, + "description": "Number of seconds the list of `.gitignore` files retrieved from github will be cached" + } + } + }, + "languages": [ + { + "id": "gitignore", + "aliases": [ + "Gitignore" + ], + "filenames": [ + ".gitignore" + ], + "configuration": "./gitignore.configuration.json" + } + ], + "grammars": [ + { + "language": "gitignore", + "scopeName": "text.gitignore", + "path": "./syntaxes/gitignore.json" + } + ] + }, + "scripts": { + "vscode:prepublish": "node ./node_modules/vscode/bin/compile", + "compile": "node ./node_modules/vscode/bin/compile -watch -p ./", + "postinstall": "node ./node_modules/vscode/bin/install" + }, + "devDependencies": { + "typescript": "^1.8.5", + "vsce": "^1.2.3", + "vscode": "^0.11.8" + }, + "dependencies": { + "github": "^0.2.4" + }, + "__metadata": { + "id": "3e891cf9-53cb-49a3-8d01-8f0b1f0afb29", + "publisherId": "930310c4-ca8b-4e80-9d19-2b1507b2af61", + "publisherDisplayName": "CodeZombie" + } +} \ No newline at end of file diff --git a/.vscode/extensions/codezombiech.gitignore-0.2.0/syntaxes/gitignore.json b/.vscode/extensions/codezombiech.gitignore-0.2.0/syntaxes/gitignore.json new file mode 100644 index 00000000..06ac5622 --- /dev/null +++ b/.vscode/extensions/codezombiech.gitignore-0.2.0/syntaxes/gitignore.json @@ -0,0 +1,15 @@ +{ + "name": "Gitignore", + "scopeName": "text.gitignore", + "fileTypes": [ + ".gitignore" + ], + "patterns": [ + { + "match": "^#.*", + "name": "comment.gitignore", + "comment": "Comments" + } + ], + "uuid": "2e829dfc-3206-466c-9cca-5f2251dd5758" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/.vsixmanifest b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/.vsixmanifest new file mode 100644 index 00000000..dc86d754 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/.vsixmanifest @@ -0,0 +1,32 @@ + + + + + Instant Markdown + Instant previews of your markdown files as you type. + vscode + Other + Public + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/README.md new file mode 100644 index 00000000..759af3ec --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/README.md @@ -0,0 +1,38 @@ +# vscode-instant-markdown + +> Simply, edit markdown documents in vscode and instantly preview it in your browser. + +Uses [instant-markdown-d](https://github.com/suan/instant-markdown-d). + +## Installation + +Press F1 and narrow down the list commands by typing `extension`. Pick `Extensions: Install Extension`. +Select the `Instant Markdown` extension from the list + +## Install Manual + +**Mac & Linux** +```sh +cd $HOME/.vscode/extensions +git clone https://github.com/dbankier/vscode-instant-markdown.git +cd vscode-instant-markdown +npm install +``` + +**Windows** +``` +cd %USERPROFILE%\.vscode\extensions +git clone https://github.com/dbankier/vscode-instant-markdown.git +cd vscode-instant-markdown +npm install +``` + +## Usage + +When you edit a markdown document it should instantly preview in your browser with changes applied as you type. + + +## License + +MIT © [David Bankier @dbankier](https://github.com/dbankier) +[@davidbankier](https://twitter.com/davidbankier) \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/extension.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/extension.js new file mode 100644 index 00000000..2c2662e1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/extension.js @@ -0,0 +1,79 @@ +// The module 'vscode' contains the VS Code extensibility API +// Import the module and reference it with the alias vscode in your code below +var vscode = require('vscode'); +var Promise = require('bluebird'); +var request = Promise.promisify(require("request")); +var shell = require("shelljs"); +var path = require('path'); + + +function activate(context) { + var instantMarkdown = new InstantMarkdown(); + var instantMarkdownController = new InstantMarkdownController(instantMarkdown); + context.subscriptions.push(instantMarkdown); + context.subscriptions.push(instantMarkdownController); +} + +function InstantMarkdown() { + var started = false; + var self = this; + this.initialise = function(callback) { + console.log("Initialising"); + var server = shell.exec(path.join(__dirname,"node_modules","instant-markdown-d","instant-markdown-d"), {async: true}) + server.stdout.on('data', function(data) { + if (!started && (data.toString().indexOf("connection established!") !== -1 || data.toString().indexOf("EADDRINUSE") !== -1)) { + callback(); + started = true; + } + + console.log(">>>" + data); + }); + }; + this.update = function() { + function requestUpdate() { + return request({ + uri: "http://localhost:8090", + method: "PUT", + body: vscode.window.activeTextEditor.document.getText() + }) + .then(function() {}, function(e) { + if (e.code === "ECONNREFUSED") { + self.initialise(); + } + console.log(e) + }); + } + if (started) { + requestUpdate(); + } else { + this.initialise(requestUpdate); + } + }; + this.close = function() { + if (started) { + return request({ + uri: "http://localhost:8090", + method: "DELETE" + }) + .then(function() { started = false } , function(e) { started = false; }); + } + } +} + +function InstantMarkdownController(md) { + var subscriptions = []; + function update() { + var editor = vscode.window.activeTextEditor; + if (!editor) { return; } + var doc = editor.document; + if (doc.languageId === "markdown") { + md.update(); + } else { + md.close(); + } + } + vscode.window.onDidChangeActiveTextEditor(update, this, subscriptions); + vscode.window.onDidChangeTextEditorSelection(update, this, subscriptions); + md.update(); +} +exports.activate = activate; \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/.bin/instant-markdown-d b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/.bin/instant-markdown-d new file mode 100755 index 00000000..c75208fd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/.bin/instant-markdown-d @@ -0,0 +1,101 @@ +#!/bin/sh +':' //; exec "`command -v nodejs || command -v node`" "$0" + +var MarkdownIt = require('markdown-it'); +var hljs = require('highlight.js'); +var server = require('http').createServer(httpHandler), + exec = require('child_process').exec, + io = require('socket.io').listen(server), + send = require('send'), + server, + socket; + +server.listen(8090); + +var md = new MarkdownIt({ + html: true, + linkify: true, + highlight: function(str, lang) { + if (lang && hljs.getLanguage(lang)) { + try { + return hljs.highlight(lang, str).value; + } catch (err) { + // Do nothing + } + } else { + return str; + } + } +}); + +function writeMarkdown(input, output) { + var body = ''; + input.on('data', function(data) { + body += data; + if (body.length > 1e6) { + throw new Error('The request body is too long.'); + } + }); + input.on('end', function() { + output.emit('newContent', md.render(body)); + }); +} + +function httpHandler(req, res) { + switch(req.method) + { + case 'GET': + // Example: /my-repo/raw/master/sub-dir/some.png + var githubUrl = req.url.match(/\/[^\/]+\/raw\/[^\/]+\/(.+)/); + if (githubUrl) { + // Serve the file out of the current working directory + send(req, githubUrl[1]) + .root(process.cwd()) + .pipe(res); + return; + } + + // Otherwise serve the file from the directory this module is in + send(req, req.url) + .root(__dirname) + .pipe(res); + break; + + // case 'HEAD': + // res.writeHead(200); + // res.end(); + // exec('open -g http://localhost:8090', function(error, stdout, stderr){ + // http.request({port: 8090}) + // }); + // break; + + case 'DELETE': + socket.emit('die'); + process.exit(); + break; + + case 'PUT': + writeMarkdown(req, socket); + res.writeHead(200); + res.end(); + break; + + default: + } +} + +io.set('log level', 1); +io.sockets.on('connection', function(sock){ + socket = sock; + process.stdout.write('connection established!'); + writeMarkdown(process.stdin, socket); + process.stdin.resume(); +}); + + +if (process.platform.toLowerCase().indexOf('darwin') >= 0){ + exec('open -g http://localhost:8090', function(error, stdout, stderr){}); +} +else { // assume unix/linux + exec('xdg-open http://localhost:8090', function(error, stdout, stderr){}); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/.bin/shjs b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/.bin/shjs new file mode 100755 index 00000000..d239a7ad --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/.bin/shjs @@ -0,0 +1,51 @@ +#!/usr/bin/env node +require('../global'); + +if (process.argv.length < 3) { + console.log('ShellJS: missing argument (script name)'); + console.log(); + process.exit(1); +} + +var args, + scriptName = process.argv[2]; +env['NODE_PATH'] = __dirname + '/../..'; + +if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { + if (test('-f', scriptName + '.js')) + scriptName += '.js'; + if (test('-f', scriptName + '.coffee')) + scriptName += '.coffee'; +} + +if (!test('-f', scriptName)) { + console.log('ShellJS: script not found ('+scriptName+')'); + console.log(); + process.exit(1); +} + +args = process.argv.slice(3); + +for (var i = 0, l = args.length; i < l; i++) { + if (args[i][0] !== "-"){ + args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words + } +} + +if (scriptName.match(/\.coffee$/)) { + // + // CoffeeScript + // + if (which('coffee')) { + exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true }); + } else { + console.log('ShellJS: CoffeeScript interpreter not found'); + console.log(); + process.exit(1); + } +} else { + // + // JavaScript + // + exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/LICENSE new file mode 100644 index 00000000..4182a1e1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2015 Petka Antonov + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/README.md new file mode 100644 index 00000000..2ffd5d08 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/README.md @@ -0,0 +1,44 @@ + + Promises/A+ logo + +[![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird) +[![coverage-98%](http://img.shields.io/badge/coverage-98%-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html) + +**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises) + +# Introduction + +Bluebird is a fully featured promise library with focus on innovative features and performance + +See the [bluebird website](http://bluebirdjs.com/docs/getting-started.html) for further documentation, references and instructions. + +For bluebird 2.x documentation and files, see the [2.x tree](https://github.com/petkaantonov/bluebird/tree/2.x). + +# Questions and issues + +The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`. + +# License + +The MIT License (MIT) + +Copyright (c) 2013-2015 Petka Antonov + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/changelog.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/changelog.md new file mode 100644 index 00000000..73b2eb6c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/changelog.md @@ -0,0 +1 @@ +[http://bluebirdjs.com/docs/changelog.html](http://bluebirdjs.com/docs/changelog.html) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/browser/bluebird.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/browser/bluebird.js new file mode 100644 index 00000000..8c742cda --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/browser/bluebird.js @@ -0,0 +1,5286 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2015 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.0.6 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; + +},{"./queue":26,"./schedule":29,"./util":36}],3:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; + +},{}],4:[function(_dereq_,module,exports){ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = _dereq_("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; + +},{"./promise":22}],5:[function(_dereq_,module,exports){ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!true) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var args = [].slice.call(arguments, 1);; + if (!true) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; + +},{"./util":36}],6:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise.isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent.isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this.isCancellable()) return; + + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this.isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; + +},{"./util":36}],7:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = _dereq_("./util"); +var getKeys = _dereq_("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; + +},{"./es5":13,"./util":36}],8:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; + +},{}],9:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = _dereq_("./errors").Warning; +var util = _dereq_("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (true || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 2097152); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 2097152) !== 0) return; + this._setRejectionIsUnhandled(); + async.invokeLater(this._notifyUnhandledRejection, this, undefined); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + config.warnings = !!opts.warnings; + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } +}; + +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this.isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise) { + if (returnValue === undefined && + promiseCreated !== null && + config.longStackTraces && + config.warnings) { + var msg = "a promise was created in a " + name + + " handler but was not returned from it"; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + formatAndLogError(warning, "", true); +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0) { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent(name, reason, promise); + } catch (e) { + globalEventFired = true; + async.throwLater(e); + } + + var domEventFired = false; + if (fireDomEvent) { + try { + domEventFired = fireDomEvent(name.toLowerCase(), { + reason: reason, + promise: promise + }); + } catch (e) { + domEventFired = true; + async.throwLater(e); + } + } + + if (!globalEventFired && !localEventFired && !domEventFired && + name === "unhandledRejection") { + formatAndLogError(reason, "Unhandled rejection "); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +var fireDomEvent; +var fireGlobalEvent = (function() { + if (util.isNode) { + return function(name, reason, promise) { + if (name === "rejectionHandled") { + return process.emit(name, promise); + } else { + return process.emit(name, reason, promise); + } + }; + } else { + var customEventWorks = false; + var anyEventWorks = true; + try { + var ev = new self.CustomEvent("test"); + customEventWorks = ev instanceof CustomEvent; + } catch (e) {} + if (!customEventWorks) { + try { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + self.dispatchEvent(event); + } catch (e) { + anyEventWorks = false; + } + } + if (anyEventWorks) { + fireDomEvent = function(type, detail) { + var event; + if (customEventWorks) { + event = new self.CustomEvent(type, { + detail: detail, + bubbles: false, + cancelable: true + }); + } else if (self.dispatchEvent) { + event = document.createEvent("CustomEvent"); + event.initCustomEvent(type, false, true, detail); + } + + return event ? !self.dispatchEvent(event) : false; + }; + } + + var toWindowMethodNameMap = {}; + toWindowMethodNameMap["unhandledRejection"] = ("on" + + "unhandledRejection").toLowerCase(); + toWindowMethodNameMap["rejectionHandled"] = ("on" + + "rejectionHandled").toLowerCase(); + + return function(name, reason, promise) { + var methodName = toWindowMethodNameMap[name]; + var method = self[methodName]; + if (!method) return false; + if (name === "rejectionHandled") { + method.call(self, promise); + } else { + method.call(self, reason, promise); + } + return true; + }; + } +})(); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace +}; +}; + +},{"./errors":12,"./util":36}],10:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; + +},{}],11:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return this.mapSeries(fn) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseMapSeries(promises, fn) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; + +},{}],12:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var Objectfreeze = es5.freeze; +var util = _dereq_("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; + +},{"./es5":13,"./util":36}],13:[function(_dereq_,module,exports){ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} + +},{}],14:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; + +},{}],15:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, tryConvertToPromise) { +var util = _dereq_("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.type === 0 + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret !== undefined) { + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise.isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, fail, undefined, { + promise: this, + handler: handler, + called: false, + cancelPromise: null, + type: type + }, undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +return finallyHandler; +}; + +},{"./util":36}],16:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = _dereq_("./errors"); +var TypeError = errors.TypeError; +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + promise._setOnCancel(this); + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this.promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + if (result === errorObj && result.e === reason) { + result = null; + } + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + var promise = this._promise; + this._cleanup(); + if (result === errorObj) { + promise._rejectCallback(result.e, false); + } else { + promise.cancel(); + } +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + return promise._rejectCallback(result.e, false); + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + return promise._resolveCallback(value); + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", value) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + this._promiseFulfilled(maybePromise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._promiseRejected(maybePromise._reason()); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; + +},{"./errors":12,"./util":36}],17:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) { +var util = _dereq_("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!true) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.now = 0; \n\ + } \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + promise._pushContext(); \n\ + var callback = this.fn; \n\ + var ret = tryCatch(callback)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", code) + (tryCatch, errorObj, Promise); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!true) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + if (!ret._isFateSealed()) { + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var args = [].slice.call(arguments);; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; + +},{"./util":36}],18:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var EMPTY_ARRAY = []; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : domain.bind(fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = limit >= 1 ? [] : EMPTY_ARRAY; + this._init$(undefined, -2); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var limit = typeof options === "object" && options !== null + ? options.concurrency + : 0; + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; + +},{"./util":36}],19:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; + +},{"./util":36}],20:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = _dereq_("./errors"); +var OperationalError = errors.OperationalError; +var es5 = _dereq_("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var args = [].slice.call(arguments, 1);; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; + +},{"./errors":12,"./es5":13,"./util":36}],21:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +var util = _dereq_("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; + +},{"./util":36}],22:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = _dereq_("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = _dereq_("./es5"); +var Async = _dereq_("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = _dereq_("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = _dereq_("./thenables")(Promise, INTERNAL); +var PromiseArray = + _dereq_("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = _dereq_("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = _dereq_("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var finallyHandler = _dereq_("./finally")(Promise, tryConvertToPromise); +var catchFilter = _dereq_("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = _dereq_("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + if (self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } +} + +function Promise(executor) { + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + if (executor !== INTERNAL) { + check(this, executor); + this._resolveFromExecutor(executor); + } + this._promiseCreated(); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + var prev = async._schedule; + async._schedule = fn; + return prev; +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && domain.bind(handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : domain.bind(fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : domain.bind(reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : domain.bind(fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : domain.bind(reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj || x === promise) { + var err = x === promise ? makeSelfResolutionError() : x.e; + promise._rejectCallback(err, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (handler === finallyHandler) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +_dereq_("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +_dereq_("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +_dereq_("./cancel")(Promise, PromiseArray, apiRejection, debug); +_dereq_("./direct_resolve")(Promise); +_dereq_("./synchronous_inspection")(Promise); +_dereq_("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug); +Promise.Promise = Promise; +_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +_dereq_('./timers.js')(Promise, INTERNAL); +_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +_dereq_('./nodeify.js')(Promise); +_dereq_('./call_get.js')(Promise); +_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +_dereq_('./settle.js')(Promise, PromiseArray, debug); +_dereq_('./some.js')(Promise, PromiseArray, apiRejection); +_dereq_('./promisify.js')(Promise, INTERNAL); +_dereq_('./any.js')(Promise); +_dereq_('./each.js')(Promise, INTERNAL); +_dereq_('./filter.js')(Promise, INTERNAL); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; + +},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = _dereq_("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise.isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; + +},{"./util":36}],24:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = _dereq_("./util"); +var nodebackForPromise = _dereq_("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = _dereq_("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!true) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + + +},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); +var isObject = util.isObject; +var es5 = _dereq_("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; + +},{"./es5":13,"./util":36}],26:[function(_dereq_,module,exports){ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype._unshiftOne = function(value) { + var capacity = this._capacity; + this._checkCapacity(this.length() + 1); + var front = this._front; + var i = (((( front - 1 ) & + ( capacity - 1) ) ^ capacity ) - capacity ); + this[i] = value; + this._front = i; + this._length = this.length() + 1; +}; + +Queue.prototype.unshift = function(fn, receiver, arg) { + this._unshiftOne(arg); + this._unshiftOne(receiver); + this._unshiftOne(fn); +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; + +},{}],27:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = _dereq_("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; + +},{"./util":36}],28:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = _dereq_("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : domain.bind(fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + this._eachValues = _each === INTERNAL ? [] : undefined; + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + this._eachValues.push(value); + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; + +},{"./util":36}],29:[function(_dereq_,module,exports){ +"use strict"; +var util = _dereq_("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + window.navigator.standalone)) { + schedule = function(fn) { + var div = document.createElement("div"); + var observer = new MutationObserver(fn); + observer.observe(div, {attributes: true}); + return function() { div.classList.toggle("foo"); }; + }; + schedule.isStatic = true; +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; + +},{"./util":36}],30:[function(_dereq_,module,exports){ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = _dereq_("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; + +},{"./util":36}],31:[function(_dereq_,module,exports){ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = _dereq_("./util"); +var RangeError = _dereq_("./errors").RangeError; +var AggregateError = _dereq_("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; + +},{"./errors":12,"./util":36}],32:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = +Promise.prototype._isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype.isCancelled = function() { + return this._target()._isCancelled(); +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + return hasProp.call(obj, "_promise0"); +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; + +},{"./util":36}],34:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = _dereq_("./util"); +var TimeoutError = Promise.TimeoutError; + +var afterTimeout = function (promise, message, parent) { + if (!promise.isPending()) return; + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + parent.cancel(); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + } else { + ret = new Promise(INTERNAL); + setTimeout(function() { ret._fulfill(); }, +ms); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +function successClear(value) { + var handle = this; + if (handle instanceof Number) handle = +handle; + clearTimeout(handle); + return value; +} + +function failureClear(reason) { + var handle = this; + if (handle instanceof Number) handle = +handle; + clearTimeout(handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var parent = this.then(); + var ret = parent.then(); + var handle = setTimeout(function timeoutTimeout() { + afterTimeout(ret, message, parent); + }, ms); + return ret._then(successClear, failureClear, undefined, handle, undefined); +}; + +}; + +},{"./util":36}],35:[function(_dereq_,module,exports){ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = _dereq_("./util"); + var TypeError = _dereq_("./errors").TypeError; + var inherits = _dereq_("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return null; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== null + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; + +},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){ +"use strict"; +var es5 = _dereq_("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return obj instanceof Error && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +function env(key, def) { + return isNode ? process.env[key] : def; +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + env: env +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; + +},{"./es5":13}]},{},[4])(4) +}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/browser/bluebird.min.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/browser/bluebird.min.js new file mode 100644 index 00000000..7f99a654 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/browser/bluebird.min.js @@ -0,0 +1,31 @@ +/* @preserve + * The MIT License (MIT) + * + * Copyright (c) 2013-2015 Petka Antonov + * + * 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. + * + */ +/** + * bluebird build version 3.0.6 + * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, using, timers, filter, any, each +*/ +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function r(t,e,n){function i(s,a){if(!e[s]){if(!t[s]){var c="function"==typeof _dereq_&&_dereq_;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=e[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,r,t,e,n)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),r=t.shift();e.call(n,r)}else e._settlePromises()}},n.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},n.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},n.prototype._reset=function(){this._isTickUsed=!1},e.exports=n,e.exports.firstLineError=s},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e){"use strict";e.exports=function(t,e,n,r){var i=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},c=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction());var l=n(o),u=new t(e);u._propagateFrom(this,1);var p=this._target();if(u._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l};p._then(e,s,void 0,u,h),l._then(a,c,void 0,u,h),u._setOnCancel(l)}else u._resolveCallback(p);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e){"use strict";function n(){try{Promise===i&&(Promise=r)}catch(t){}return i}var r;"undefined"!=typeof Promise&&(r=Promise);var i=t("./promise")();i.noConflict=n,e.exports=i},{"./promise":22}],5:[function(t,e){"use strict";var n=Object.create;if(n){var r=n(null),i=n(null);r[" size"]=i[" size"]=0}e.exports=function(e){function n(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var i="Object "+a.classString(t)+" has no method '"+a.toString(n)+"'";throw new e.TypeError(i)}return r}function r(t){var e=this.pop(),r=n(t,e);return r.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util"),c=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(r,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,n="number"==typeof t;if(n)e=o;else if(c){var r=s(t);e=null!==r?r:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e){"use strict";e.exports=function(e,n,r,i){var o=t("./util"),s=o.tryCatch,a=o.errorObj,c=e._async;e.prototype["break"]=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t.isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n.isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this.isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0?o[t]:void 0}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=n,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,c=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=c,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,e){"use strict";e.exports=function(e,n){function r(t,e,n){var r=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+H.toString(t));r._attachCancellationCallback(t)})}catch(i){return i}}function i(t){if(!this.isCancellable())return this;var e=this._onCancel();void 0!==e?H.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function o(){return this._onCancelField}function s(t){this._onCancelField=t}function a(){this._cancellationParent=void 0,this._onCancelField=void 0}function c(t,e){if(0!==(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function l(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function u(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function p(){this._trace=new P(this._peekContext())}function h(t,e){if(I(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var r=w(t);H.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),H.notEnumerableProp(t,"__stackCleaned__",!0)}}}function f(t,e,n,r){if(void 0===t&&null!==e&&Y.longStackTraces&&Y.warnings){var i="a promise was created in a "+n+" handler but was not returned from it";r._warn(i,!0,e)}}function _(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),d(n)}function d(t,n,r){if(Y.warnings){var i,o=new V(t);if(n)r._attachExtraTrace(o);else if(Y.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o);else{var s=w(o);o.stack=s.message+"\n"+s.stack.join("\n")}C(o,"",!0)}}function v(t,e){for(var n=0;n=0;--a)if(r[a]===o){s=a;break}for(var a=s;a>=0;--a){var c=r[a];if(e[i]!==c)break;e.pop(),i--}e=r}}function m(t){for(var e=[],n=0;n0&&(e=e.slice(n)),e}function w(t){var e=t.stack,n=t.toString();return e="string"==typeof e&&e.length>0?b(t):[" (No stack trace)"],{message:n,stack:m(e)}}function C(t,e,n){if("undefined"!=typeof console){var r;if(H.isObject(t)){var i=t.stack;r=e+U(i,t)}else r=e+String(t);"function"==typeof O?O(r,n):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}}function j(t,e,n,r){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(o){D.throwLater(o)}var s=!1;try{s=J(t,n,r)}catch(o){s=!0,D.throwLater(o)}var a=!1;if(W)try{a=W(t.toLowerCase(),{reason:n,promise:r})}catch(o){a=!0,D.throwLater(o)}s||i||a||"unhandledRejection"!==t||C(n,"Unhandled rejection ")}function k(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():H.toString(t);var n=/\[object [a-zA-Z0-9$_]+\]/;if(n.test(e))try{var r=JSON.stringify(t);e=r}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+F(e)+">, no stack trace)"}function F(t){var e=41;return t.lengths||0>a||!n||!r||n!==r||s>=a||(X=function(t){if(L.test(t))return!0;var e=x(t);return e&&e.fileName===n&&s<=e.line&&e.line<=a?!0:!1})}}function P(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);K(this,P),e>32&&this.uncycle()}var R,S,O,A=e._getDomain,D=e._async,V=t("./errors").Warning,H=t("./util"),I=H.canAttachTrace,L=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,N=null,U=null,M=!1,B=!(0==H.env("BLUEBIRD_DEBUG")||!H.env("BLUEBIRD_DEBUG")&&"development"!==H.env("NODE_ENV")),q=!(0==H.env("BLUEBIRD_WARNINGS")||!B&&!H.env("BLUEBIRD_WARNINGS")),Q=!(0==H.env("BLUEBIRD_LONG_STACK_TRACES")||!B&&!H.env("BLUEBIRD_LONG_STACK_TRACES"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|2097152},e.prototype._ensurePossibleRejectionHandled=function(){0===(2097152&this._bitField)&&(this._setRejectionIsUnhandled(),D.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){j("rejectionHandled",R,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),j("unhandledRejection",S,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return d(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=A();S="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=A();R="function"==typeof t?null===e?t:e.bind(t):void 0};var $=function(){};e.longStackTraces=function(){if(D.haveItemsQueued()&&!Y.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Y.longStackTraces&&E()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace;Y.longStackTraces=!0,$=function(){if(D.haveItemsQueued()&&!Y.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),D.enableTrampoline(),Y.longStackTraces=!1},e.prototype._captureStackTrace=p,e.prototype._attachExtraTrace=h,n.activateLongStackTraces(),D.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return Y.longStackTraces&&E()},e.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&$()),"warnings"in t&&(Y.warnings=!!t.warnings),"cancellation"in t&&t.cancellation&&!Y.cancellation){if(D.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=a,e.prototype._propagateFrom=c,e.prototype._onCancel=o,e.prototype._setOnCancel=s,e.prototype._attachCancellationCallback=i,e.prototype._execute=r,z=c,Y.cancellation=!0}},e.prototype._execute=function(t,e,n){try{t(e,n)}catch(r){return r}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(){},e.prototype._attachCancellationCallback=function(){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(){};var z=l,X=function(){return!1},G=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;H.inherits(P,Error),n.CapturedTrace=P,P.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent;t=this._length=r;for(var r=t-1;r>=0;--r){var o=e[r].stack;void 0===n[o]&&(n[o]=r)}for(var r=0;t>r;++r){var s=e[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1;var c=r>0?e[r-1]:this;t-1>a?(c._parent=e[a+1],c._parent.uncycle(),c._length=c._parent._length+1):(c._parent=void 0,c._length=1);for(var l=c._length+1,u=r-2;u>=0;--u)e[u]._length=l,l++;return}}}},P.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=w(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(m(i.stack.split("\n"))),i=i._parent;g(r),y(r),H.notEnumerableProp(t,"stack",v(n,r)),H.notEnumerableProp(t,"__stackCleaned__",!0)}};var W,K=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():k(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,N=t,U=e;var n=Error.captureStackTrace;return X=function(t){return L.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return N=/@/,U=e,M=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(U=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?k(e):e.toString()},null):(N=t,U=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]),J=function(){if(H.isNode)return function(t,e,n){return"rejectionHandled"===t?process.emit(t,n):process.emit(t,e,n)};var t=!1,e=!0;try{var n=new self.CustomEvent("test");t=n instanceof CustomEvent}catch(r){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(r){e=!1}e&&(W=function(e,n){var r;return t?r=new self.CustomEvent(e,{detail:n,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!1,!0,n)),r?!self.dispatchEvent(r):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,n){var r=o[t],i=self[r];return i?("rejectionHandled"===t?i.call(self,n):i.call(self,e,n),!0):!1}}();"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(O=function(t){console.warn(t)},H.isNode&&process.stderr.isTTY?O=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:H.isNode||"string"!=typeof(new Error).stack||(O=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var Y={warnings:q,longStackTraces:!1,cancellation:!1};return Q&&e.longStackTraces(),{longStackTraces:function(){return Y.longStackTraces},warnings:function(){return Y.warnings},cancellation:function(){return Y.cancellation},propagateFromFunction:function(){return z},boundValueFunction:function(){return u},checkForgottenReturns:f,setBounds:T,warn:d,deprecated:_,CapturedTrace:P}}},{"./errors":12,"./util":36}],10:[function(t,e){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype["return"]=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1],r=function(){throw e};return this.caught(t,r)},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var r=arguments[1];r instanceof t&&r.suppressUnhandledRejections();var i=function(){return r};return this.caught(n,i)}}},{}],11:[function(t,e){"use strict";e.exports=function(t,e){function n(){return o(this)}function r(t,n){return i(t,n,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return this.mapSeries(t)._then(n,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,e){return r(t,e)._then(n,void 0,void 0,t,void 0)},t.mapSeries=r}},{}],12:[function(t,e){"use strict";function n(t,e){function n(r){return this instanceof n?(u(this,"message","string"==typeof r?r:e),u(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new n(r)}return l(n,Error),n}function r(t){return this instanceof r?(u(this,"name","OperationalError"),u(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(u(this,"message",t.message),u(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new r(t)}var i,o,s=t("./es5"),a=s.freeze,c=t("./util"),l=c.inherits,u=c.notEnumerableProp,p=n("Warning","warning"),h=n("CancellationError","cancellation error"),f=n("TimeoutError","timeout error"),_=n("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(d){i=n("TypeError","type error"),o=n("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0):!1}function o(){return a.call(this,this.promise._target()._settledValue())}function s(t){return i(this,t)?void 0:(u.e=t,u)}function a(t){var a=this.promise,c=this.handler;if(!this.called){this.called=!0;var p=0===this.type?c.call(a._boundValue()):c.call(a._boundValue(),t);if(void 0!==p){var h=n(p,a);if(h instanceof e){if(null!=this.cancelPromise){if(h.isCancelled()){var f=new l("late cancellation observer");return a._attachExtraTrace(f),u.e=f,u}h.isPending()&&h._attachCancellationCallback(new r(this))}return h._then(o,s,void 0,this,void 0)}}}return a.isRejected()?(i(this),u.e=t,u):(i(this),t)}var c=t("./util"),l=e.CancellationError,u=c.errorObj;return r.prototype._resultCancelled=function(){i(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,{promise:this,handler:t,called:!1,cancelPromise:null,type:e},void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThrough(t,0,a,a)},e.prototype.tap=function(t){return this._passThrough(t,1,a)},a}},{"./util":36}],16:[function(t,e){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var r}var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,e,n,r){this.constructor$(t),this._promise._captureStackTrace();var i=l();this._callback=null===i?e:i.bind(e),this._preservedValues=r===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:f,this._init$(void 0,-2)}function c(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+u.classString(e));var o="object"==typeof n&&null!==n?n.concurrency:0;return o="number"==typeof o&&isFinite(o)&&o>=1?o:0,new a(t,e,o,i).promise()}var l=e._getDomain,u=t("./util"),p=u.tryCatch,h=u.errorObj,f=[];u.inherits(a,n),a.prototype._init=function(){},a.prototype._promiseFulfilled=function(t,n){var r=this._values,o=this.length(),a=this._preservedValues,c=this._limit;if(0>n){if(n=-1*n-1,r[n]=t,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return r[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var l=this._promise,u=this._callback,f=l._boundValue();l._pushContext();var _=p(u).call(f,t,n,o),d=l._popContext();if(s.checkForgottenReturns(_,d,null!==a?"Promise.filter":"Promise.map",l),_===h)return this._reject(_.e),!0;var v=i(_,this._promise);if(v instanceof e){v=v._target();var y=v._bitField;if(0===(50397184&y))return c>=1&&this._inFlight++,r[n]=v,v._proxy(this,-1*(n+1)),!1;if(0===(33554432&y))return 0!==(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);_=v._value()}r[n]=_}var g=++this._totalResolved;return g>=o?(null!==a?this._filter(r,a):this._resolve(r),!0):!1},a.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(r[i++]=e[o]);r.length=i,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return c(this,t,e,null)},e.map=function(t,e,n,r){return c(t,e,n,r)}}},{"./util":36}],19:[function(t,e){"use strict";e.exports=function(e,n,r,i,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var r=new e(n);r._captureStackTrace(),r._pushContext();var i=a(t).apply(this,arguments),s=r._popContext();return o.checkForgottenReturns(i,s,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e["try"]=function(t){if("function"!=typeof t)return i("expecting a function but got "+s.classString(t));var r=new e(n);r._captureStackTrace(),r._pushContext();var c;if(arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],u=arguments[2];c=s.isArray(l)?a(t).apply(u,l):a(t).call(u,l)}else c=a(t)();var p=r._popContext();return o.checkForgottenReturns(c,p,"Promise.try",r),r._resolveFromSyncValue(c),r},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e){"use strict";function n(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function r(t){var e;if(n(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=l.keys(t),i=0;i1){var n,r=new Array(e-1),i=0;for(n=0;e-1>n;++n){var o=arguments[n];if(!h.isObject(o))return u("expecting an object but got "+h.classString(o));r[i++]=o}return r.length=i,t=arguments[n],this.then(void 0,T(r,t,this))}return this.then(void 0,t)},r.prototype.reflect=function(){return this._then(l,l,void 0,this,void 0)},r.prototype.then=function(t,e){if(E.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+h.classString(t);arguments.length>1&&(n+=", "+h.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},r.prototype.done=function(t,e){var n=this._then(t,e,void 0,void 0,void 0);n._setIsFinal()},r.prototype.spread=function(t){return"function"!=typeof t?u("expecting a function but got "+h.classString(t)):this.all()._then(t,void 0,void 0,b,void 0)},r.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},r.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new j(this).promise()},r.prototype.error=function(t){return this.caught(h.originatesFromRejection,t)},r.is=function(t){return t instanceof r},r.fromNode=r.fromCallback=function(t){var e=new r(m),n=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,i=S(t)(P(e,n));return i===R&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},r.all=function(t){return new j(t).promise()},r.cast=function(t){var e=C(t);return e instanceof r||(e=new r(m),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},r.resolve=r.fulfilled=r.cast,r.reject=r.rejected=function(t){var e=new r(m);return e._captureStackTrace(),e._rejectCallback(t,!0),e},r.setScheduler=function(t){if("function"!=typeof t)throw new y("expecting a function but got "+h.classString(t));var e=d._schedule;return d._schedule=t,e},r.prototype._then=function(t,e,n,i,o){var s=void 0!==o,c=s?o:new r(m),l=this._target(),u=l._bitField;s||(c._propagateFrom(this,3),c._captureStackTrace(),void 0===i&&0!==(2097152&this._bitField)&&(i=0!==(50397184&u)?this._boundValue():l===this?void 0:this._boundTo));var p=a();if(0!==(50397184&u)){var h,f,_=l._settlePromiseCtx;0!==(33554432&u)?(f=l._rejectionHandler0,h=t):0!==(16777216&u)?(f=l._fulfillmentHandler0,h=e,l._unsetRejectionIsUnhandled()):(_=l._settlePromiseLateCancellationObserver,f=new g("late cancellation observer"),l._attachExtraTrace(f),h=e),d.invoke(_,l,{handler:null===p?h:"function"==typeof h&&p.bind(h),promise:c,receiver:i,value:f})}else l._addCallbacks(t,e,c,i,p);return c},r.prototype._length=function(){return 65535&this._bitField},r.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},r.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},r.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},r.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField},r.prototype._setRejected=function(){this._bitField=16777216|this._bitField},r.prototype._setFollowing=function(){this._bitField=67108864|this._bitField},r.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},r.prototype._isFinal=function(){return(4194304&this._bitField)>0},r.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},r.prototype._setCancelled=function(){this._bitField=65536|this._bitField},r.prototype._setAsyncGuaranteed=function(){this._bitField=134217728|this._bitField},r.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];return e===p?void 0:void 0===e&&this._isBound()?this._boundValue():e},r.prototype._promiseAt=function(t){return this[4*t-4+2]},r.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},r.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},r.prototype._boundValue=function(){},r.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0);void 0===i&&(i=p),this._addCallbacks(e,n,r,i,null)},r.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=p),this._addCallbacks(n,r,i,o,null)},r.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:i.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:i.bind(e));else{var s=4*o-4;this[s+2]=n,this[s+3]=r,"function"==typeof t&&(this[s+0]=null===i?t:i.bind(t)),"function"==typeof e&&(this[s+1]=null===i?e:i.bind(e))}return this._setLength(o+1),o},r.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},r.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(c(),!1);var n=C(t,this);if(!(n instanceof r))return this._fulfill(t);e&&this._propagateFrom(n,2);var i=n._target(),o=i._bitField;if(0===(50397184&o)){var s=this._length();s>0&&i._migrateCallback0(this);for(var a=1;s>a;++a)i._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(i)}else if(0!==(33554432&o))this._fulfill(i._value());else if(0!==(16777216&o))this._reject(i._reason());else{var l=new g("late cancellation observer");i._attachExtraTrace(l),this._reject(l)}}},r.prototype._rejectCallback=function(t,e,n){var r=h.ensureErrorObject(t),i=r===t;if(!i&&!n&&E.warnings()){var o="a promise was rejected with a non-error: "+h.classString(t);this._warn(o,!0)}this._attachExtraTrace(r,e?i:!1),this._reject(t)},r.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==r&&e._rejectCallback(r,!0)},r.prototype._settlePromiseFromHandler=function(t,e,n,r){var i=r._bitField;if(0===(65536&i)){r._pushContext();var o;e===b?n&&"number"==typeof n.length?o=S(t).apply(this._boundValue(),n):(o=R,o.e=new y("cannot .spread() a non-array: "+h.classString(n))):o=S(t).call(e,n);var s=r._popContext();if(i=r._bitField,0===(65536&i))if(o===w)r._reject(n);else if(o===R||o===r){var a=o===r?c():o.e;r._rejectCallback(a,!1)}else E.checkForgottenReturns(o,s,"",r),r._resolveCallback(o)}},r.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},r.prototype._followee=function(){return this._rejectionHandler0},r.prototype._setFollowee=function(t){this._rejectionHandler0=t},r.prototype._settlePromise=function(t,n,i,o){var s=t instanceof r,a=this._bitField,c=0!==(134217728&a);0!==(65536&a)?(s&&t._invokeInternalOnCancel(),n===x?(i.cancelPromise=t,S(n).call(i,o)===R&&t._reject(R.e)):n===l?t._fulfill(l.call(i)):i instanceof e?i._promiseCancelled(t):s||t instanceof j?t._cancel():i.cancel()):"function"==typeof n?s?(c&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(n,i,o,t)):n.call(i,o,t):i instanceof e?i._isResolved()||(0!==(33554432&a)?i._promiseFulfilled(o,t):i._promiseRejected(o,t)):s&&(c&&t._setAsyncGuaranteed(),0!==(33554432&a)?t._fulfill(o):t._reject(o))},r.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,i=t.receiver,o=t.value;"function"==typeof e?n instanceof r?this._settlePromiseFromHandler(e,i,o,n):e.call(i,o,n):n instanceof r&&n._reject(o)},r.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},r.prototype._settlePromise0=function(t,e){var n=this._promise0,r=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(n,t,r,e)},r.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},r.prototype._fulfill=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(t===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():d.settlePromises(this))}},r.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?d.fatalError(t,h.isNode):void((65535&e)>0?0!==(134217728&e)?this._settlePromises():d.settlePromises(this):this._ensurePossibleRejectionHandled())},r.prototype._fulfillPromises=function(t,e){for(var n=1;t>n;n++){var r=this._fulfillmentHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._rejectPromises=function(t,e){for(var n=1;t>n;n++){var r=this._rejectionHandlerAt(n),i=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(i,r,o,e)}},r.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!==(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()},r.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},r.defer=r.pending=function(){E.deprecated("Promise.defer","new Promise");var t=new r(m);return{promise:t,resolve:i,reject:o}},h.notEnumerableProp(r,"_makeSelfResolutionError",c),t("./method")(r,m,C,u,E),t("./bind")(r,m,C,E),t("./cancel")(r,j,u,E),t("./direct_resolve")(r),t("./synchronous_inspection")(r),t("./join")(r,j,C,m,E),r.Promise=r,t("./map.js")(r,j,u,C,m,E),t("./using.js")(r,u,C,F,m,E),t("./timers.js")(r,m),t("./generators.js")(r,u,m,C,e,E),t("./nodeify.js")(r),t("./call_get.js")(r),t("./props.js")(r,j,C,u),t("./race.js")(r,m,C,u),t("./reduce.js")(r,j,u,C,m,E),t("./settle.js")(r,j,E),t("./some.js")(r,j,u),t("./promisify.js")(r,m),t("./any.js")(r),t("./each.js")(r,m),t("./filter.js")(r,m),h.toFastProperties(r),h.toFastProperties(r.prototype),s({a:1}),s({b:2}),s({c:3}),s(1),s(function(){}),s(void 0),s(!1),s(new r(m)),E.setBounds(_.firstLineError,h.lastLineError),r}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e){"use strict";e.exports=function(e,n,r,i,o){function s(t){switch(t){case-2:return[];case-3:return{}}}function a(t){var r=this._promise=new e(n);t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}{var c=t("./util");c.isArray}return c.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function l(t,n){var o=r(this._values,this._promise);if(o instanceof e){o=o._target();var a=o._bitField;if(this._values=o,0===(50397184&a))return this._promise._setAsyncGuaranteed(),o._then(l,this._reject,void 0,this,n);if(0===(33554432&a))return 0!==(16777216&a)?this._reject(o._reason()):this._cancel();o=o._value()}if(o=c.asArray(o),null===o){var u=i("expecting an array or an iterable object but got "+c.classString(o)).reason();return void this._promise._rejectCallback(u,!1)}return 0===o.length?void(-5===n?this._resolveEmptyArray():this._resolve(s(n))):void this._iterate(o)},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var i=this._promise,o=!1,s=null,a=0;n>a;++a){var c=r(t[a],i);c instanceof e?(c=c._target(),s=c._bitField):s=null,o?null!==s&&c.suppressUnhandledRejections():null!==s?0===(50397184&s)?(c._proxy(this,a),this._values[a]=c):o=0!==(33554432&s)?this._promiseFulfilled(c._value(),a):0!==(16777216&s)?this._promiseRejected(c._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(c,a)}o||i._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise.isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;nc;c+=2){var u=s[c],p=s[c+1],_=u+e;if(r===F)t[_]=F(u,h,u,p,e,i);else{var d=r(p,function(){return F(u,h,u,p,e,i)});f.notEnumerableProp(d,"__isPromisified__",!0),t[_]=d}}return f.toFastProperties(t),t}function u(t,e,n){return F(t,e,void 0,t,null,n)}var p,h={},f=t("./util"),_=t("./nodeback"),d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",b={__isPromisified__:!0},w=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],C=new RegExp("^(?:"+w.join("|")+")$"),j=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},k=function(t){return t.replace(/([$])/,"\\$")},F=y?p:c;e.promisify=function(t,e){if("function"!=typeof t)throw new g("expecting a function but got "+f.classString(t));if(i(t))return t;e=Object(e);var n=void 0===e.context?h:e.context,o=!!e.multiArgs,s=u(t,n,o);return f.copyDescriptors(t,s,r),s},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");e=Object(e);var n=!!e.multiArgs,r=e.suffix;"string"!=typeof r&&(r=m);var i=e.filter;"function"!=typeof i&&(i=j);var o=e.promisifier;if("function"!=typeof o&&(o=F),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var s=f.inheritedDataKeys(t),a=0;ao;++o){var s=r[o];e[o]=t[s],e[o+i]=s}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function s(t){var n,s=r(t);return l(s)?(n=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&n._propagateFrom(s,2),n):i("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}var a,c=t("./util"),l=c.isObject,u=t("./es5");"function"==typeof Map&&(a=Map);var p=function(){function t(t,r){this[e]=t,this[e+n]=r,e++}var e=0,n=0;return function(r){n=r.size,e=0;var i=new Array(2*r.size);return r.forEach(t,i),i}}(),h=function(t){for(var e=new a,n=t.length/2|0,r=0;n>r;++r){var i=t[n+r],o=t[r];e.set(i,o)}return e};c.inherits(o,n),o.prototype._init=function(){},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var n=++this._totalResolved;if(n>=this._length){var r;if(this._isMap)r=h(this._values);else{r={};for(var i=this.length(),o=0,s=this.length();s>o;++o)r[this._values[o+i]]=this._values[o]}return this._resolve(r),!0}return!1},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5":13,"./util":36}],26:[function(t,e){"use strict";function n(t,e,n,r,i){for(var o=0;i>o;++o)n[o+r]=t[o+e],t[o+e]=void 0}function r(t){this._capacity=t,this._length=0,this._front=0}r.prototype._willBeOverCapacity=function(t){return this._capacityh;++h){var _=t[h];(void 0!==_||h in t)&&e.cast(_)._then(u,p,void 0,l,null)}return l}var s=t("./util"),a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util":36}],28:[function(t,e){"use strict";e.exports=function(e,n,r,i,o,s){function a(t,n,r,i){this.constructor$(t);var s=h();this._fn=null===s?n:s.bind(n),void 0!==r&&(r=e.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=i===o?[]:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function c(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function l(t,e,n,i){if("function"!=typeof e)return r("expecting a function but got "+f.classString(e));var o=new a(t,e,n,i);return o.promise()}function u(t){this.accum=t,this.array._gotAccum(t);var n=i(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(p,void 0,void 0,this,void 0)):p.call(this,n)}function p(t){var n=this.array,r=n._promise,i=_(n._fn);r._pushContext();var o;o=void 0!==n._eachValues?i.call(r._boundValue(),t,this.index,this.length):i.call(r._boundValue(),this.accum,t,this.index,this.length),o instanceof e&&(n._currentCancellable=o);var a=r._popContext();return s.checkForgottenReturns(o,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),o}var h=e._getDomain,f=t("./util"),_=f.tryCatch;f.inherits(a,n),a.prototype._gotAccum=function(t){void 0!==this._eachValues&&t!==o&&this._eachValues.push(t)},a.prototype._eachComplete=function(t){return this._eachValues.push(t),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},a.prototype._resultCancelled=function(t){return t===this._initialValue?this._cancel():void(this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel()))},a.prototype._iterate=function(t){this._values=t;var n,r,i=t.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=e.resolve(t[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;i>r;++r){var o={accum:null,value:t[r],index:r,length:i,array:this};n=n._then(u,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(c,c,void 0,n,this)},e.prototype.reduce=function(t,e){return l(this,t,e,null)},e.reduce=function(t,e,n,r){return l(t,e,n,r)}}},{"./util":36}],29:[function(t,e){"use strict";var n,r=t("./util"),i=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")};if(r.isNode&&"undefined"==typeof MutationObserver){var o=global.setImmediate,s=process.nextTick;n=r.isRecentNode?function(t){o.call(global,t)}:function(t){s.call(process,t)}}else"undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?n="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:i:(n=function(t){var e=document.createElement("div"),n=new MutationObserver(t);return n.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},n.isStatic=!0);e.exports=n},{"./util":36}],30:[function(t,e){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t)}var o=e.PromiseInspection,s=t("./util");s.inherits(i,n),i.prototype._promiseResolved=function(t,e){this._values[t]=e;var n=++this._totalResolved;return n>=this._length?(this._resolve(this._values),!0):!1},i.prototype._promiseFulfilled=function(t,e){var n=new o;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},i.prototype._promiseRejected=function(t,e){var n=new o;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return r.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e){"use strict";e.exports=function(e,n,r){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return r("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new i(t),o=n.promise();return n.setHowMany(e),n.init(),o}var s=t("./util"),a=t("./errors").RangeError,c=t("./errors").AggregateError,l=s.isArray,u={};s.inherits(i,n),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=l(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values),!0):!1},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new c,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=t.prototype._isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype.isCancelled=function(){return this._target()._isCancelled()},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),r.call(t)},t.prototype._value=function(){return this._settledValue() +},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e){"use strict";e.exports=function(e,n){function r(t,r){if(u(t)){if(t instanceof e)return t;var i=o(t);if(i===l){r&&r._pushContext();var c=e.reject(i.e);return r&&r._popContext(),c}if("function"==typeof i){if(s(t)){var c=new e(n);return t._then(c._fulfill,c._reject,void 0,c,null),c}return a(t,i,r)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(e){return l.e=e,l}}function s(t){return p.call(t,"_promise0")}function a(t,r,i){function o(t){a&&(a._resolveCallback(t),a=null)}function s(t){a&&(a._rejectCallback(t,p,!0),a=null)}var a=new e(n),u=a;i&&i._pushContext(),a._captureStackTrace(),i&&i._popContext();var p=!0,h=c.tryCatch(r).call(t,o,s);return p=!1,a&&h===l&&(a._rejectCallback(h.e,!0,!0),a=null),u}var c=t("./util"),l=c.errorObj,u=c.isObject,p={}.hasOwnProperty;return r}},{"./util":36}],34:[function(t,e){"use strict";e.exports=function(e,n){function r(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util"),s=e.TimeoutError,a=function(t,e,n){if(t.isPending()){var r;r="string"!=typeof e?e instanceof Error?e:new s("operation timed out"):new s(e),o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._reject(r),n.cancel()}},c=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,r){var i;return void 0!==r?i=e.resolve(r)._then(c,null,null,t,void 0):(i=new e(n),setTimeout(function(){i._fulfill()},+t)),i._setAsyncGuaranteed(),i};e.prototype.delay=function(t){return l(t,this)},e.prototype.timeout=function(t,e){t=+t;var n=this.then(),o=n.then(),s=setTimeout(function(){a(o,e,n)},t);return o._then(r,i,void 0,s,void 0)}}},{"./util":36}],35:[function(t,e){"use strict";e.exports=function(e,n,r,i,o,s){function a(t){setTimeout(function(){throw t},0)}function c(t){var e=r(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function l(t,n){function i(){if(s>=l)return u._fulfill();var o=c(t[s++]);if(o instanceof e&&o._isDisposable()){try{o=r(o._getDisposer().tryDispose(n),t.promise)}catch(p){return a(p)}if(o instanceof e)return o._then(i,a,null,null,null)}i()}var s=0,l=t.length,u=new e(o);return i(),u}function u(t,e,n){this._data=t,this._promise=e,this._context=n}function p(t,e,n){this.constructor$(t,e,n)}function h(t){return u.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function f(t){this.length=t,this.promise=null,this[t-1]=null}var _=t("./util"),d=t("./errors").TypeError,v=t("./util").inherits,y=_.errorObj,g=_.tryCatch;u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},u.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=null!==e?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(p,u),p.prototype.doDispose=function(t,e){var n=this.data();return n.call(t,t,e)},f.prototype._resultCancelled=function(){for(var t=this.length,n=0;t>n;++n){var r=this[n];r instanceof e&&r.cancel()}},e.using=function(){var t=arguments.length;if(2>t)return n("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return n("expecting a function but got "+_.classString(i));var o,a=!0;2===t&&Array.isArray(arguments[0])?(o=arguments[0],t=o.length,a=!1):(o=arguments,t--);for(var c=new f(t),p=0;t>p;++p){var d=o[p];if(u.isDisposer(d)){var v=d;d=d.promise(),d._setDisposable(v)}else{var m=r(d);m instanceof e&&(d=m._then(h,null,null,{resources:c,index:p},void 0))}c[p]=d}for(var b=new Array(c.length),p=0;p0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new d}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";function r(){try{var t=E;return E=null,t.apply(this,arguments)}catch(e){return F.e=e,F}}function i(t){return E=t,r}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return"function"==typeof t||"object"==typeof t&&null!==t}function a(t){return o(t)?new Error(v(t)):t}function c(t,e){var n,r=t.length,i=new Array(r+1);for(n=0;r>n;++n)i[n]=t[n];return i[n]=e,i}function l(t,e,n){if(!j.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(t,e,n){if(o(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return j.defineProperty(t,e,r),t}function p(t){throw t}function h(t){try{if("function"==typeof t){var e=j.names(t.prototype),n=j.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=P.test(t+"")&&j.names(t).length>0;if(n||r||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}function _(t){return R.test(t)}function d(t,e,n){for(var r=new Array(t),i=0;t>i;++i)r[i]=e+i+n;return r}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{u(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&j.propertyIsWritable(t,"stack")}function b(t){return{}.toString.call(t)}function w(t,e,n){for(var r=j.names(t),i=0;i10||t[0]>0}(),V.isNode&&V.toFastProperties(process);try{throw new Error}catch(H){V.lastLineError=H}e.exports=V},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/any.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/any.js new file mode 100644 index 00000000..05a6228e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/any.js @@ -0,0 +1,21 @@ +"use strict"; +module.exports = function(Promise) { +var SomePromiseArray = Promise._SomePromiseArray; +function any(promises) { + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(1); + ret.setUnwrap(); + ret.init(); + return promise; +} + +Promise.any = function (promises) { + return any(promises); +}; + +Promise.prototype.any = function () { + return any(this); +}; + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/assert.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/assert.js new file mode 100644 index 00000000..d2e535b2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/assert.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = (function(){ +var AssertionError = (function() { + function AssertionError(a) { + this.constructor$(a); + this.message = a; + this.name = "AssertionError"; + } + AssertionError.prototype = new Error(); + AssertionError.prototype.constructor = AssertionError; + AssertionError.prototype.constructor$ = Error; + return AssertionError; +})(); + +function getParams(args) { + var params = []; + for (var i = 0; i < args.length; ++i) params.push("arg" + i); + return params; +} + +function nativeAssert(callName, args, expect) { + try { + var params = getParams(args); + var constructorArgs = params; + constructorArgs.push("return " + + callName + "("+ params.join(",") + ");"); + var fn = Function.apply(null, constructorArgs); + return fn.apply(null, args); + } catch (e) { + if (!(e instanceof SyntaxError)) { + throw e; + } else { + return expect; + } + } +} + +return function assert(boolExpr, message) { + if (boolExpr === true) return; + + if (typeof boolExpr === "string" && + boolExpr.charAt(0) === "%") { + var nativeCallName = boolExpr; + var $_len = arguments.length;var args = new Array($_len - 2); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];}; + if (nativeAssert(nativeCallName, args, message) === message) return; + message = (nativeCallName + " !== " + message); + } + + var ret = new AssertionError(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(ret, assert); + } + throw ret; +}; +})(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/async.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/async.js new file mode 100644 index 00000000..edfb3bab --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/async.js @@ -0,0 +1,157 @@ +"use strict"; +var firstLineError; +try {throw new Error(); } catch (e) {firstLineError = e;} +var schedule = require("./schedule"); +var Queue = require("./queue"); +var util = require("./util"); + +function Async() { + this._isTickUsed = false; + this._lateQueue = new Queue(16); + this._normalQueue = new Queue(16); + this._haveDrainedQueues = false; + this._trampolineEnabled = true; + var self = this; + this.drainQueues = function () { + self._drainQueues(); + }; + this._schedule = + schedule.isStatic ? schedule(this.drainQueues) : schedule; +} + +Async.prototype.enableTrampoline = function() { + this._trampolineEnabled = true; +}; + +Async.prototype.disableTrampolineIfNecessary = function() { + if (util.hasDevTools) { + this._trampolineEnabled = false; + } +}; + +Async.prototype.haveItemsQueued = function () { + return this._isTickUsed || this._haveDrainedQueues; +}; + + +Async.prototype.fatalError = function(e, isNode) { + if (isNode) { + process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e)); + process.exit(2); + } else { + this.throwLater(e); + } +}; + +Async.prototype.throwLater = function(fn, arg) { + if (arguments.length === 1) { + arg = fn; + fn = function () { throw arg; }; + } + if (typeof setTimeout !== "undefined") { + setTimeout(function() { + fn(arg); + }, 0); + } else try { + this._schedule(function() { + fn(arg); + }); + } catch (e) { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } +}; + +function AsyncInvokeLater(fn, receiver, arg) { + this._lateQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncInvoke(fn, receiver, arg) { + this._normalQueue.push(fn, receiver, arg); + this._queueTick(); +} + +function AsyncSettlePromises(promise) { + this._normalQueue._pushOne(promise); + this._queueTick(); +} + +if (!util.hasDevTools) { + Async.prototype.invokeLater = AsyncInvokeLater; + Async.prototype.invoke = AsyncInvoke; + Async.prototype.settlePromises = AsyncSettlePromises; +} else { + if (schedule.isStatic) { + schedule = function(fn) { setTimeout(fn, 0); }; + } + Async.prototype.invokeLater = function (fn, receiver, arg) { + if (this._trampolineEnabled) { + AsyncInvokeLater.call(this, fn, receiver, arg); + } else { + this._schedule(function() { + setTimeout(function() { + fn.call(receiver, arg); + }, 100); + }); + } + }; + + Async.prototype.invoke = function (fn, receiver, arg) { + if (this._trampolineEnabled) { + AsyncInvoke.call(this, fn, receiver, arg); + } else { + this._schedule(function() { + fn.call(receiver, arg); + }); + } + }; + + Async.prototype.settlePromises = function(promise) { + if (this._trampolineEnabled) { + AsyncSettlePromises.call(this, promise); + } else { + this._schedule(function() { + promise._settlePromises(); + }); + } + }; +} + +Async.prototype.invokeFirst = function (fn, receiver, arg) { + this._normalQueue.unshift(fn, receiver, arg); + this._queueTick(); +}; + +Async.prototype._drainQueue = function(queue) { + while (queue.length() > 0) { + var fn = queue.shift(); + if (typeof fn !== "function") { + fn._settlePromises(); + continue; + } + var receiver = queue.shift(); + var arg = queue.shift(); + fn.call(receiver, arg); + } +}; + +Async.prototype._drainQueues = function () { + this._drainQueue(this._normalQueue); + this._reset(); + this._haveDrainedQueues = true; + this._drainQueue(this._lateQueue); +}; + +Async.prototype._queueTick = function () { + if (!this._isTickUsed) { + this._isTickUsed = true; + this._schedule(this.drainQueues); + } +}; + +Async.prototype._reset = function () { + this._isTickUsed = false; +}; + +module.exports = Async; +module.exports.firstLineError = firstLineError; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/bind.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/bind.js new file mode 100644 index 00000000..fc3379db --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/bind.js @@ -0,0 +1,67 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) { +var calledBind = false; +var rejectThis = function(_, e) { + this._reject(e); +}; + +var targetRejected = function(e, context) { + context.promiseRejectionQueued = true; + context.bindingPromise._then(rejectThis, rejectThis, null, this, e); +}; + +var bindingResolved = function(thisArg, context) { + if (((this._bitField & 50397184) === 0)) { + this._resolveCallback(context.target); + } +}; + +var bindingRejected = function(e, context) { + if (!context.promiseRejectionQueued) this._reject(e); +}; + +Promise.prototype.bind = function (thisArg) { + if (!calledBind) { + calledBind = true; + Promise.prototype._propagateFrom = debug.propagateFromFunction(); + Promise.prototype._boundValue = debug.boundValueFunction(); + } + var maybePromise = tryConvertToPromise(thisArg); + var ret = new Promise(INTERNAL); + ret._propagateFrom(this, 1); + var target = this._target(); + ret._setBoundTo(maybePromise); + if (maybePromise instanceof Promise) { + var context = { + promiseRejectionQueued: false, + promise: ret, + target: target, + bindingPromise: maybePromise + }; + target._then(INTERNAL, targetRejected, undefined, ret, context); + maybePromise._then( + bindingResolved, bindingRejected, undefined, ret, context); + ret._setOnCancel(maybePromise); + } else { + ret._resolveCallback(target); + } + return ret; +}; + +Promise.prototype._setBoundTo = function (obj) { + if (obj !== undefined) { + this._bitField = this._bitField | 2097152; + this._boundTo = obj; + } else { + this._bitField = this._bitField & (~2097152); + } +}; + +Promise.prototype._isBound = function () { + return (this._bitField & 2097152) === 2097152; +}; + +Promise.bind = function (thisArg, value) { + return Promise.resolve(value).bind(thisArg); +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/bluebird.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/bluebird.js new file mode 100644 index 00000000..1c36cf36 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/bluebird.js @@ -0,0 +1,11 @@ +"use strict"; +var old; +if (typeof Promise !== "undefined") old = Promise; +function noConflict() { + try { if (Promise === bluebird) Promise = old; } + catch (e) {} + return bluebird; +} +var bluebird = require("./promise")(); +bluebird.noConflict = noConflict; +module.exports = bluebird; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/call_get.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/call_get.js new file mode 100644 index 00000000..e643aaa2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/call_get.js @@ -0,0 +1,123 @@ +"use strict"; +var cr = Object.create; +if (cr) { + var callerCache = cr(null); + var getterCache = cr(null); + callerCache[" size"] = getterCache[" size"] = 0; +} + +module.exports = function(Promise) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var isIdentifier = util.isIdentifier; + +var getMethodCaller; +var getGetter; +if (!false) { +var makeMethodCaller = function (methodName) { + return new Function("ensureMethod", " \n\ + return function(obj) { \n\ + 'use strict' \n\ + var len = this.length; \n\ + ensureMethod(obj, 'methodName'); \n\ + switch(len) { \n\ + case 1: return obj.methodName(this[0]); \n\ + case 2: return obj.methodName(this[0], this[1]); \n\ + case 3: return obj.methodName(this[0], this[1], this[2]); \n\ + case 0: return obj.methodName(); \n\ + default: \n\ + return obj.methodName.apply(obj, this); \n\ + } \n\ + }; \n\ + ".replace(/methodName/g, methodName))(ensureMethod); +}; + +var makeGetter = function (propertyName) { + return new Function("obj", " \n\ + 'use strict'; \n\ + return obj.propertyName; \n\ + ".replace("propertyName", propertyName)); +}; + +var getCompiled = function(name, compiler, cache) { + var ret = cache[name]; + if (typeof ret !== "function") { + if (!isIdentifier(name)) { + return null; + } + ret = compiler(name); + cache[name] = ret; + cache[" size"]++; + if (cache[" size"] > 512) { + var keys = Object.keys(cache); + for (var i = 0; i < 256; ++i) delete cache[keys[i]]; + cache[" size"] = keys.length - 256; + } + } + return ret; +}; + +getMethodCaller = function(name) { + return getCompiled(name, makeMethodCaller, callerCache); +}; + +getGetter = function(name) { + return getCompiled(name, makeGetter, getterCache); +}; +} + +function ensureMethod(obj, methodName) { + var fn; + if (obj != null) fn = obj[methodName]; + if (typeof fn !== "function") { + var message = "Object " + util.classString(obj) + " has no method '" + + util.toString(methodName) + "'"; + throw new Promise.TypeError(message); + } + return fn; +} + +function caller(obj) { + var methodName = this.pop(); + var fn = ensureMethod(obj, methodName); + return fn.apply(obj, this); +} +Promise.prototype.call = function (methodName) { + var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + if (!false) { + if (canEvaluate) { + var maybeCaller = getMethodCaller(methodName); + if (maybeCaller !== null) { + return this._then( + maybeCaller, undefined, undefined, args, undefined); + } + } + } + args.push(methodName); + return this._then(caller, undefined, undefined, args, undefined); +}; + +function namedGetter(obj) { + return obj[this]; +} +function indexedGetter(obj) { + var index = +this; + if (index < 0) index = Math.max(0, index + obj.length); + return obj[index]; +} +Promise.prototype.get = function (propertyName) { + var isIndex = (typeof propertyName === "number"); + var getter; + if (!isIndex) { + if (canEvaluate) { + var maybeGetter = getGetter(propertyName); + getter = maybeGetter !== null ? maybeGetter : namedGetter; + } else { + getter = namedGetter; + } + } else { + getter = indexedGetter; + } + return this._then(getter, undefined, undefined, propertyName, undefined); +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/cancel.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/cancel.js new file mode 100644 index 00000000..5ed6bc9c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/cancel.js @@ -0,0 +1,125 @@ +"use strict"; +module.exports = function(Promise, PromiseArray, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var async = Promise._async; + +Promise.prototype["break"] = Promise.prototype.cancel = function() { + if (!debug.cancellation()) return this._warn("cancellation is disabled"); + + var promise = this; + var child = promise; + while (promise.isCancellable()) { + if (!promise._cancelBy(child)) { + if (child._isFollowing()) { + child._followee().cancel(); + } else { + child._cancelBranched(); + } + break; + } + + var parent = promise._cancellationParent; + if (parent == null || !parent.isCancellable()) { + if (promise._isFollowing()) { + promise._followee().cancel(); + } else { + promise._cancelBranched(); + } + break; + } else { + if (promise._isFollowing()) promise._followee().cancel(); + child = promise; + promise = parent; + } + } +}; + +Promise.prototype._branchHasCancelled = function() { + this._branchesRemainingToCancel--; +}; + +Promise.prototype._enoughBranchesHaveCancelled = function() { + return this._branchesRemainingToCancel === undefined || + this._branchesRemainingToCancel <= 0; +}; + +Promise.prototype._cancelBy = function(canceller) { + if (canceller === this) { + this._branchesRemainingToCancel = 0; + this._invokeOnCancel(); + return true; + } else { + this._branchHasCancelled(); + if (this._enoughBranchesHaveCancelled()) { + this._invokeOnCancel(); + return true; + } + } + return false; +}; + +Promise.prototype._cancelBranched = function() { + if (this._enoughBranchesHaveCancelled()) { + this._cancel(); + } +}; + +Promise.prototype._cancel = function() { + if (!this.isCancellable()) return; + + this._setCancelled(); + async.invoke(this._cancelPromises, this, undefined); +}; + +Promise.prototype._cancelPromises = function() { + if (this._length() > 0) this._settlePromises(); +}; + +Promise.prototype._unsetOnCancel = function() { + this._onCancelField = undefined; +}; + +Promise.prototype.isCancellable = function() { + return this.isPending() && !this.isCancelled(); +}; + +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) { + if (util.isArray(onCancelCallback)) { + for (var i = 0; i < onCancelCallback.length; ++i) { + this._doInvokeOnCancel(onCancelCallback[i], internalOnly); + } + } else if (onCancelCallback !== undefined) { + if (typeof onCancelCallback === "function") { + if (!internalOnly) { + var e = tryCatch(onCancelCallback).call(this._boundValue()); + if (e === errorObj) { + this._attachExtraTrace(e.e); + async.throwLater(e.e); + } + } + } else { + onCancelCallback._resultCancelled(this); + } + } +}; + +Promise.prototype._invokeOnCancel = function() { + var onCancelCallback = this._onCancel(); + this._unsetOnCancel(); + async.invoke(this._doInvokeOnCancel, this, onCancelCallback); +}; + +Promise.prototype._invokeInternalOnCancel = function() { + if (this.isCancellable()) { + this._doInvokeOnCancel(this._onCancel(), true); + this._unsetOnCancel(); + } +}; + +Promise.prototype._resultCancelled = function() { + this.cancel(); +}; + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/catch_filter.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/catch_filter.js new file mode 100644 index 00000000..0f24ce23 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/catch_filter.js @@ -0,0 +1,42 @@ +"use strict"; +module.exports = function(NEXT_FILTER) { +var util = require("./util"); +var getKeys = require("./es5").keys; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function catchFilter(instances, cb, promise) { + return function(e) { + var boundTo = promise._boundValue(); + predicateLoop: for (var i = 0; i < instances.length; ++i) { + var item = instances[i]; + + if (item === Error || + (item != null && item.prototype instanceof Error)) { + if (e instanceof item) { + return tryCatch(cb).call(boundTo, e); + } + } else if (typeof item === "function") { + var matchesPredicate = tryCatch(item).call(boundTo, e); + if (matchesPredicate === errorObj) { + return matchesPredicate; + } else if (matchesPredicate) { + return tryCatch(cb).call(boundTo, e); + } + } else if (util.isObject(e)) { + var keys = getKeys(item); + for (var j = 0; j < keys.length; ++j) { + var key = keys[j]; + if (item[key] != e[key]) { + continue predicateLoop; + } + } + return tryCatch(cb).call(boundTo, e); + } + } + return NEXT_FILTER; + }; +} + +return catchFilter; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/context.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/context.js new file mode 100644 index 00000000..c307414f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/context.js @@ -0,0 +1,69 @@ +"use strict"; +module.exports = function(Promise) { +var longStackTraces = false; +var contextStack = []; + +Promise.prototype._promiseCreated = function() {}; +Promise.prototype._pushContext = function() {}; +Promise.prototype._popContext = function() {return null;}; +Promise._peekContext = Promise.prototype._peekContext = function() {}; + +function Context() { + this._trace = new Context.CapturedTrace(peekContext()); +} +Context.prototype._pushContext = function () { + if (this._trace !== undefined) { + this._trace._promiseCreated = null; + contextStack.push(this._trace); + } +}; + +Context.prototype._popContext = function () { + if (this._trace !== undefined) { + var trace = contextStack.pop(); + var ret = trace._promiseCreated; + trace._promiseCreated = null; + return ret; + } + return null; +}; + +function createContext() { + if (longStackTraces) return new Context(); +} + +function peekContext() { + var lastIndex = contextStack.length - 1; + if (lastIndex >= 0) { + return contextStack[lastIndex]; + } + return undefined; +} +Context.CapturedTrace = null; +Context.create = createContext; +Context.deactivateLongStackTraces = function() {}; +Context.activateLongStackTraces = function() { + var Promise_pushContext = Promise.prototype._pushContext; + var Promise_popContext = Promise.prototype._popContext; + var Promise_PeekContext = Promise._peekContext; + var Promise_peekContext = Promise.prototype._peekContext; + var Promise_promiseCreated = Promise.prototype._promiseCreated; + Context.deactivateLongStackTraces = function() { + Promise.prototype._pushContext = Promise_pushContext; + Promise.prototype._popContext = Promise_popContext; + Promise._peekContext = Promise_PeekContext; + Promise.prototype._peekContext = Promise_peekContext; + Promise.prototype._promiseCreated = Promise_promiseCreated; + longStackTraces = false; + }; + longStackTraces = true; + Promise.prototype._pushContext = Context.prototype._pushContext; + Promise.prototype._popContext = Context.prototype._popContext; + Promise._peekContext = Promise.prototype._peekContext = peekContext; + Promise.prototype._promiseCreated = function() { + var ctx = this._peekContext(); + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this; + }; +}; +return Context; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/debuggability.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/debuggability.js new file mode 100644 index 00000000..9f142f0f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/debuggability.js @@ -0,0 +1,812 @@ +"use strict"; +module.exports = function(Promise, Context) { +var getDomain = Promise._getDomain; +var async = Promise._async; +var Warning = require("./errors").Warning; +var util = require("./util"); +var canAttachTrace = util.canAttachTrace; +var unhandledRejectionHandled; +var possiblyUnhandledRejection; +var bluebirdFramePattern = + /[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/; +var stackFramePattern = null; +var formatStack = null; +var indentStackFrames = false; +var printWarning; +var debugging = !!(util.env("BLUEBIRD_DEBUG") != 0 && + (false || + util.env("BLUEBIRD_DEBUG") || + util.env("NODE_ENV") === "development")); +var warnings = !!(util.env("BLUEBIRD_WARNINGS") != 0 && + (debugging || util.env("BLUEBIRD_WARNINGS"))); +var longStackTraces = !!(util.env("BLUEBIRD_LONG_STACK_TRACES") != 0 && + (debugging || util.env("BLUEBIRD_LONG_STACK_TRACES"))); + +Promise.prototype.suppressUnhandledRejections = function() { + var target = this._target(); + target._bitField = ((target._bitField & (~1048576)) | + 2097152); +}; + +Promise.prototype._ensurePossibleRejectionHandled = function () { + if ((this._bitField & 2097152) !== 0) return; + this._setRejectionIsUnhandled(); + async.invokeLater(this._notifyUnhandledRejection, this, undefined); +}; + +Promise.prototype._notifyUnhandledRejectionIsHandled = function () { + fireRejectionEvent("rejectionHandled", + unhandledRejectionHandled, undefined, this); +}; + +Promise.prototype._notifyUnhandledRejection = function () { + if (this._isRejectionUnhandled()) { + var reason = this._settledValue(); + this._setUnhandledRejectionIsNotified(); + fireRejectionEvent("unhandledRejection", + possiblyUnhandledRejection, reason, this); + } +}; + +Promise.prototype._setUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField | 262144; +}; + +Promise.prototype._unsetUnhandledRejectionIsNotified = function () { + this._bitField = this._bitField & (~262144); +}; + +Promise.prototype._isUnhandledRejectionNotified = function () { + return (this._bitField & 262144) > 0; +}; + +Promise.prototype._setRejectionIsUnhandled = function () { + this._bitField = this._bitField | 1048576; +}; + +Promise.prototype._unsetRejectionIsUnhandled = function () { + this._bitField = this._bitField & (~1048576); + if (this._isUnhandledRejectionNotified()) { + this._unsetUnhandledRejectionIsNotified(); + this._notifyUnhandledRejectionIsHandled(); + } +}; + +Promise.prototype._isRejectionUnhandled = function () { + return (this._bitField & 1048576) > 0; +}; + +Promise.prototype._warn = function(message, shouldUseOwnTrace, promise) { + return warn(message, shouldUseOwnTrace, promise || this); +}; + +Promise.onPossiblyUnhandledRejection = function (fn) { + var domain = getDomain(); + possiblyUnhandledRejection = + typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) + : undefined; +}; + +Promise.onUnhandledRejectionHandled = function (fn) { + var domain = getDomain(); + unhandledRejectionHandled = + typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) + : undefined; +}; + +var disableLongStackTraces = function() {}; +Promise.longStackTraces = function () { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + if (!config.longStackTraces && longStackTracesIsSupported()) { + var Promise_captureStackTrace = Promise.prototype._captureStackTrace; + var Promise_attachExtraTrace = Promise.prototype._attachExtraTrace; + config.longStackTraces = true; + disableLongStackTraces = function() { + if (async.haveItemsQueued() && !config.longStackTraces) { + throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + Promise.prototype._captureStackTrace = Promise_captureStackTrace; + Promise.prototype._attachExtraTrace = Promise_attachExtraTrace; + Context.deactivateLongStackTraces(); + async.enableTrampoline(); + config.longStackTraces = false; + }; + Promise.prototype._captureStackTrace = longStackTracesCaptureStackTrace; + Promise.prototype._attachExtraTrace = longStackTracesAttachExtraTrace; + Context.activateLongStackTraces(); + async.disableTrampolineIfNecessary(); + } +}; + +Promise.hasLongStackTraces = function () { + return config.longStackTraces && longStackTracesIsSupported(); +}; + +Promise.config = function(opts) { + opts = Object(opts); + if ("longStackTraces" in opts) { + if (opts.longStackTraces) { + Promise.longStackTraces(); + } else if (!opts.longStackTraces && Promise.hasLongStackTraces()) { + disableLongStackTraces(); + } + } + if ("warnings" in opts) { + config.warnings = !!opts.warnings; + } + if ("cancellation" in opts && opts.cancellation && !config.cancellation) { + if (async.haveItemsQueued()) { + throw new Error( + "cannot enable cancellation after promises are in use"); + } + Promise.prototype._clearCancellationData = + cancellationClearCancellationData; + Promise.prototype._propagateFrom = cancellationPropagateFrom; + Promise.prototype._onCancel = cancellationOnCancel; + Promise.prototype._setOnCancel = cancellationSetOnCancel; + Promise.prototype._attachCancellationCallback = + cancellationAttachCancellationCallback; + Promise.prototype._execute = cancellationExecute; + propagateFromFunction = cancellationPropagateFrom; + config.cancellation = true; + } +}; + +Promise.prototype._execute = function(executor, resolve, reject) { + try { + executor(resolve, reject); + } catch (e) { + return e; + } +}; +Promise.prototype._onCancel = function () {}; +Promise.prototype._setOnCancel = function (handler) { ; }; +Promise.prototype._attachCancellationCallback = function(onCancel) { + ; +}; +Promise.prototype._captureStackTrace = function () {}; +Promise.prototype._attachExtraTrace = function () {}; +Promise.prototype._clearCancellationData = function() {}; +Promise.prototype._propagateFrom = function (parent, flags) { + ; + ; +}; + +function cancellationExecute(executor, resolve, reject) { + var promise = this; + try { + executor(resolve, reject, function(onCancel) { + if (typeof onCancel !== "function") { + throw new TypeError("onCancel must be a function, got: " + + util.toString(onCancel)); + } + promise._attachCancellationCallback(onCancel); + }); + } catch (e) { + return e; + } +} + +function cancellationAttachCancellationCallback(onCancel) { + if (!this.isCancellable()) return this; + + var previousOnCancel = this._onCancel(); + if (previousOnCancel !== undefined) { + if (util.isArray(previousOnCancel)) { + previousOnCancel.push(onCancel); + } else { + this._setOnCancel([previousOnCancel, onCancel]); + } + } else { + this._setOnCancel(onCancel); + } +} + +function cancellationOnCancel() { + return this._onCancelField; +} + +function cancellationSetOnCancel(onCancel) { + this._onCancelField = onCancel; +} + +function cancellationClearCancellationData() { + this._cancellationParent = undefined; + this._onCancelField = undefined; +} + +function cancellationPropagateFrom(parent, flags) { + if ((flags & 1) !== 0) { + this._cancellationParent = parent; + var branchesRemainingToCancel = parent._branchesRemainingToCancel; + if (branchesRemainingToCancel === undefined) { + branchesRemainingToCancel = 0; + } + parent._branchesRemainingToCancel = branchesRemainingToCancel + 1; + } + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} + +function bindingPropagateFrom(parent, flags) { + if ((flags & 2) !== 0 && parent._isBound()) { + this._setBoundTo(parent._boundTo); + } +} +var propagateFromFunction = bindingPropagateFrom; + +function boundValueFunction() { + var ret = this._boundTo; + if (ret !== undefined) { + if (ret instanceof Promise) { + if (ret.isFulfilled()) { + return ret.value(); + } else { + return undefined; + } + } + } + return ret; +} + +function longStackTracesCaptureStackTrace() { + this._trace = new CapturedTrace(this._peekContext()); +} + +function longStackTracesAttachExtraTrace(error, ignoreSelf) { + if (canAttachTrace(error)) { + var trace = this._trace; + if (trace !== undefined) { + if (ignoreSelf) trace = trace._parent; + } + if (trace !== undefined) { + trace.attachExtraTrace(error); + } else if (!error.__stackCleaned__) { + var parsed = parseStackAndMessage(error); + util.notEnumerableProp(error, "stack", + parsed.message + "\n" + parsed.stack.join("\n")); + util.notEnumerableProp(error, "__stackCleaned__", true); + } + } +} + +function checkForgottenReturns(returnValue, promiseCreated, name, promise) { + if (returnValue === undefined && + promiseCreated !== null && + config.longStackTraces && + config.warnings) { + var msg = "a promise was created in a " + name + + " handler but was not returned from it"; + promise._warn(msg, true, promiseCreated); + } +} + +function deprecated(name, replacement) { + var message = name + + " is deprecated and will be removed in a future version."; + if (replacement) message += " Use " + replacement + " instead."; + return warn(message); +} + +function warn(message, shouldUseOwnTrace, promise) { + if (!config.warnings) return; + var warning = new Warning(message); + var ctx; + if (shouldUseOwnTrace) { + promise._attachExtraTrace(warning); + } else if (config.longStackTraces && (ctx = Promise._peekContext())) { + ctx.attachExtraTrace(warning); + } else { + var parsed = parseStackAndMessage(warning); + warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); + } + formatAndLogError(warning, "", true); +} + +function reconstructStack(message, stacks) { + for (var i = 0; i < stacks.length - 1; ++i) { + stacks[i].push("From previous event:"); + stacks[i] = stacks[i].join("\n"); + } + if (i < stacks.length) { + stacks[i] = stacks[i].join("\n"); + } + return message + "\n" + stacks.join("\n"); +} + +function removeDuplicateOrEmptyJumps(stacks) { + for (var i = 0; i < stacks.length; ++i) { + if (stacks[i].length === 0 || + ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { + stacks.splice(i, 1); + i--; + } + } +} + +function removeCommonRoots(stacks) { + var current = stacks[0]; + for (var i = 1; i < stacks.length; ++i) { + var prev = stacks[i]; + var currentLastIndex = current.length - 1; + var currentLastLine = current[currentLastIndex]; + var commonRootMeetPoint = -1; + + for (var j = prev.length - 1; j >= 0; --j) { + if (prev[j] === currentLastLine) { + commonRootMeetPoint = j; + break; + } + } + + for (var j = commonRootMeetPoint; j >= 0; --j) { + var line = prev[j]; + if (current[currentLastIndex] === line) { + current.pop(); + currentLastIndex--; + } else { + break; + } + } + current = prev; + } +} + +function cleanStack(stack) { + var ret = []; + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + var isTraceLine = " (No stack trace)" === line || + stackFramePattern.test(line); + var isInternalFrame = isTraceLine && shouldIgnore(line); + if (isTraceLine && !isInternalFrame) { + if (indentStackFrames && line.charAt(0) !== " ") { + line = " " + line; + } + ret.push(line); + } + } + return ret; +} + +function stackFramesAsArray(error) { + var stack = error.stack.replace(/\s+$/g, "").split("\n"); + for (var i = 0; i < stack.length; ++i) { + var line = stack[i]; + if (" (No stack trace)" === line || stackFramePattern.test(line)) { + break; + } + } + if (i > 0) { + stack = stack.slice(i); + } + return stack; +} + +function parseStackAndMessage(error) { + var stack = error.stack; + var message = error.toString(); + stack = typeof stack === "string" && stack.length > 0 + ? stackFramesAsArray(error) : [" (No stack trace)"]; + return { + message: message, + stack: cleanStack(stack) + }; +} + +function formatAndLogError(error, title, isSoft) { + if (typeof console !== "undefined") { + var message; + if (util.isObject(error)) { + var stack = error.stack; + message = title + formatStack(stack, error); + } else { + message = title + String(error); + } + if (typeof printWarning === "function") { + printWarning(message, isSoft); + } else if (typeof console.log === "function" || + typeof console.log === "object") { + console.log(message); + } + } +} + +function fireRejectionEvent(name, localHandler, reason, promise) { + var localEventFired = false; + try { + if (typeof localHandler === "function") { + localEventFired = true; + if (name === "rejectionHandled") { + localHandler(promise); + } else { + localHandler(reason, promise); + } + } + } catch (e) { + async.throwLater(e); + } + + var globalEventFired = false; + try { + globalEventFired = fireGlobalEvent(name, reason, promise); + } catch (e) { + globalEventFired = true; + async.throwLater(e); + } + + var domEventFired = false; + if (fireDomEvent) { + try { + domEventFired = fireDomEvent(name.toLowerCase(), { + reason: reason, + promise: promise + }); + } catch (e) { + domEventFired = true; + async.throwLater(e); + } + } + + if (!globalEventFired && !localEventFired && !domEventFired && + name === "unhandledRejection") { + formatAndLogError(reason, "Unhandled rejection "); + } +} + +function formatNonError(obj) { + var str; + if (typeof obj === "function") { + str = "[function " + + (obj.name || "anonymous") + + "]"; + } else { + str = obj && typeof obj.toString === "function" + ? obj.toString() : util.toString(obj); + var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; + if (ruselessToString.test(str)) { + try { + var newStr = JSON.stringify(obj); + str = newStr; + } + catch(e) { + + } + } + if (str.length === 0) { + str = "(empty array)"; + } + } + return ("(<" + snip(str) + ">, no stack trace)"); +} + +function snip(str) { + var maxChars = 41; + if (str.length < maxChars) { + return str; + } + return str.substr(0, maxChars - 3) + "..."; +} + +function longStackTracesIsSupported() { + return typeof captureStackTrace === "function"; +} + +var shouldIgnore = function() { return false; }; +var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; +function parseLineInfo(line) { + var matches = line.match(parseLineInfoRegex); + if (matches) { + return { + fileName: matches[1], + line: parseInt(matches[2], 10) + }; + } +} + +function setBounds(firstLineError, lastLineError) { + if (!longStackTracesIsSupported()) return; + var firstStackLines = firstLineError.stack.split("\n"); + var lastStackLines = lastLineError.stack.split("\n"); + var firstIndex = -1; + var lastIndex = -1; + var firstFileName; + var lastFileName; + for (var i = 0; i < firstStackLines.length; ++i) { + var result = parseLineInfo(firstStackLines[i]); + if (result) { + firstFileName = result.fileName; + firstIndex = result.line; + break; + } + } + for (var i = 0; i < lastStackLines.length; ++i) { + var result = parseLineInfo(lastStackLines[i]); + if (result) { + lastFileName = result.fileName; + lastIndex = result.line; + break; + } + } + if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || + firstFileName !== lastFileName || firstIndex >= lastIndex) { + return; + } + + shouldIgnore = function(line) { + if (bluebirdFramePattern.test(line)) return true; + var info = parseLineInfo(line); + if (info) { + if (info.fileName === firstFileName && + (firstIndex <= info.line && info.line <= lastIndex)) { + return true; + } + } + return false; + }; +} + +function CapturedTrace(parent) { + this._parent = parent; + this._promisesCreated = 0; + var length = this._length = 1 + (parent === undefined ? 0 : parent._length); + captureStackTrace(this, CapturedTrace); + if (length > 32) this.uncycle(); +} +util.inherits(CapturedTrace, Error); +Context.CapturedTrace = CapturedTrace; + +CapturedTrace.prototype.uncycle = function() { + var length = this._length; + if (length < 2) return; + var nodes = []; + var stackToIndex = {}; + + for (var i = 0, node = this; node !== undefined; ++i) { + nodes.push(node); + node = node._parent; + } + length = this._length = i; + for (var i = length - 1; i >= 0; --i) { + var stack = nodes[i].stack; + if (stackToIndex[stack] === undefined) { + stackToIndex[stack] = i; + } + } + for (var i = 0; i < length; ++i) { + var currentStack = nodes[i].stack; + var index = stackToIndex[currentStack]; + if (index !== undefined && index !== i) { + if (index > 0) { + nodes[index - 1]._parent = undefined; + nodes[index - 1]._length = 1; + } + nodes[i]._parent = undefined; + nodes[i]._length = 1; + var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; + + if (index < length - 1) { + cycleEdgeNode._parent = nodes[index + 1]; + cycleEdgeNode._parent.uncycle(); + cycleEdgeNode._length = + cycleEdgeNode._parent._length + 1; + } else { + cycleEdgeNode._parent = undefined; + cycleEdgeNode._length = 1; + } + var currentChildLength = cycleEdgeNode._length + 1; + for (var j = i - 2; j >= 0; --j) { + nodes[j]._length = currentChildLength; + currentChildLength++; + } + return; + } + } +}; + +CapturedTrace.prototype.attachExtraTrace = function(error) { + if (error.__stackCleaned__) return; + this.uncycle(); + var parsed = parseStackAndMessage(error); + var message = parsed.message; + var stacks = [parsed.stack]; + + var trace = this; + while (trace !== undefined) { + stacks.push(cleanStack(trace.stack.split("\n"))); + trace = trace._parent; + } + removeCommonRoots(stacks); + removeDuplicateOrEmptyJumps(stacks); + util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); + util.notEnumerableProp(error, "__stackCleaned__", true); +}; + +var captureStackTrace = (function stackDetection() { + var v8stackFramePattern = /^\s*at\s*/; + var v8stackFormatter = function(stack, error) { + if (typeof stack === "string") return stack; + + if (error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + if (typeof Error.stackTraceLimit === "number" && + typeof Error.captureStackTrace === "function") { + Error.stackTraceLimit += 6; + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + var captureStackTrace = Error.captureStackTrace; + + shouldIgnore = function(line) { + return bluebirdFramePattern.test(line); + }; + return function(receiver, ignoreUntil) { + Error.stackTraceLimit += 6; + captureStackTrace(receiver, ignoreUntil); + Error.stackTraceLimit -= 6; + }; + } + var err = new Error(); + + if (typeof err.stack === "string" && + err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { + stackFramePattern = /@/; + formatStack = v8stackFormatter; + indentStackFrames = true; + return function captureStackTrace(o) { + o.stack = new Error().stack; + }; + } + + var hasStackAfterThrow; + try { throw new Error(); } + catch(e) { + hasStackAfterThrow = ("stack" in e); + } + if (!("stack" in err) && hasStackAfterThrow && + typeof Error.stackTraceLimit === "number") { + stackFramePattern = v8stackFramePattern; + formatStack = v8stackFormatter; + return function captureStackTrace(o) { + Error.stackTraceLimit += 6; + try { throw new Error(); } + catch(e) { o.stack = e.stack; } + Error.stackTraceLimit -= 6; + }; + } + + formatStack = function(stack, error) { + if (typeof stack === "string") return stack; + + if ((typeof error === "object" || + typeof error === "function") && + error.name !== undefined && + error.message !== undefined) { + return error.toString(); + } + return formatNonError(error); + }; + + return null; + +})([]); + +var fireDomEvent; +var fireGlobalEvent = (function() { + if (util.isNode) { + return function(name, reason, promise) { + if (name === "rejectionHandled") { + return process.emit(name, promise); + } else { + return process.emit(name, reason, promise); + } + }; + } else { + var customEventWorks = false; + var anyEventWorks = true; + try { + var ev = new self.CustomEvent("test"); + customEventWorks = ev instanceof CustomEvent; + } catch (e) {} + if (!customEventWorks) { + try { + var event = document.createEvent("CustomEvent"); + event.initCustomEvent("testingtheevent", false, true, {}); + self.dispatchEvent(event); + } catch (e) { + anyEventWorks = false; + } + } + if (anyEventWorks) { + fireDomEvent = function(type, detail) { + var event; + if (customEventWorks) { + event = new self.CustomEvent(type, { + detail: detail, + bubbles: false, + cancelable: true + }); + } else if (self.dispatchEvent) { + event = document.createEvent("CustomEvent"); + event.initCustomEvent(type, false, true, detail); + } + + return event ? !self.dispatchEvent(event) : false; + }; + } + + var toWindowMethodNameMap = {}; + toWindowMethodNameMap["unhandledRejection"] = ("on" + + "unhandledRejection").toLowerCase(); + toWindowMethodNameMap["rejectionHandled"] = ("on" + + "rejectionHandled").toLowerCase(); + + return function(name, reason, promise) { + var methodName = toWindowMethodNameMap[name]; + var method = self[methodName]; + if (!method) return false; + if (name === "rejectionHandled") { + method.call(self, promise); + } else { + method.call(self, reason, promise); + } + return true; + }; + } +})(); + +if (typeof console !== "undefined" && typeof console.warn !== "undefined") { + printWarning = function (message) { + console.warn(message); + }; + if (util.isNode && process.stderr.isTTY) { + printWarning = function(message, isSoft) { + var color = isSoft ? "\u001b[33m" : "\u001b[31m"; + console.warn(color + message + "\u001b[0m\n"); + }; + } else if (!util.isNode && typeof (new Error().stack) === "string") { + printWarning = function(message, isSoft) { + console.warn("%c" + message, + isSoft ? "color: darkorange" : "color: red"); + }; + } +} + +var config = { + warnings: warnings, + longStackTraces: false, + cancellation: false +}; + +if (longStackTraces) Promise.longStackTraces(); + +return { + longStackTraces: function() { + return config.longStackTraces; + }, + warnings: function() { + return config.warnings; + }, + cancellation: function() { + return config.cancellation; + }, + propagateFromFunction: function() { + return propagateFromFunction; + }, + boundValueFunction: function() { + return boundValueFunction; + }, + checkForgottenReturns: checkForgottenReturns, + setBounds: setBounds, + warn: warn, + deprecated: deprecated, + CapturedTrace: CapturedTrace +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/direct_resolve.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/direct_resolve.js new file mode 100644 index 00000000..a8902982 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/direct_resolve.js @@ -0,0 +1,46 @@ +"use strict"; +module.exports = function(Promise) { +function returner() { + return this.value; +} +function thrower() { + throw this.reason; +} + +Promise.prototype["return"] = +Promise.prototype.thenReturn = function (value) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + returner, undefined, undefined, {value: value}, undefined); +}; + +Promise.prototype["throw"] = +Promise.prototype.thenThrow = function (reason) { + return this._then( + thrower, undefined, undefined, {reason: reason}, undefined); +}; + +Promise.prototype.catchThrow = function (reason) { + if (arguments.length <= 1) { + return this._then( + undefined, thrower, undefined, {reason: reason}, undefined); + } else { + var _reason = arguments[1]; + var handler = function() {throw _reason;}; + return this.caught(reason, handler); + } +}; + +Promise.prototype.catchReturn = function (value) { + if (arguments.length <= 1) { + if (value instanceof Promise) value.suppressUnhandledRejections(); + return this._then( + undefined, returner, undefined, {value: value}, undefined); + } else { + var _value = arguments[1]; + if (_value instanceof Promise) _value.suppressUnhandledRejections(); + var handler = function() {return _value;}; + return this.caught(value, handler); + } +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/each.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/each.js new file mode 100644 index 00000000..ac8ead77 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/each.js @@ -0,0 +1,29 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseReduce = Promise.reduce; +var PromiseAll = Promise.all; + +function promiseAllThis() { + return PromiseAll(this); +} + +function PromiseMapSeries(promises, fn) { + return PromiseReduce(promises, fn, INTERNAL, INTERNAL); +} + +Promise.prototype.each = function (fn) { + return this.mapSeries(fn) + ._then(promiseAllThis, undefined, undefined, this, undefined); +}; + +Promise.prototype.mapSeries = function (fn) { + return PromiseReduce(this, fn, INTERNAL, INTERNAL); +}; + +Promise.each = function (promises, fn) { + return PromiseMapSeries(promises, fn) + ._then(promiseAllThis, undefined, undefined, promises, undefined); +}; + +Promise.mapSeries = PromiseMapSeries; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/errors.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/errors.js new file mode 100644 index 00000000..ddd05257 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/errors.js @@ -0,0 +1,111 @@ +"use strict"; +var es5 = require("./es5"); +var Objectfreeze = es5.freeze; +var util = require("./util"); +var inherits = util.inherits; +var notEnumerableProp = util.notEnumerableProp; + +function subError(nameProperty, defaultMessage) { + function SubError(message) { + if (!(this instanceof SubError)) return new SubError(message); + notEnumerableProp(this, "message", + typeof message === "string" ? message : defaultMessage); + notEnumerableProp(this, "name", nameProperty); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } else { + Error.call(this); + } + } + inherits(SubError, Error); + return SubError; +} + +var _TypeError, _RangeError; +var Warning = subError("Warning", "warning"); +var CancellationError = subError("CancellationError", "cancellation error"); +var TimeoutError = subError("TimeoutError", "timeout error"); +var AggregateError = subError("AggregateError", "aggregate error"); +try { + _TypeError = TypeError; + _RangeError = RangeError; +} catch(e) { + _TypeError = subError("TypeError", "type error"); + _RangeError = subError("RangeError", "range error"); +} + +var methods = ("join pop push shift unshift slice filter forEach some " + + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); + +for (var i = 0; i < methods.length; ++i) { + if (typeof Array.prototype[methods[i]] === "function") { + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; + } +} + +es5.defineProperty(AggregateError.prototype, "length", { + value: 0, + configurable: false, + writable: true, + enumerable: true +}); +AggregateError.prototype["isOperational"] = true; +var level = 0; +AggregateError.prototype.toString = function() { + var indent = Array(level * 4 + 1).join(" "); + var ret = "\n" + indent + "AggregateError of:" + "\n"; + level++; + indent = Array(level * 4 + 1).join(" "); + for (var i = 0; i < this.length; ++i) { + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; + var lines = str.split("\n"); + for (var j = 0; j < lines.length; ++j) { + lines[j] = indent + lines[j]; + } + str = lines.join("\n"); + ret += str + "\n"; + } + level--; + return ret; +}; + +function OperationalError(message) { + if (!(this instanceof OperationalError)) + return new OperationalError(message); + notEnumerableProp(this, "name", "OperationalError"); + notEnumerableProp(this, "message", message); + this.cause = message; + this["isOperational"] = true; + + if (message instanceof Error) { + notEnumerableProp(this, "message", message.message); + notEnumerableProp(this, "stack", message.stack); + } else if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + +} +inherits(OperationalError, Error); + +var errorTypes = Error["__BluebirdErrorTypes__"]; +if (!errorTypes) { + errorTypes = Objectfreeze({ + CancellationError: CancellationError, + TimeoutError: TimeoutError, + OperationalError: OperationalError, + RejectionError: OperationalError, + AggregateError: AggregateError + }); + notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes); +} + +module.exports = { + Error: Error, + TypeError: _TypeError, + RangeError: _RangeError, + CancellationError: errorTypes.CancellationError, + OperationalError: errorTypes.OperationalError, + TimeoutError: errorTypes.TimeoutError, + AggregateError: errorTypes.AggregateError, + Warning: Warning +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/es5.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/es5.js new file mode 100644 index 00000000..ea41d5a5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/es5.js @@ -0,0 +1,80 @@ +var isES5 = (function(){ + "use strict"; + return this === undefined; +})(); + +if (isES5) { + module.exports = { + freeze: Object.freeze, + defineProperty: Object.defineProperty, + getDescriptor: Object.getOwnPropertyDescriptor, + keys: Object.keys, + names: Object.getOwnPropertyNames, + getPrototypeOf: Object.getPrototypeOf, + isArray: Array.isArray, + isES5: isES5, + propertyIsWritable: function(obj, prop) { + var descriptor = Object.getOwnPropertyDescriptor(obj, prop); + return !!(!descriptor || descriptor.writable || descriptor.set); + } + }; +} else { + var has = {}.hasOwnProperty; + var str = {}.toString; + var proto = {}.constructor.prototype; + + var ObjectKeys = function (o) { + var ret = []; + for (var key in o) { + if (has.call(o, key)) { + ret.push(key); + } + } + return ret; + }; + + var ObjectGetDescriptor = function(o, key) { + return {value: o[key]}; + }; + + var ObjectDefineProperty = function (o, key, desc) { + o[key] = desc.value; + return o; + }; + + var ObjectFreeze = function (obj) { + return obj; + }; + + var ObjectGetPrototypeOf = function (obj) { + try { + return Object(obj).constructor.prototype; + } + catch (e) { + return proto; + } + }; + + var ArrayIsArray = function (obj) { + try { + return str.call(obj) === "[object Array]"; + } + catch(e) { + return false; + } + }; + + module.exports = { + isArray: ArrayIsArray, + keys: ObjectKeys, + names: ObjectKeys, + defineProperty: ObjectDefineProperty, + getDescriptor: ObjectGetDescriptor, + freeze: ObjectFreeze, + getPrototypeOf: ObjectGetPrototypeOf, + isES5: isES5, + propertyIsWritable: function() { + return true; + } + }; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/filter.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/filter.js new file mode 100644 index 00000000..ed57bf01 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/filter.js @@ -0,0 +1,12 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var PromiseMap = Promise.map; + +Promise.prototype.filter = function (fn, options) { + return PromiseMap(this, fn, options, INTERNAL); +}; + +Promise.filter = function (promises, fn, options) { + return PromiseMap(promises, fn, options, INTERNAL); +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/finally.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/finally.js new file mode 100644 index 00000000..0ee8b99f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/finally.js @@ -0,0 +1,100 @@ +"use strict"; +module.exports = function(Promise, tryConvertToPromise) { +var util = require("./util"); +var CancellationError = Promise.CancellationError; +var errorObj = util.errorObj; + +function FinallyHandlerCancelReaction(finallyHandler) { + this.finallyHandler = finallyHandler; +} + +FinallyHandlerCancelReaction.prototype._resultCancelled = function() { + checkCancel(this.finallyHandler); +}; + +function checkCancel(ctx, reason) { + if (ctx.cancelPromise != null) { + if (arguments.length > 1) { + ctx.cancelPromise._reject(reason); + } else { + ctx.cancelPromise._cancel(); + } + ctx.cancelPromise = null; + return true; + } + return false; +} + +function succeed() { + return finallyHandler.call(this, this.promise._target()._settledValue()); +} +function fail(reason) { + if (checkCancel(this, reason)) return; + errorObj.e = reason; + return errorObj; +} +function finallyHandler(reasonOrValue) { + var promise = this.promise; + var handler = this.handler; + + if (!this.called) { + this.called = true; + var ret = this.type === 0 + ? handler.call(promise._boundValue()) + : handler.call(promise._boundValue(), reasonOrValue); + if (ret !== undefined) { + var maybePromise = tryConvertToPromise(ret, promise); + if (maybePromise instanceof Promise) { + if (this.cancelPromise != null) { + if (maybePromise.isCancelled()) { + var reason = + new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + errorObj.e = reason; + return errorObj; + } else if (maybePromise.isPending()) { + maybePromise._attachCancellationCallback( + new FinallyHandlerCancelReaction(this)); + } + } + return maybePromise._then( + succeed, fail, undefined, this, undefined); + } + } + } + + if (promise.isRejected()) { + checkCancel(this); + errorObj.e = reasonOrValue; + return errorObj; + } else { + checkCancel(this); + return reasonOrValue; + } +} + +Promise.prototype._passThrough = function(handler, type, success, fail) { + if (typeof handler !== "function") return this.then(); + return this._then(success, fail, undefined, { + promise: this, + handler: handler, + called: false, + cancelPromise: null, + type: type + }, undefined); +}; + +Promise.prototype.lastly = +Promise.prototype["finally"] = function (handler) { + return this._passThrough(handler, + 0, + finallyHandler, + finallyHandler); +}; + +Promise.prototype.tap = function (handler) { + return this._passThrough(handler, 1, finallyHandler); +}; + +return finallyHandler; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/generators.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/generators.js new file mode 100644 index 00000000..d04c228b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/generators.js @@ -0,0 +1,204 @@ +"use strict"; +module.exports = function(Promise, + apiRejection, + INTERNAL, + tryConvertToPromise, + Proxyable, + debug) { +var errors = require("./errors"); +var TypeError = errors.TypeError; +var util = require("./util"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +var yieldHandlers = []; + +function promiseFromYieldHandler(value, yieldHandlers, traceParent) { + for (var i = 0; i < yieldHandlers.length; ++i) { + traceParent._pushContext(); + var result = tryCatch(yieldHandlers[i])(value); + traceParent._popContext(); + if (result === errorObj) { + traceParent._pushContext(); + var ret = Promise.reject(errorObj.e); + traceParent._popContext(); + return ret; + } + var maybePromise = tryConvertToPromise(result, traceParent); + if (maybePromise instanceof Promise) return maybePromise; + } + return null; +} + +function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { + var promise = this._promise = new Promise(INTERNAL); + promise._captureStackTrace(); + promise._setOnCancel(this); + this._stack = stack; + this._generatorFunction = generatorFunction; + this._receiver = receiver; + this._generator = undefined; + this._yieldHandlers = typeof yieldHandler === "function" + ? [yieldHandler].concat(yieldHandlers) + : yieldHandlers; + this._yieldedPromise = null; +} +util.inherits(PromiseSpawn, Proxyable); + +PromiseSpawn.prototype._isResolved = function() { + return this.promise === null; +}; + +PromiseSpawn.prototype._cleanup = function() { + this._promise = this._generator = null; +}; + +PromiseSpawn.prototype._promiseCancelled = function() { + if (this._isResolved()) return; + var implementsReturn = typeof this._generator["return"] !== "undefined"; + + var result; + if (!implementsReturn) { + var reason = new Promise.CancellationError( + "generator .return() sentinel"); + Promise.coroutine.returnSentinel = reason; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + result = tryCatch(this._generator["throw"]).call(this._generator, + reason); + this._promise._popContext(); + if (result === errorObj && result.e === reason) { + result = null; + } + } else { + this._promise._pushContext(); + result = tryCatch(this._generator["return"]).call(this._generator, + undefined); + this._promise._popContext(); + } + var promise = this._promise; + this._cleanup(); + if (result === errorObj) { + promise._rejectCallback(result.e, false); + } else { + promise.cancel(); + } +}; + +PromiseSpawn.prototype._promiseFulfilled = function(value) { + this._yieldedPromise = null; + this._promise._pushContext(); + var result = tryCatch(this._generator.next).call(this._generator, value); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._promiseRejected = function(reason) { + this._yieldedPromise = null; + this._promise._attachExtraTrace(reason); + this._promise._pushContext(); + var result = tryCatch(this._generator["throw"]) + .call(this._generator, reason); + this._promise._popContext(); + this._continue(result); +}; + +PromiseSpawn.prototype._resultCancelled = function() { + if (this._yieldedPromise instanceof Promise) { + var promise = this._yieldedPromise; + this._yieldedPromise = null; + promise.cancel(); + } +}; + +PromiseSpawn.prototype.promise = function () { + return this._promise; +}; + +PromiseSpawn.prototype._run = function () { + this._generator = this._generatorFunction.call(this._receiver); + this._receiver = + this._generatorFunction = undefined; + this._promiseFulfilled(undefined); +}; + +PromiseSpawn.prototype._continue = function (result) { + var promise = this._promise; + if (result === errorObj) { + this._cleanup(); + return promise._rejectCallback(result.e, false); + } + + var value = result.value; + if (result.done === true) { + this._cleanup(); + return promise._resolveCallback(value); + } else { + var maybePromise = tryConvertToPromise(value, this._promise); + if (!(maybePromise instanceof Promise)) { + maybePromise = + promiseFromYieldHandler(maybePromise, + this._yieldHandlers, + this._promise); + if (maybePromise === null) { + this._promiseRejected( + new TypeError( + "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/MqrFmX\u000a\u000a".replace("%s", value) + + "From coroutine:\u000a" + + this._stack.split("\n").slice(1, -7).join("\n") + ) + ); + return; + } + } + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + this._yieldedPromise = maybePromise; + maybePromise._proxy(this, null); + } else if (((bitField & 33554432) !== 0)) { + this._promiseFulfilled(maybePromise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._promiseRejected(maybePromise._reason()); + } else { + this._promiseCancelled(); + } + } +}; + +Promise.coroutine = function (generatorFunction, options) { + if (typeof generatorFunction !== "function") { + throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var yieldHandler = Object(options).yieldHandler; + var PromiseSpawn$ = PromiseSpawn; + var stack = new Error().stack; + return function () { + var generator = generatorFunction.apply(this, arguments); + var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, + stack); + var ret = spawn.promise(); + spawn._generator = generator; + spawn._promiseFulfilled(undefined); + return ret; + }; +}; + +Promise.coroutine.addYieldHandler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + yieldHandlers.push(fn); +}; + +Promise.spawn = function (generatorFunction) { + debug.deprecated("Promise.spawn()", "Promise.coroutine()"); + if (typeof generatorFunction !== "function") { + return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var spawn = new PromiseSpawn(generatorFunction, this); + var ret = spawn.promise(); + spawn._run(Promise.spawn); + return ret; +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/join.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/join.js new file mode 100644 index 00000000..b3ec246f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/join.js @@ -0,0 +1,149 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) { +var util = require("./util"); +var canEvaluate = util.canEvaluate; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var reject; + +if (!false) { +if (canEvaluate) { + var thenCallback = function(i) { + return new Function("value", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = value; \n\ + holder.checkFulfillment(this); \n\ + ".replace(/Index/g, i)); + }; + + var promiseSetter = function(i) { + return new Function("promise", "holder", " \n\ + 'use strict'; \n\ + holder.pIndex = promise; \n\ + ".replace(/Index/g, i)); + }; + + var generateHolderClass = function(total) { + var props = new Array(total); + for (var i = 0; i < props.length; ++i) { + props[i] = "this.p" + (i+1); + } + var assignment = props.join(" = ") + " = null;"; + var cancellationCode= "var promise;\n" + props.map(function(prop) { + return " \n\ + promise = " + prop + "; \n\ + if (promise instanceof Promise) { \n\ + promise.cancel(); \n\ + } \n\ + "; + }).join("\n"); + var passedArguments = props.join(", "); + var name = "Holder$" + total; + + + var code = "return function(tryCatch, errorObj, Promise) { \n\ + 'use strict'; \n\ + function [TheName](fn) { \n\ + [TheProperties] \n\ + this.fn = fn; \n\ + this.now = 0; \n\ + } \n\ + [TheName].prototype.checkFulfillment = function(promise) { \n\ + var now = ++this.now; \n\ + if (now === [TheTotal]) { \n\ + promise._pushContext(); \n\ + var callback = this.fn; \n\ + var ret = tryCatch(callback)([ThePassedArguments]); \n\ + promise._popContext(); \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(ret.e, false); \n\ + } else { \n\ + promise._resolveCallback(ret); \n\ + } \n\ + } \n\ + }; \n\ + \n\ + [TheName].prototype._resultCancelled = function() { \n\ + [CancellationCode] \n\ + }; \n\ + \n\ + return [TheName]; \n\ + }(tryCatch, errorObj, Promise); \n\ + "; + + code = code.replace(/\[TheName\]/g, name) + .replace(/\[TheTotal\]/g, total) + .replace(/\[ThePassedArguments\]/g, passedArguments) + .replace(/\[TheProperties\]/g, assignment) + .replace(/\[CancellationCode\]/g, cancellationCode); + + return new Function("tryCatch", "errorObj", "Promise", code) + (tryCatch, errorObj, Promise); + }; + + var holderClasses = []; + var thenCallbacks = []; + var promiseSetters = []; + + for (var i = 0; i < 8; ++i) { + holderClasses.push(generateHolderClass(i + 1)); + thenCallbacks.push(thenCallback(i + 1)); + promiseSetters.push(promiseSetter(i + 1)); + } + + reject = function (reason) { + this._reject(reason); + }; +}} + +Promise.join = function () { + var last = arguments.length - 1; + var fn; + if (last > 0 && typeof arguments[last] === "function") { + fn = arguments[last]; + if (!false) { + if (last <= 8 && canEvaluate) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + var HolderClass = holderClasses[last - 1]; + var holder = new HolderClass(fn); + var callbacks = thenCallbacks; + + for (var i = 0; i < last; ++i) { + var maybePromise = tryConvertToPromise(arguments[i], ret); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + maybePromise._then(callbacks[i], reject, + undefined, ret, holder); + promiseSetters[i](maybePromise, holder); + } else if (((bitField & 33554432) !== 0)) { + callbacks[i].call(ret, + maybePromise._value(), holder); + } else if (((bitField & 16777216) !== 0)) { + ret._reject(maybePromise._reason()); + } else { + ret._cancel(); + } + } else { + callbacks[i].call(ret, maybePromise, holder); + } + } + if (!ret._isFateSealed()) { + ret._setAsyncGuaranteed(); + ret._setOnCancel(holder); + } + return ret; + } + } + } + var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];}; + if (fn) args.pop(); + var ret = new PromiseArray(args).promise(); + return fn !== undefined ? ret.spread(fn) : ret; +}; + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/map.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/map.js new file mode 100644 index 00000000..24690dc6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/map.js @@ -0,0 +1,151 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = require("./util"); +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; +var EMPTY_ARRAY = []; + +function MappingPromiseArray(promises, fn, limit, _filter) { + this.constructor$(promises); + this._promise._captureStackTrace(); + var domain = getDomain(); + this._callback = domain === null ? fn : domain.bind(fn); + this._preservedValues = _filter === INTERNAL + ? new Array(this.length()) + : null; + this._limit = limit; + this._inFlight = 0; + this._queue = limit >= 1 ? [] : EMPTY_ARRAY; + this._init$(undefined, -2); +} +util.inherits(MappingPromiseArray, PromiseArray); + +MappingPromiseArray.prototype._init = function () {}; + +MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { + var values = this._values; + var length = this.length(); + var preservedValues = this._preservedValues; + var limit = this._limit; + + if (index < 0) { + index = (index * -1) - 1; + values[index] = value; + if (limit >= 1) { + this._inFlight--; + this._drainQueue(); + if (this._isResolved()) return true; + } + } else { + if (limit >= 1 && this._inFlight >= limit) { + values[index] = value; + this._queue.push(index); + return false; + } + if (preservedValues !== null) preservedValues[index] = value; + + var promise = this._promise; + var callback = this._callback; + var receiver = promise._boundValue(); + promise._pushContext(); + var ret = tryCatch(callback).call(receiver, value, index, length); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + preservedValues !== null ? "Promise.filter" : "Promise.map", + promise + ); + if (ret === errorObj) { + this._reject(ret.e); + return true; + } + + var maybePromise = tryConvertToPromise(ret, this._promise); + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + var bitField = maybePromise._bitField; + ; + if (((bitField & 50397184) === 0)) { + if (limit >= 1) this._inFlight++; + values[index] = maybePromise; + maybePromise._proxy(this, (index + 1) * -1); + return false; + } else if (((bitField & 33554432) !== 0)) { + ret = maybePromise._value(); + } else if (((bitField & 16777216) !== 0)) { + this._reject(maybePromise._reason()); + return true; + } else { + this._cancel(); + return true; + } + } + values[index] = ret; + } + var totalResolved = ++this._totalResolved; + if (totalResolved >= length) { + if (preservedValues !== null) { + this._filter(values, preservedValues); + } else { + this._resolve(values); + } + return true; + } + return false; +}; + +MappingPromiseArray.prototype._drainQueue = function () { + var queue = this._queue; + var limit = this._limit; + var values = this._values; + while (queue.length > 0 && this._inFlight < limit) { + if (this._isResolved()) return; + var index = queue.pop(); + this._promiseFulfilled(values[index], index); + } +}; + +MappingPromiseArray.prototype._filter = function (booleans, values) { + var len = values.length; + var ret = new Array(len); + var j = 0; + for (var i = 0; i < len; ++i) { + if (booleans[i]) ret[j++] = values[i]; + } + ret.length = j; + this._resolve(ret); +}; + +MappingPromiseArray.prototype.preservedValues = function () { + return this._preservedValues; +}; + +function map(promises, fn, options, _filter) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var limit = typeof options === "object" && options !== null + ? options.concurrency + : 0; + limit = typeof limit === "number" && + isFinite(limit) && limit >= 1 ? limit : 0; + return new MappingPromiseArray(promises, fn, limit, _filter).promise(); +} + +Promise.prototype.map = function (fn, options) { + return map(this, fn, options, null); +}; + +Promise.map = function (promises, fn, options, _filter) { + return map(promises, fn, options, _filter); +}; + + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/method.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/method.js new file mode 100644 index 00000000..ce9e4db7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/method.js @@ -0,0 +1,55 @@ +"use strict"; +module.exports = +function(Promise, INTERNAL, tryConvertToPromise, apiRejection, debug) { +var util = require("./util"); +var tryCatch = util.tryCatch; + +Promise.method = function (fn) { + if (typeof fn !== "function") { + throw new Promise.TypeError("expecting a function but got " + util.classString(fn)); + } + return function () { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value = tryCatch(fn).apply(this, arguments); + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.method", ret); + ret._resolveFromSyncValue(value); + return ret; + }; +}; + +Promise.attempt = Promise["try"] = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._pushContext(); + var value; + if (arguments.length > 1) { + debug.deprecated("calling Promise.try with more than 1 argument"); + var arg = arguments[1]; + var ctx = arguments[2]; + value = util.isArray(arg) ? tryCatch(fn).apply(ctx, arg) + : tryCatch(fn).call(ctx, arg); + } else { + value = tryCatch(fn)(); + } + var promiseCreated = ret._popContext(); + debug.checkForgottenReturns( + value, promiseCreated, "Promise.try", ret); + ret._resolveFromSyncValue(value); + return ret; +}; + +Promise.prototype._resolveFromSyncValue = function (value) { + if (value === util.errorObj) { + this._rejectCallback(value.e, false); + } else { + this._resolveCallback(value, true); + } +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/nodeback.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/nodeback.js new file mode 100644 index 00000000..07b9f116 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/nodeback.js @@ -0,0 +1,51 @@ +"use strict"; +var util = require("./util"); +var maybeWrapAsError = util.maybeWrapAsError; +var errors = require("./errors"); +var OperationalError = errors.OperationalError; +var es5 = require("./es5"); + +function isUntypedError(obj) { + return obj instanceof Error && + es5.getPrototypeOf(obj) === Error.prototype; +} + +var rErrorKey = /^(?:name|message|stack|cause)$/; +function wrapAsOperationalError(obj) { + var ret; + if (isUntypedError(obj)) { + ret = new OperationalError(obj); + ret.name = obj.name; + ret.message = obj.message; + ret.stack = obj.stack; + var keys = es5.keys(obj); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (!rErrorKey.test(key)) { + ret[key] = obj[key]; + } + } + return ret; + } + util.markAsOriginatingFromRejection(obj); + return obj; +} + +function nodebackForPromise(promise, multiArgs) { + return function(err, value) { + if (promise === null) return; + if (err) { + var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); + promise._attachExtraTrace(wrapped); + promise._reject(wrapped); + } else if (!multiArgs) { + promise._fulfill(value); + } else { + var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];}; + promise._fulfill(args); + } + promise = null; + }; +} + +module.exports = nodebackForPromise; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/nodeify.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/nodeify.js new file mode 100644 index 00000000..ce2b1900 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/nodeify.js @@ -0,0 +1,58 @@ +"use strict"; +module.exports = function(Promise) { +var util = require("./util"); +var async = Promise._async; +var tryCatch = util.tryCatch; +var errorObj = util.errorObj; + +function spreadAdapter(val, nodeback) { + var promise = this; + if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); + var ret = + tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +function successAdapter(val, nodeback) { + var promise = this; + var receiver = promise._boundValue(); + var ret = val === undefined + ? tryCatch(nodeback).call(receiver, null) + : tryCatch(nodeback).call(receiver, null, val); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} +function errorAdapter(reason, nodeback) { + var promise = this; + if (!reason) { + var newReason = new Error(reason + ""); + newReason.cause = reason; + reason = newReason; + } + var ret = tryCatch(nodeback).call(promise._boundValue(), reason); + if (ret === errorObj) { + async.throwLater(ret.e); + } +} + +Promise.prototype.asCallback = Promise.prototype.nodeify = function (nodeback, + options) { + if (typeof nodeback == "function") { + var adapter = successAdapter; + if (options !== undefined && Object(options).spread) { + adapter = spreadAdapter; + } + this._then( + adapter, + errorAdapter, + undefined, + this, + nodeback + ); + } + return this; +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promise.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promise.js new file mode 100644 index 00000000..9fe8f54c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promise.js @@ -0,0 +1,755 @@ +"use strict"; +module.exports = function() { +var makeSelfResolutionError = function () { + return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +var reflectHandler = function() { + return new Promise.PromiseInspection(this._target()); +}; +var apiRejection = function(msg) { + return Promise.reject(new TypeError(msg)); +}; +function Proxyable() {} +var UNDEFINED_BINDING = {}; +var util = require("./util"); + +var getDomain; +if (util.isNode) { + getDomain = function() { + var ret = process.domain; + if (ret === undefined) ret = null; + return ret; + }; +} else { + getDomain = function() { + return null; + }; +} +util.notEnumerableProp(Promise, "_getDomain", getDomain); + +var es5 = require("./es5"); +var Async = require("./async"); +var async = new Async(); +es5.defineProperty(Promise, "_async", {value: async}); +var errors = require("./errors"); +var TypeError = Promise.TypeError = errors.TypeError; +Promise.RangeError = errors.RangeError; +var CancellationError = Promise.CancellationError = errors.CancellationError; +Promise.TimeoutError = errors.TimeoutError; +Promise.OperationalError = errors.OperationalError; +Promise.RejectionError = errors.OperationalError; +Promise.AggregateError = errors.AggregateError; +var INTERNAL = function(){}; +var APPLY = {}; +var NEXT_FILTER = {}; +var tryConvertToPromise = require("./thenables")(Promise, INTERNAL); +var PromiseArray = + require("./promise_array")(Promise, INTERNAL, + tryConvertToPromise, apiRejection, Proxyable); +var Context = require("./context")(Promise); + /*jshint unused:false*/ +var createContext = Context.create; +var debug = require("./debuggability")(Promise, Context); +var CapturedTrace = debug.CapturedTrace; +var finallyHandler = require("./finally")(Promise, tryConvertToPromise); +var catchFilter = require("./catch_filter")(NEXT_FILTER); +var nodebackForPromise = require("./nodeback"); +var errorObj = util.errorObj; +var tryCatch = util.tryCatch; +function check(self, executor) { + if (typeof executor !== "function") { + throw new TypeError("expecting a function but got " + util.classString(executor)); + } + if (self.constructor !== Promise) { + throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } +} + +function Promise(executor) { + this._bitField = 0; + this._fulfillmentHandler0 = undefined; + this._rejectionHandler0 = undefined; + this._promise0 = undefined; + this._receiver0 = undefined; + if (executor !== INTERNAL) { + check(this, executor); + this._resolveFromExecutor(executor); + } + this._promiseCreated(); +} + +Promise.prototype.toString = function () { + return "[object Promise]"; +}; + +Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { + var len = arguments.length; + if (len > 1) { + var catchInstances = new Array(len - 1), + j = 0, i; + for (i = 0; i < len - 1; ++i) { + var item = arguments[i]; + if (util.isObject(item)) { + catchInstances[j++] = item; + } else { + return apiRejection("expecting an object but got " + util.classString(item)); + } + } + catchInstances.length = j; + fn = arguments[i]; + return this.then(undefined, catchFilter(catchInstances, fn, this)); + } + return this.then(undefined, fn); +}; + +Promise.prototype.reflect = function () { + return this._then(reflectHandler, + reflectHandler, undefined, this, undefined); +}; + +Promise.prototype.then = function (didFulfill, didReject) { + if (debug.warnings() && arguments.length > 0 && + typeof didFulfill !== "function" && + typeof didReject !== "function") { + var msg = ".then() only accepts functions but was passed: " + + util.classString(didFulfill); + if (arguments.length > 1) { + msg += ", " + util.classString(didReject); + } + this._warn(msg); + } + return this._then(didFulfill, didReject, undefined, undefined, undefined); +}; + +Promise.prototype.done = function (didFulfill, didReject) { + var promise = + this._then(didFulfill, didReject, undefined, undefined, undefined); + promise._setIsFinal(); +}; + +Promise.prototype.spread = function (fn) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + return this.all()._then(fn, undefined, undefined, APPLY, undefined); +}; + +Promise.prototype.toJSON = function () { + var ret = { + isFulfilled: false, + isRejected: false, + fulfillmentValue: undefined, + rejectionReason: undefined + }; + if (this.isFulfilled()) { + ret.fulfillmentValue = this.value(); + ret.isFulfilled = true; + } else if (this.isRejected()) { + ret.rejectionReason = this.reason(); + ret.isRejected = true; + } + return ret; +}; + +Promise.prototype.all = function () { + if (arguments.length > 0) { + this._warn(".all() was passed arguments but it does not take any"); + } + return new PromiseArray(this).promise(); +}; + +Promise.prototype.error = function (fn) { + return this.caught(util.originatesFromRejection, fn); +}; + +Promise.is = function (val) { + return val instanceof Promise; +}; + +Promise.fromNode = Promise.fromCallback = function(fn) { + var ret = new Promise(INTERNAL); + var multiArgs = arguments.length > 1 ? !!Object(arguments[1]).multiArgs + : false; + var result = tryCatch(fn)(nodebackForPromise(ret, multiArgs)); + if (result === errorObj) { + ret._rejectCallback(result.e, true); + } + if (!ret._isFateSealed()) ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.all = function (promises) { + return new PromiseArray(promises).promise(); +}; + +Promise.cast = function (obj) { + var ret = tryConvertToPromise(obj); + if (!(ret instanceof Promise)) { + ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._setFulfilled(); + ret._rejectionHandler0 = obj; + } + return ret; +}; + +Promise.resolve = Promise.fulfilled = Promise.cast; + +Promise.reject = Promise.rejected = function (reason) { + var ret = new Promise(INTERNAL); + ret._captureStackTrace(); + ret._rejectCallback(reason, true); + return ret; +}; + +Promise.setScheduler = function(fn) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + var prev = async._schedule; + async._schedule = fn; + return prev; +}; + +Promise.prototype._then = function ( + didFulfill, + didReject, + _, receiver, + internalData +) { + var haveInternalData = internalData !== undefined; + var promise = haveInternalData ? internalData : new Promise(INTERNAL); + var target = this._target(); + var bitField = target._bitField; + + if (!haveInternalData) { + promise._propagateFrom(this, 3); + promise._captureStackTrace(); + if (receiver === undefined && + ((this._bitField & 2097152) !== 0)) { + if (!((bitField & 50397184) === 0)) { + receiver = this._boundValue(); + } else { + receiver = target === this ? undefined : this._boundTo; + } + } + } + + var domain = getDomain(); + if (!((bitField & 50397184) === 0)) { + var handler, value, settler = target._settlePromiseCtx; + if (((bitField & 33554432) !== 0)) { + value = target._rejectionHandler0; + handler = didFulfill; + } else if (((bitField & 16777216) !== 0)) { + value = target._fulfillmentHandler0; + handler = didReject; + target._unsetRejectionIsUnhandled(); + } else { + settler = target._settlePromiseLateCancellationObserver; + value = new CancellationError("late cancellation observer"); + target._attachExtraTrace(value); + handler = didReject; + } + + async.invoke(settler, target, { + handler: domain === null ? handler + : (typeof handler === "function" && domain.bind(handler)), + promise: promise, + receiver: receiver, + value: value + }); + } else { + target._addCallbacks(didFulfill, didReject, promise, receiver, domain); + } + + return promise; +}; + +Promise.prototype._length = function () { + return this._bitField & 65535; +}; + +Promise.prototype._isFateSealed = function () { + return (this._bitField & 117506048) !== 0; +}; + +Promise.prototype._isFollowing = function () { + return (this._bitField & 67108864) === 67108864; +}; + +Promise.prototype._setLength = function (len) { + this._bitField = (this._bitField & -65536) | + (len & 65535); +}; + +Promise.prototype._setFulfilled = function () { + this._bitField = this._bitField | 33554432; +}; + +Promise.prototype._setRejected = function () { + this._bitField = this._bitField | 16777216; +}; + +Promise.prototype._setFollowing = function () { + this._bitField = this._bitField | 67108864; +}; + +Promise.prototype._setIsFinal = function () { + this._bitField = this._bitField | 4194304; +}; + +Promise.prototype._isFinal = function () { + return (this._bitField & 4194304) > 0; +}; + +Promise.prototype._unsetCancelled = function() { + this._bitField = this._bitField & (~65536); +}; + +Promise.prototype._setCancelled = function() { + this._bitField = this._bitField | 65536; +}; + +Promise.prototype._setAsyncGuaranteed = function() { + this._bitField = this._bitField | 134217728; +}; + +Promise.prototype._receiverAt = function (index) { + var ret = index === 0 ? this._receiver0 : this[ + index * 4 - 4 + 3]; + if (ret === UNDEFINED_BINDING) { + return undefined; + } else if (ret === undefined && this._isBound()) { + return this._boundValue(); + } + return ret; +}; + +Promise.prototype._promiseAt = function (index) { + return this[ + index * 4 - 4 + 2]; +}; + +Promise.prototype._fulfillmentHandlerAt = function (index) { + return this[ + index * 4 - 4 + 0]; +}; + +Promise.prototype._rejectionHandlerAt = function (index) { + return this[ + index * 4 - 4 + 1]; +}; + +Promise.prototype._boundValue = function() {}; + +Promise.prototype._migrateCallback0 = function (follower) { + var bitField = follower._bitField; + var fulfill = follower._fulfillmentHandler0; + var reject = follower._rejectionHandler0; + var promise = follower._promise0; + var receiver = follower._receiverAt(0); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._migrateCallbackAt = function (follower, index) { + var fulfill = follower._fulfillmentHandlerAt(index); + var reject = follower._rejectionHandlerAt(index); + var promise = follower._promiseAt(index); + var receiver = follower._receiverAt(index); + if (receiver === undefined) receiver = UNDEFINED_BINDING; + this._addCallbacks(fulfill, reject, promise, receiver, null); +}; + +Promise.prototype._addCallbacks = function ( + fulfill, + reject, + promise, + receiver, + domain +) { + var index = this._length(); + + if (index >= 65535 - 4) { + index = 0; + this._setLength(0); + } + + if (index === 0) { + this._promise0 = promise; + this._receiver0 = receiver; + if (typeof fulfill === "function") { + this._fulfillmentHandler0 = + domain === null ? fulfill : domain.bind(fulfill); + } + if (typeof reject === "function") { + this._rejectionHandler0 = + domain === null ? reject : domain.bind(reject); + } + } else { + var base = index * 4 - 4; + this[base + 2] = promise; + this[base + 3] = receiver; + if (typeof fulfill === "function") { + this[base + 0] = + domain === null ? fulfill : domain.bind(fulfill); + } + if (typeof reject === "function") { + this[base + 1] = + domain === null ? reject : domain.bind(reject); + } + } + this._setLength(index + 1); + return index; +}; + +Promise.prototype._proxy = function (proxyable, arg) { + this._addCallbacks(undefined, undefined, arg, proxyable, null); +}; + +Promise.prototype._resolveCallback = function(value, shouldBind) { + if (((this._bitField & 117506048) !== 0)) return; + if (value === this) + return this._rejectCallback(makeSelfResolutionError(), false); + var maybePromise = tryConvertToPromise(value, this); + if (!(maybePromise instanceof Promise)) return this._fulfill(value); + + if (shouldBind) this._propagateFrom(maybePromise, 2); + + var promise = maybePromise._target(); + var bitField = promise._bitField; + if (((bitField & 50397184) === 0)) { + var len = this._length(); + if (len > 0) promise._migrateCallback0(this); + for (var i = 1; i < len; ++i) { + promise._migrateCallbackAt(this, i); + } + this._setFollowing(); + this._setLength(0); + this._setFollowee(promise); + } else if (((bitField & 33554432) !== 0)) { + this._fulfill(promise._value()); + } else if (((bitField & 16777216) !== 0)) { + this._reject(promise._reason()); + } else { + var reason = new CancellationError("late cancellation observer"); + promise._attachExtraTrace(reason); + this._reject(reason); + } +}; + +Promise.prototype._rejectCallback = +function(reason, synchronous, ignoreNonErrorWarnings) { + var trace = util.ensureErrorObject(reason); + var hasStack = trace === reason; + if (!hasStack && !ignoreNonErrorWarnings && debug.warnings()) { + var message = "a promise was rejected with a non-error: " + + util.classString(reason); + this._warn(message, true); + } + this._attachExtraTrace(trace, synchronous ? hasStack : false); + this._reject(reason); +}; + +Promise.prototype._resolveFromExecutor = function (executor) { + var promise = this; + this._captureStackTrace(); + this._pushContext(); + var synchronous = true; + var r = this._execute(executor, function(value) { + promise._resolveCallback(value); + }, function (reason) { + promise._rejectCallback(reason, synchronous); + }); + synchronous = false; + this._popContext(); + + if (r !== undefined) { + promise._rejectCallback(r, true); + } +}; + +Promise.prototype._settlePromiseFromHandler = function ( + handler, receiver, value, promise +) { + var bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + promise._pushContext(); + var x; + if (receiver === APPLY) { + if (!value || typeof value.length !== "number") { + x = errorObj; + x.e = new TypeError("cannot .spread() a non-array: " + + util.classString(value)); + } else { + x = tryCatch(handler).apply(this._boundValue(), value); + } + } else { + x = tryCatch(handler).call(receiver, value); + } + var promiseCreated = promise._popContext(); + bitField = promise._bitField; + if (((bitField & 65536) !== 0)) return; + + if (x === NEXT_FILTER) { + promise._reject(value); + } else if (x === errorObj || x === promise) { + var err = x === promise ? makeSelfResolutionError() : x.e; + promise._rejectCallback(err, false); + } else { + debug.checkForgottenReturns(x, promiseCreated, "", promise); + promise._resolveCallback(x); + } +}; + +Promise.prototype._target = function() { + var ret = this; + while (ret._isFollowing()) ret = ret._followee(); + return ret; +}; + +Promise.prototype._followee = function() { + return this._rejectionHandler0; +}; + +Promise.prototype._setFollowee = function(promise) { + this._rejectionHandler0 = promise; +}; + +Promise.prototype._settlePromise = function(promise, handler, receiver, value) { + var isPromise = promise instanceof Promise; + var bitField = this._bitField; + var asyncGuaranteed = ((bitField & 134217728) !== 0); + if (((bitField & 65536) !== 0)) { + if (isPromise) promise._invokeInternalOnCancel(); + + if (handler === finallyHandler) { + receiver.cancelPromise = promise; + if (tryCatch(handler).call(receiver, value) === errorObj) { + promise._reject(errorObj.e); + } + } else if (handler === reflectHandler) { + promise._fulfill(reflectHandler.call(receiver)); + } else if (receiver instanceof Proxyable) { + receiver._promiseCancelled(promise); + } else if (isPromise || promise instanceof PromiseArray) { + promise._cancel(); + } else { + receiver.cancel(); + } + } else if (typeof handler === "function") { + if (!isPromise) { + handler.call(receiver, value, promise); + } else { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (receiver instanceof Proxyable) { + if (!receiver._isResolved()) { + if (((bitField & 33554432) !== 0)) { + receiver._promiseFulfilled(value, promise); + } else { + receiver._promiseRejected(value, promise); + } + } + } else if (isPromise) { + if (asyncGuaranteed) promise._setAsyncGuaranteed(); + if (((bitField & 33554432) !== 0)) { + promise._fulfill(value); + } else { + promise._reject(value); + } + } +}; + +Promise.prototype._settlePromiseLateCancellationObserver = function(ctx) { + var handler = ctx.handler; + var promise = ctx.promise; + var receiver = ctx.receiver; + var value = ctx.value; + if (typeof handler === "function") { + if (!(promise instanceof Promise)) { + handler.call(receiver, value, promise); + } else { + this._settlePromiseFromHandler(handler, receiver, value, promise); + } + } else if (promise instanceof Promise) { + promise._reject(value); + } +}; + +Promise.prototype._settlePromiseCtx = function(ctx) { + this._settlePromise(ctx.promise, ctx.handler, ctx.receiver, ctx.value); +}; + +Promise.prototype._settlePromise0 = function(handler, value, bitField) { + var promise = this._promise0; + var receiver = this._receiverAt(0); + this._promise0 = undefined; + this._receiver0 = undefined; + this._settlePromise(promise, handler, receiver, value); +}; + +Promise.prototype._clearCallbackDataAtIndex = function(index) { + var base = index * 4 - 4; + this[base + 2] = + this[base + 3] = + this[base + 0] = + this[base + 1] = undefined; +}; + +Promise.prototype._fulfill = function (value) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + if (value === this) { + var err = makeSelfResolutionError(); + this._attachExtraTrace(err); + return this._reject(err); + } + this._setFulfilled(); + this._rejectionHandler0 = value; + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } +}; + +Promise.prototype._reject = function (reason) { + var bitField = this._bitField; + if (((bitField & 117506048) >>> 16)) return; + this._setRejected(); + this._fulfillmentHandler0 = reason; + + if (this._isFinal()) { + return async.fatalError(reason, util.isNode); + } + + if ((bitField & 65535) > 0) { + if (((bitField & 134217728) !== 0)) { + this._settlePromises(); + } else { + async.settlePromises(this); + } + } else { + this._ensurePossibleRejectionHandled(); + } +}; + +Promise.prototype._fulfillPromises = function (len, value) { + for (var i = 1; i < len; i++) { + var handler = this._fulfillmentHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, value); + } +}; + +Promise.prototype._rejectPromises = function (len, reason) { + for (var i = 1; i < len; i++) { + var handler = this._rejectionHandlerAt(i); + var promise = this._promiseAt(i); + var receiver = this._receiverAt(i); + this._clearCallbackDataAtIndex(i); + this._settlePromise(promise, handler, receiver, reason); + } +}; + +Promise.prototype._settlePromises = function () { + var bitField = this._bitField; + var len = (bitField & 65535); + + if (len > 0) { + if (((bitField & 16842752) !== 0)) { + var reason = this._fulfillmentHandler0; + this._settlePromise0(this._rejectionHandler0, reason, bitField); + this._rejectPromises(len, reason); + } else { + var value = this._rejectionHandler0; + this._settlePromise0(this._fulfillmentHandler0, value, bitField); + this._fulfillPromises(len, value); + } + this._setLength(0); + } + this._clearCancellationData(); +}; + +Promise.prototype._settledValue = function() { + var bitField = this._bitField; + if (((bitField & 33554432) !== 0)) { + return this._rejectionHandler0; + } else if (((bitField & 16777216) !== 0)) { + return this._fulfillmentHandler0; + } +}; + +function deferResolve(v) {this.promise._resolveCallback(v);} +function deferReject(v) {this.promise._rejectCallback(v, false);} + +Promise.defer = Promise.pending = function() { + debug.deprecated("Promise.defer", "new Promise"); + var promise = new Promise(INTERNAL); + return { + promise: promise, + resolve: deferResolve, + reject: deferReject + }; +}; + +util.notEnumerableProp(Promise, + "_makeSelfResolutionError", + makeSelfResolutionError); + +require("./method")(Promise, INTERNAL, tryConvertToPromise, apiRejection, + debug); +require("./bind")(Promise, INTERNAL, tryConvertToPromise, debug); +require("./cancel")(Promise, PromiseArray, apiRejection, debug); +require("./direct_resolve")(Promise); +require("./synchronous_inspection")(Promise); +require("./join")( + Promise, PromiseArray, tryConvertToPromise, INTERNAL, debug); +Promise.Promise = Promise; +require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext, INTERNAL, debug); +require('./timers.js')(Promise, INTERNAL); +require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise, Proxyable, debug); +require('./nodeify.js')(Promise); +require('./call_get.js')(Promise); +require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); +require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); +require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL, debug); +require('./settle.js')(Promise, PromiseArray, debug); +require('./some.js')(Promise, PromiseArray, apiRejection); +require('./promisify.js')(Promise, INTERNAL); +require('./any.js')(Promise); +require('./each.js')(Promise, INTERNAL); +require('./filter.js')(Promise, INTERNAL); + + util.toFastProperties(Promise); + util.toFastProperties(Promise.prototype); + function fillTypes(value) { + var p = new Promise(INTERNAL); + p._fulfillmentHandler0 = value; + p._rejectionHandler0 = value; + p._promise0 = value; + p._receiver0 = value; + } + // Complete slack tracking, opt out of field-type tracking and + // stabilize map + fillTypes({a: 1}); + fillTypes({b: 2}); + fillTypes({c: 3}); + fillTypes(1); + fillTypes(function(){}); + fillTypes(undefined); + fillTypes(false); + fillTypes(new Promise(INTERNAL)); + debug.setBounds(Async.firstLineError, util.lastLineError); + return Promise; + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promise_array.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promise_array.js new file mode 100644 index 00000000..64007233 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promise_array.js @@ -0,0 +1,184 @@ +"use strict"; +module.exports = function(Promise, INTERNAL, tryConvertToPromise, + apiRejection, Proxyable) { +var util = require("./util"); +var isArray = util.isArray; + +function toResolutionValue(val) { + switch(val) { + case -2: return []; + case -3: return {}; + } +} + +function PromiseArray(values) { + var promise = this._promise = new Promise(INTERNAL); + if (values instanceof Promise) { + promise._propagateFrom(values, 3); + } + promise._setOnCancel(this); + this._values = values; + this._length = 0; + this._totalResolved = 0; + this._init(undefined, -2); +} +util.inherits(PromiseArray, Proxyable); + +PromiseArray.prototype.length = function () { + return this._length; +}; + +PromiseArray.prototype.promise = function () { + return this._promise; +}; + +PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { + var values = tryConvertToPromise(this._values, this._promise); + if (values instanceof Promise) { + values = values._target(); + var bitField = values._bitField; + ; + this._values = values; + + if (((bitField & 50397184) === 0)) { + this._promise._setAsyncGuaranteed(); + return values._then( + init, + this._reject, + undefined, + this, + resolveValueIfEmpty + ); + } else if (((bitField & 33554432) !== 0)) { + values = values._value(); + } else if (((bitField & 16777216) !== 0)) { + return this._reject(values._reason()); + } else { + return this._cancel(); + } + } + values = util.asArray(values); + if (values === null) { + var err = apiRejection( + "expecting an array or an iterable object but got " + util.classString(values)).reason(); + this._promise._rejectCallback(err, false); + return; + } + + if (values.length === 0) { + if (resolveValueIfEmpty === -5) { + this._resolveEmptyArray(); + } + else { + this._resolve(toResolutionValue(resolveValueIfEmpty)); + } + return; + } + this._iterate(values); +}; + +PromiseArray.prototype._iterate = function(values) { + var len = this.getActualLength(values.length); + this._length = len; + this._values = this.shouldCopyValues() ? new Array(len) : this._values; + var result = this._promise; + var isResolved = false; + var bitField = null; + for (var i = 0; i < len; ++i) { + var maybePromise = tryConvertToPromise(values[i], result); + + if (maybePromise instanceof Promise) { + maybePromise = maybePromise._target(); + bitField = maybePromise._bitField; + } else { + bitField = null; + } + + if (isResolved) { + if (bitField !== null) { + maybePromise.suppressUnhandledRejections(); + } + } else if (bitField !== null) { + if (((bitField & 50397184) === 0)) { + maybePromise._proxy(this, i); + this._values[i] = maybePromise; + } else if (((bitField & 33554432) !== 0)) { + isResolved = this._promiseFulfilled(maybePromise._value(), i); + } else if (((bitField & 16777216) !== 0)) { + isResolved = this._promiseRejected(maybePromise._reason(), i); + } else { + isResolved = this._promiseCancelled(i); + } + } else { + isResolved = this._promiseFulfilled(maybePromise, i); + } + } + if (!isResolved) result._setAsyncGuaranteed(); +}; + +PromiseArray.prototype._isResolved = function () { + return this._values === null; +}; + +PromiseArray.prototype._resolve = function (value) { + this._values = null; + this._promise._fulfill(value); +}; + +PromiseArray.prototype._cancel = function() { + if (this._isResolved() || !this._promise.isCancellable()) return; + this._values = null; + this._promise._cancel(); +}; + +PromiseArray.prototype._reject = function (reason) { + this._values = null; + this._promise._rejectCallback(reason, false); +}; + +PromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +PromiseArray.prototype._promiseCancelled = function() { + this._cancel(); + return true; +}; + +PromiseArray.prototype._promiseRejected = function (reason) { + this._totalResolved++; + this._reject(reason); + return true; +}; + +PromiseArray.prototype._resultCancelled = function() { + if (this._isResolved()) return; + var values = this._values; + this._cancel(); + if (values instanceof Promise) { + values.cancel(); + } else { + for (var i = 0; i < values.length; ++i) { + if (values[i] instanceof Promise) { + values[i].cancel(); + } + } + } +}; + +PromiseArray.prototype.shouldCopyValues = function () { + return true; +}; + +PromiseArray.prototype.getActualLength = function (len) { + return len; +}; + +return PromiseArray; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promisify.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promisify.js new file mode 100644 index 00000000..aa98e5bd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/promisify.js @@ -0,0 +1,314 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var THIS = {}; +var util = require("./util"); +var nodebackForPromise = require("./nodeback"); +var withAppended = util.withAppended; +var maybeWrapAsError = util.maybeWrapAsError; +var canEvaluate = util.canEvaluate; +var TypeError = require("./errors").TypeError; +var defaultSuffix = "Async"; +var defaultPromisified = {__isPromisified__: true}; +var noCopyProps = [ + "arity", "length", + "name", + "arguments", + "caller", + "callee", + "prototype", + "__isPromisified__" +]; +var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); + +var defaultFilter = function(name) { + return util.isIdentifier(name) && + name.charAt(0) !== "_" && + name !== "constructor"; +}; + +function propsFilter(key) { + return !noCopyPropsPattern.test(key); +} + +function isPromisified(fn) { + try { + return fn.__isPromisified__ === true; + } + catch (e) { + return false; + } +} + +function hasPromisified(obj, key, suffix) { + var val = util.getDataPropertyOrDefault(obj, key + suffix, + defaultPromisified); + return val ? isPromisified(val) : false; +} +function checkValid(ret, suffix, suffixRegexp) { + for (var i = 0; i < ret.length; i += 2) { + var key = ret[i]; + if (suffixRegexp.test(key)) { + var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); + for (var j = 0; j < ret.length; j += 2) { + if (ret[j] === keyWithoutAsyncSuffix) { + throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/MqrFmX\u000a" + .replace("%s", suffix)); + } + } + } + } +} + +function promisifiableMethods(obj, suffix, suffixRegexp, filter) { + var keys = util.inheritedDataKeys(obj); + var ret = []; + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + var value = obj[key]; + var passesDefaultFilter = filter === defaultFilter + ? true : defaultFilter(key, value, obj); + if (typeof value === "function" && + !isPromisified(value) && + !hasPromisified(obj, key, suffix) && + filter(key, value, obj, passesDefaultFilter)) { + ret.push(key, value); + } + } + checkValid(ret, suffix, suffixRegexp); + return ret; +} + +var escapeIdentRegex = function(str) { + return str.replace(/([$])/, "\\$"); +}; + +var makeNodePromisifiedEval; +if (!false) { +var switchCaseArgumentOrder = function(likelyArgumentCount) { + var ret = [likelyArgumentCount]; + var min = Math.max(0, likelyArgumentCount - 1 - 3); + for(var i = likelyArgumentCount - 1; i >= min; --i) { + ret.push(i); + } + for(var i = likelyArgumentCount + 1; i <= 3; ++i) { + ret.push(i); + } + return ret; +}; + +var argumentSequence = function(argumentCount) { + return util.filledRange(argumentCount, "_arg", ""); +}; + +var parameterDeclaration = function(parameterCount) { + return util.filledRange( + Math.max(parameterCount, 3), "_arg", ""); +}; + +var parameterCount = function(fn) { + if (typeof fn.length === "number") { + return Math.max(Math.min(fn.length, 1023 + 1), 0); + } + return 0; +}; + +makeNodePromisifiedEval = +function(callback, receiver, originalName, fn, _, multiArgs) { + var newParameterCount = Math.max(0, parameterCount(fn) - 1); + var argumentOrder = switchCaseArgumentOrder(newParameterCount); + var shouldProxyThis = typeof callback === "string" || receiver === THIS; + + function generateCallForArgumentCount(count) { + var args = argumentSequence(count).join(", "); + var comma = count > 0 ? ", " : ""; + var ret; + if (shouldProxyThis) { + ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; + } else { + ret = receiver === undefined + ? "ret = callback({{args}}, nodeback); break;\n" + : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; + } + return ret.replace("{{args}}", args).replace(", ", comma); + } + + function generateArgumentSwitchCase() { + var ret = ""; + for (var i = 0; i < argumentOrder.length; ++i) { + ret += "case " + argumentOrder[i] +":" + + generateCallForArgumentCount(argumentOrder[i]); + } + + ret += " \n\ + default: \n\ + var args = new Array(len + 1); \n\ + var i = 0; \n\ + for (var i = 0; i < len; ++i) { \n\ + args[i] = arguments[i]; \n\ + } \n\ + args[i] = nodeback; \n\ + [CodeForCall] \n\ + break; \n\ + ".replace("[CodeForCall]", (shouldProxyThis + ? "ret = callback.apply(this, args);\n" + : "ret = callback.apply(receiver, args);\n")); + return ret; + } + + var getFunctionCode = typeof callback === "string" + ? ("this != null ? this['"+callback+"'] : fn") + : "fn"; + var body = "'use strict'; \n\ + var ret = function (Parameters) { \n\ + 'use strict'; \n\ + var len = arguments.length; \n\ + var promise = new Promise(INTERNAL); \n\ + promise._captureStackTrace(); \n\ + var nodeback = nodebackForPromise(promise, " + multiArgs + "); \n\ + var ret; \n\ + var callback = tryCatch([GetFunctionCode]); \n\ + switch(len) { \n\ + [CodeForSwitchCase] \n\ + } \n\ + if (ret === errorObj) { \n\ + promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ + } \n\ + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); \n\ + return promise; \n\ + }; \n\ + notEnumerableProp(ret, '__isPromisified__', true); \n\ + return ret; \n\ + ".replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) + .replace("[GetFunctionCode]", getFunctionCode); + body = body.replace("Parameters", parameterDeclaration(newParameterCount)); + return new Function("Promise", + "fn", + "receiver", + "withAppended", + "maybeWrapAsError", + "nodebackForPromise", + "tryCatch", + "errorObj", + "notEnumerableProp", + "INTERNAL", + body)( + Promise, + fn, + receiver, + withAppended, + maybeWrapAsError, + nodebackForPromise, + util.tryCatch, + util.errorObj, + util.notEnumerableProp, + INTERNAL); +}; +} + +function makeNodePromisifiedClosure(callback, receiver, _, fn, __, multiArgs) { + var defaultThis = (function() {return this;})(); + var method = callback; + if (typeof method === "string") { + callback = fn; + } + function promisified() { + var _receiver = receiver; + if (receiver === THIS) _receiver = this; + var promise = new Promise(INTERNAL); + promise._captureStackTrace(); + var cb = typeof method === "string" && this !== defaultThis + ? this[method] : callback; + var fn = nodebackForPromise(promise, multiArgs); + try { + cb.apply(_receiver, withAppended(arguments, fn)); + } catch(e) { + promise._rejectCallback(maybeWrapAsError(e), true, true); + } + if (!promise._isFateSealed()) promise._setAsyncGuaranteed(); + return promise; + } + util.notEnumerableProp(promisified, "__isPromisified__", true); + return promisified; +} + +var makeNodePromisified = canEvaluate + ? makeNodePromisifiedEval + : makeNodePromisifiedClosure; + +function promisifyAll(obj, suffix, filter, promisifier, multiArgs) { + var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); + var methods = + promisifiableMethods(obj, suffix, suffixRegexp, filter); + + for (var i = 0, len = methods.length; i < len; i+= 2) { + var key = methods[i]; + var fn = methods[i+1]; + var promisifiedKey = key + suffix; + if (promisifier === makeNodePromisified) { + obj[promisifiedKey] = + makeNodePromisified(key, THIS, key, fn, suffix, multiArgs); + } else { + var promisified = promisifier(fn, function() { + return makeNodePromisified(key, THIS, key, + fn, suffix, multiArgs); + }); + util.notEnumerableProp(promisified, "__isPromisified__", true); + obj[promisifiedKey] = promisified; + } + } + util.toFastProperties(obj); + return obj; +} + +function promisify(callback, receiver, multiArgs) { + return makeNodePromisified(callback, receiver, undefined, + callback, null, multiArgs); +} + +Promise.promisify = function (fn, options) { + if (typeof fn !== "function") { + throw new TypeError("expecting a function but got " + util.classString(fn)); + } + if (isPromisified(fn)) { + return fn; + } + options = Object(options); + var receiver = options.context === undefined ? THIS : options.context; + var multiArgs = !!options.multiArgs; + var ret = promisify(fn, receiver, multiArgs); + util.copyDescriptors(fn, ret, propsFilter); + return ret; +}; + +Promise.promisifyAll = function (target, options) { + if (typeof target !== "function" && typeof target !== "object") { + throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + options = Object(options); + var multiArgs = !!options.multiArgs; + var suffix = options.suffix; + if (typeof suffix !== "string") suffix = defaultSuffix; + var filter = options.filter; + if (typeof filter !== "function") filter = defaultFilter; + var promisifier = options.promisifier; + if (typeof promisifier !== "function") promisifier = makeNodePromisified; + + if (!util.isIdentifier(suffix)) { + throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + + var keys = util.inheritedDataKeys(target); + for (var i = 0; i < keys.length; ++i) { + var value = target[keys[i]]; + if (keys[i] !== "constructor" && + util.isClass(value)) { + promisifyAll(value.prototype, suffix, filter, promisifier, + multiArgs); + promisifyAll(value, suffix, filter, promisifier, multiArgs); + } + } + + return promisifyAll(target, suffix, filter, promisifier, multiArgs); +}; +}; + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/props.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/props.js new file mode 100644 index 00000000..fc981ce4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/props.js @@ -0,0 +1,118 @@ +"use strict"; +module.exports = function( + Promise, PromiseArray, tryConvertToPromise, apiRejection) { +var util = require("./util"); +var isObject = util.isObject; +var es5 = require("./es5"); +var Es6Map; +if (typeof Map === "function") Es6Map = Map; + +var mapToEntries = (function() { + var index = 0; + var size = 0; + + function extractEntry(value, key) { + this[index] = value; + this[index + size] = key; + index++; + } + + return function mapToEntries(map) { + size = map.size; + index = 0; + var ret = new Array(map.size * 2); + map.forEach(extractEntry, ret); + return ret; + }; +})(); + +var entriesToMap = function(entries) { + var ret = new Es6Map(); + var length = entries.length / 2 | 0; + for (var i = 0; i < length; ++i) { + var key = entries[length + i]; + var value = entries[i]; + ret.set(key, value); + } + return ret; +}; + +function PropertiesPromiseArray(obj) { + var isMap = false; + var entries; + if (Es6Map !== undefined && obj instanceof Es6Map) { + entries = mapToEntries(obj); + isMap = true; + } else { + var keys = es5.keys(obj); + var len = keys.length; + entries = new Array(len * 2); + for (var i = 0; i < len; ++i) { + var key = keys[i]; + entries[i] = obj[key]; + entries[i + len] = key; + } + } + this.constructor$(entries); + this._isMap = isMap; + this._init$(undefined, -3); +} +util.inherits(PropertiesPromiseArray, PromiseArray); + +PropertiesPromiseArray.prototype._init = function () {}; + +PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { + this._values[index] = value; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + var val; + if (this._isMap) { + val = entriesToMap(this._values); + } else { + val = {}; + var keyOffset = this.length(); + for (var i = 0, len = this.length(); i < len; ++i) { + val[this._values[i + keyOffset]] = this._values[i]; + } + } + this._resolve(val); + return true; + } + return false; +}; + +PropertiesPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +PropertiesPromiseArray.prototype.getActualLength = function (len) { + return len >> 1; +}; + +function props(promises) { + var ret; + var castValue = tryConvertToPromise(promises); + + if (!isObject(castValue)) { + return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } else if (castValue instanceof Promise) { + ret = castValue._then( + Promise.props, undefined, undefined, undefined, undefined); + } else { + ret = new PropertiesPromiseArray(castValue).promise(); + } + + if (castValue instanceof Promise) { + ret._propagateFrom(castValue, 2); + } + return ret; +} + +Promise.prototype.props = function () { + return props(this); +}; + +Promise.props = function (promises) { + return props(promises); +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/queue.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/queue.js new file mode 100644 index 00000000..84d57d5f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/queue.js @@ -0,0 +1,90 @@ +"use strict"; +function arrayMove(src, srcIndex, dst, dstIndex, len) { + for (var j = 0; j < len; ++j) { + dst[j + dstIndex] = src[j + srcIndex]; + src[j + srcIndex] = void 0; + } +} + +function Queue(capacity) { + this._capacity = capacity; + this._length = 0; + this._front = 0; +} + +Queue.prototype._willBeOverCapacity = function (size) { + return this._capacity < size; +}; + +Queue.prototype._pushOne = function (arg) { + var length = this.length(); + this._checkCapacity(length + 1); + var i = (this._front + length) & (this._capacity - 1); + this[i] = arg; + this._length = length + 1; +}; + +Queue.prototype._unshiftOne = function(value) { + var capacity = this._capacity; + this._checkCapacity(this.length() + 1); + var front = this._front; + var i = (((( front - 1 ) & + ( capacity - 1) ) ^ capacity ) - capacity ); + this[i] = value; + this._front = i; + this._length = this.length() + 1; +}; + +Queue.prototype.unshift = function(fn, receiver, arg) { + this._unshiftOne(arg); + this._unshiftOne(receiver); + this._unshiftOne(fn); +}; + +Queue.prototype.push = function (fn, receiver, arg) { + var length = this.length() + 3; + if (this._willBeOverCapacity(length)) { + this._pushOne(fn); + this._pushOne(receiver); + this._pushOne(arg); + return; + } + var j = this._front + length - 3; + this._checkCapacity(length); + var wrapMask = this._capacity - 1; + this[(j + 0) & wrapMask] = fn; + this[(j + 1) & wrapMask] = receiver; + this[(j + 2) & wrapMask] = arg; + this._length = length; +}; + +Queue.prototype.shift = function () { + var front = this._front, + ret = this[front]; + + this[front] = undefined; + this._front = (front + 1) & (this._capacity - 1); + this._length--; + return ret; +}; + +Queue.prototype.length = function () { + return this._length; +}; + +Queue.prototype._checkCapacity = function (size) { + if (this._capacity < size) { + this._resizeTo(this._capacity << 1); + } +}; + +Queue.prototype._resizeTo = function (capacity) { + var oldCapacity = this._capacity; + this._capacity = capacity; + var front = this._front; + var length = this._length; + var moveItemsCount = (front + length) & (oldCapacity - 1); + arrayMove(this, 0, this, oldCapacity, moveItemsCount); +}; + +module.exports = Queue; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/race.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/race.js new file mode 100644 index 00000000..b862f46d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/race.js @@ -0,0 +1,49 @@ +"use strict"; +module.exports = function( + Promise, INTERNAL, tryConvertToPromise, apiRejection) { +var util = require("./util"); + +var raceLater = function (promise) { + return promise.then(function(array) { + return race(array, promise); + }); +}; + +function race(promises, parent) { + var maybePromise = tryConvertToPromise(promises); + + if (maybePromise instanceof Promise) { + return raceLater(maybePromise); + } else { + promises = util.asArray(promises); + if (promises === null) + return apiRejection("expecting an array or an iterable object but got " + util.classString(promises)); + } + + var ret = new Promise(INTERNAL); + if (parent !== undefined) { + ret._propagateFrom(parent, 3); + } + var fulfill = ret._fulfill; + var reject = ret._reject; + for (var i = 0, len = promises.length; i < len; ++i) { + var val = promises[i]; + + if (val === undefined && !(i in promises)) { + continue; + } + + Promise.cast(val)._then(fulfill, reject, undefined, ret, null); + } + return ret; +} + +Promise.race = function (promises) { + return race(promises, undefined); +}; + +Promise.prototype.race = function () { + return race(this, undefined); +}; + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/reduce.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/reduce.js new file mode 100644 index 00000000..8f73500d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/reduce.js @@ -0,0 +1,162 @@ +"use strict"; +module.exports = function(Promise, + PromiseArray, + apiRejection, + tryConvertToPromise, + INTERNAL, + debug) { +var getDomain = Promise._getDomain; +var util = require("./util"); +var tryCatch = util.tryCatch; + +function ReductionPromiseArray(promises, fn, initialValue, _each) { + this.constructor$(promises); + var domain = getDomain(); + this._fn = domain === null ? fn : domain.bind(fn); + if (initialValue !== undefined) { + initialValue = Promise.resolve(initialValue); + initialValue._attachCancellationCallback(this); + } + this._initialValue = initialValue; + this._currentCancellable = null; + this._eachValues = _each === INTERNAL ? [] : undefined; + this._promise._captureStackTrace(); + this._init$(undefined, -5); +} +util.inherits(ReductionPromiseArray, PromiseArray); + +ReductionPromiseArray.prototype._gotAccum = function(accum) { + if (this._eachValues !== undefined && accum !== INTERNAL) { + this._eachValues.push(accum); + } +}; + +ReductionPromiseArray.prototype._eachComplete = function(value) { + this._eachValues.push(value); + return this._eachValues; +}; + +ReductionPromiseArray.prototype._init = function() {}; + +ReductionPromiseArray.prototype._resolveEmptyArray = function() { + this._resolve(this._eachValues !== undefined ? this._eachValues + : this._initialValue); +}; + +ReductionPromiseArray.prototype.shouldCopyValues = function () { + return false; +}; + +ReductionPromiseArray.prototype._resolve = function(value) { + this._promise._resolveCallback(value); + this._values = null; +}; + +ReductionPromiseArray.prototype._resultCancelled = function(sender) { + if (sender === this._initialValue) return this._cancel(); + if (this._isResolved()) return; + this._resultCancelled$(); + if (this._currentCancellable instanceof Promise) { + this._currentCancellable.cancel(); + } + if (this._initialValue instanceof Promise) { + this._initialValue.cancel(); + } +}; + +ReductionPromiseArray.prototype._iterate = function (values) { + this._values = values; + var value; + var i; + var length = values.length; + if (this._initialValue !== undefined) { + value = this._initialValue; + i = 0; + } else { + value = Promise.resolve(values[0]); + i = 1; + } + + this._currentCancellable = value; + + if (!value.isRejected()) { + for (; i < length; ++i) { + var ctx = { + accum: null, + value: values[i], + index: i, + length: length, + array: this + }; + value = value._then(gotAccum, undefined, undefined, ctx, undefined); + } + } + + if (this._eachValues !== undefined) { + value = value + ._then(this._eachComplete, undefined, undefined, this, undefined); + } + value._then(completed, completed, undefined, value, this); +}; + +Promise.prototype.reduce = function (fn, initialValue) { + return reduce(this, fn, initialValue, null); +}; + +Promise.reduce = function (promises, fn, initialValue, _each) { + return reduce(promises, fn, initialValue, _each); +}; + +function completed(valueOrReason, array) { + if (this.isFulfilled()) { + array._resolve(valueOrReason); + } else { + array._reject(valueOrReason); + } +} + +function reduce(promises, fn, initialValue, _each) { + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var array = new ReductionPromiseArray(promises, fn, initialValue, _each); + return array.promise(); +} + +function gotAccum(accum) { + this.accum = accum; + this.array._gotAccum(accum); + var value = tryConvertToPromise(this.value, this.array._promise); + if (value instanceof Promise) { + this.array._currentCancellable = value; + return value._then(gotValue, undefined, undefined, this, undefined); + } else { + return gotValue.call(this, value); + } +} + +function gotValue(value) { + var array = this.array; + var promise = array._promise; + var fn = tryCatch(array._fn); + promise._pushContext(); + var ret; + if (array._eachValues !== undefined) { + ret = fn.call(promise._boundValue(), value, this.index, this.length); + } else { + ret = fn.call(promise._boundValue(), + this.accum, value, this.index, this.length); + } + if (ret instanceof Promise) { + array._currentCancellable = ret; + } + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, + promiseCreated, + array._eachValues !== undefined ? "Promise.each" : "Promise.reduce", + promise + ); + return ret; +} +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/schedule.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/schedule.js new file mode 100644 index 00000000..0e3e0f5e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/schedule.js @@ -0,0 +1,35 @@ +"use strict"; +var util = require("./util"); +var schedule; +var noAsyncScheduler = function() { + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a"); +}; +if (util.isNode && typeof MutationObserver === "undefined") { + var GlobalSetImmediate = global.setImmediate; + var ProcessNextTick = process.nextTick; + schedule = util.isRecentNode + ? function(fn) { GlobalSetImmediate.call(global, fn); } + : function(fn) { ProcessNextTick.call(process, fn); }; +} else if ((typeof MutationObserver !== "undefined") && + !(typeof window !== "undefined" && + window.navigator && + window.navigator.standalone)) { + schedule = function(fn) { + var div = document.createElement("div"); + var observer = new MutationObserver(fn); + observer.observe(div, {attributes: true}); + return function() { div.classList.toggle("foo"); }; + }; + schedule.isStatic = true; +} else if (typeof setImmediate !== "undefined") { + schedule = function (fn) { + setImmediate(fn); + }; +} else if (typeof setTimeout !== "undefined") { + schedule = function (fn) { + setTimeout(fn, 0); + }; +} else { + schedule = noAsyncScheduler; +} +module.exports = schedule; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/settle.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/settle.js new file mode 100644 index 00000000..fade3a17 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/settle.js @@ -0,0 +1,43 @@ +"use strict"; +module.exports = + function(Promise, PromiseArray, debug) { +var PromiseInspection = Promise.PromiseInspection; +var util = require("./util"); + +function SettledPromiseArray(values) { + this.constructor$(values); +} +util.inherits(SettledPromiseArray, PromiseArray); + +SettledPromiseArray.prototype._promiseResolved = function (index, inspection) { + this._values[index] = inspection; + var totalResolved = ++this._totalResolved; + if (totalResolved >= this._length) { + this._resolve(this._values); + return true; + } + return false; +}; + +SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { + var ret = new PromiseInspection(); + ret._bitField = 33554432; + ret._settledValueField = value; + return this._promiseResolved(index, ret); +}; +SettledPromiseArray.prototype._promiseRejected = function (reason, index) { + var ret = new PromiseInspection(); + ret._bitField = 16777216; + ret._settledValueField = reason; + return this._promiseResolved(index, ret); +}; + +Promise.settle = function (promises) { + debug.deprecated(".settle()", ".reflect()"); + return new SettledPromiseArray(promises).promise(); +}; + +Promise.prototype.settle = function () { + return Promise.settle(this); +}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/some.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/some.js new file mode 100644 index 00000000..400d8520 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/some.js @@ -0,0 +1,148 @@ +"use strict"; +module.exports = +function(Promise, PromiseArray, apiRejection) { +var util = require("./util"); +var RangeError = require("./errors").RangeError; +var AggregateError = require("./errors").AggregateError; +var isArray = util.isArray; +var CANCELLATION = {}; + + +function SomePromiseArray(values) { + this.constructor$(values); + this._howMany = 0; + this._unwrap = false; + this._initialized = false; +} +util.inherits(SomePromiseArray, PromiseArray); + +SomePromiseArray.prototype._init = function () { + if (!this._initialized) { + return; + } + if (this._howMany === 0) { + this._resolve([]); + return; + } + this._init$(undefined, -5); + var isArrayResolved = isArray(this._values); + if (!this._isResolved() && + isArrayResolved && + this._howMany > this._canPossiblyFulfill()) { + this._reject(this._getRangeError(this.length())); + } +}; + +SomePromiseArray.prototype.init = function () { + this._initialized = true; + this._init(); +}; + +SomePromiseArray.prototype.setUnwrap = function () { + this._unwrap = true; +}; + +SomePromiseArray.prototype.howMany = function () { + return this._howMany; +}; + +SomePromiseArray.prototype.setHowMany = function (count) { + this._howMany = count; +}; + +SomePromiseArray.prototype._promiseFulfilled = function (value) { + this._addFulfilled(value); + if (this._fulfilled() === this.howMany()) { + this._values.length = this.howMany(); + if (this.howMany() === 1 && this._unwrap) { + this._resolve(this._values[0]); + } else { + this._resolve(this._values); + } + return true; + } + return false; + +}; +SomePromiseArray.prototype._promiseRejected = function (reason) { + this._addRejected(reason); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._promiseCancelled = function () { + if (this._values instanceof Promise || this._values == null) { + return this._cancel(); + } + this._addRejected(CANCELLATION); + return this._checkOutcome(); +}; + +SomePromiseArray.prototype._checkOutcome = function() { + if (this.howMany() > this._canPossiblyFulfill()) { + var e = new AggregateError(); + for (var i = this.length(); i < this._values.length; ++i) { + if (this._values[i] !== CANCELLATION) { + e.push(this._values[i]); + } + } + if (e.length > 0) { + this._reject(e); + } else { + this._cancel(); + } + return true; + } + return false; +}; + +SomePromiseArray.prototype._fulfilled = function () { + return this._totalResolved; +}; + +SomePromiseArray.prototype._rejected = function () { + return this._values.length - this.length(); +}; + +SomePromiseArray.prototype._addRejected = function (reason) { + this._values.push(reason); +}; + +SomePromiseArray.prototype._addFulfilled = function (value) { + this._values[this._totalResolved++] = value; +}; + +SomePromiseArray.prototype._canPossiblyFulfill = function () { + return this.length() - this._rejected(); +}; + +SomePromiseArray.prototype._getRangeError = function (count) { + var message = "Input array must contain at least " + + this._howMany + " items but contains only " + count + " items"; + return new RangeError(message); +}; + +SomePromiseArray.prototype._resolveEmptyArray = function () { + this._reject(this._getRangeError(0)); +}; + +function some(promises, howMany) { + if ((howMany | 0) !== howMany || howMany < 0) { + return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + var ret = new SomePromiseArray(promises); + var promise = ret.promise(); + ret.setHowMany(howMany); + ret.init(); + return promise; +} + +Promise.some = function (promises, howMany) { + return some(promises, howMany); +}; + +Promise.prototype.some = function (howMany) { + return some(this, howMany); +}; + +Promise._SomePromiseArray = SomePromiseArray; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/synchronous_inspection.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/synchronous_inspection.js new file mode 100644 index 00000000..fb0c1a62 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/synchronous_inspection.js @@ -0,0 +1,96 @@ +"use strict"; +module.exports = function(Promise) { +function PromiseInspection(promise) { + if (promise !== undefined) { + promise = promise._target(); + this._bitField = promise._bitField; + this._settledValueField = promise._isFateSealed() + ? promise._settledValue() : undefined; + } + else { + this._bitField = 0; + this._settledValueField = undefined; + } +} + +PromiseInspection.prototype._settledValue = function() { + return this._settledValueField; +}; + +var value = PromiseInspection.prototype.value = function () { + if (!this.isFulfilled()) { + throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var reason = PromiseInspection.prototype.error = +PromiseInspection.prototype.reason = function () { + if (!this.isRejected()) { + throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/MqrFmX\u000a"); + } + return this._settledValue(); +}; + +var isFulfilled = PromiseInspection.prototype.isFulfilled = function() { + return (this._bitField & 33554432) !== 0; +}; + +var isRejected = PromiseInspection.prototype.isRejected = function () { + return (this._bitField & 16777216) !== 0; +}; + +var isPending = PromiseInspection.prototype.isPending = function () { + return (this._bitField & 50397184) === 0; +}; + +var isResolved = PromiseInspection.prototype.isResolved = function () { + return (this._bitField & 50331648) !== 0; +}; + +PromiseInspection.prototype.isCancelled = +Promise.prototype._isCancelled = function() { + return (this._bitField & 65536) === 65536; +}; + +Promise.prototype.isCancelled = function() { + return this._target()._isCancelled(); +}; + +Promise.prototype.isPending = function() { + return isPending.call(this._target()); +}; + +Promise.prototype.isRejected = function() { + return isRejected.call(this._target()); +}; + +Promise.prototype.isFulfilled = function() { + return isFulfilled.call(this._target()); +}; + +Promise.prototype.isResolved = function() { + return isResolved.call(this._target()); +}; + +Promise.prototype.value = function() { + return value.call(this._target()); +}; + +Promise.prototype.reason = function() { + var target = this._target(); + target._unsetRejectionIsUnhandled(); + return reason.call(target); +}; + +Promise.prototype._value = function() { + return this._settledValue(); +}; + +Promise.prototype._reason = function() { + this._unsetRejectionIsUnhandled(); + return this._settledValue(); +}; + +Promise.PromiseInspection = PromiseInspection; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/thenables.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/thenables.js new file mode 100644 index 00000000..a04fddea --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/thenables.js @@ -0,0 +1,82 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = require("./util"); +var errorObj = util.errorObj; +var isObject = util.isObject; + +function tryConvertToPromise(obj, context) { + if (isObject(obj)) { + if (obj instanceof Promise) return obj; + var then = getThen(obj); + if (then === errorObj) { + if (context) context._pushContext(); + var ret = Promise.reject(then.e); + if (context) context._popContext(); + return ret; + } else if (typeof then === "function") { + if (isAnyBluebirdPromise(obj)) { + var ret = new Promise(INTERNAL); + obj._then( + ret._fulfill, + ret._reject, + undefined, + ret, + null + ); + return ret; + } + return doThenable(obj, then, context); + } + } + return obj; +} + +function doGetThen(obj) { + return obj.then; +} + +function getThen(obj) { + try { + return doGetThen(obj); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} + +var hasProp = {}.hasOwnProperty; +function isAnyBluebirdPromise(obj) { + return hasProp.call(obj, "_promise0"); +} + +function doThenable(x, then, context) { + var promise = new Promise(INTERNAL); + var ret = promise; + if (context) context._pushContext(); + promise._captureStackTrace(); + if (context) context._popContext(); + var synchronous = true; + var result = util.tryCatch(then).call(x, resolve, reject); + synchronous = false; + + if (promise && result === errorObj) { + promise._rejectCallback(result.e, true, true); + promise = null; + } + + function resolve(value) { + if (!promise) return; + promise._resolveCallback(value); + promise = null; + } + + function reject(reason) { + if (!promise) return; + promise._rejectCallback(reason, synchronous, true); + promise = null; + } + return ret; +} + +return tryConvertToPromise; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/timers.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/timers.js new file mode 100644 index 00000000..1e56acdb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/timers.js @@ -0,0 +1,66 @@ +"use strict"; +module.exports = function(Promise, INTERNAL) { +var util = require("./util"); +var TimeoutError = Promise.TimeoutError; + +var afterTimeout = function (promise, message, parent) { + if (!promise.isPending()) return; + var err; + if (typeof message !== "string") { + if (message instanceof Error) { + err = message; + } else { + err = new TimeoutError("operation timed out"); + } + } else { + err = new TimeoutError(message); + } + util.markAsOriginatingFromRejection(err); + promise._attachExtraTrace(err); + promise._reject(err); + parent.cancel(); +}; + +var afterValue = function(value) { return delay(+this).thenReturn(value); }; +var delay = Promise.delay = function (ms, value) { + var ret; + if (value !== undefined) { + ret = Promise.resolve(value) + ._then(afterValue, null, null, ms, undefined); + } else { + ret = new Promise(INTERNAL); + setTimeout(function() { ret._fulfill(); }, +ms); + } + ret._setAsyncGuaranteed(); + return ret; +}; + +Promise.prototype.delay = function (ms) { + return delay(ms, this); +}; + +function successClear(value) { + var handle = this; + if (handle instanceof Number) handle = +handle; + clearTimeout(handle); + return value; +} + +function failureClear(reason) { + var handle = this; + if (handle instanceof Number) handle = +handle; + clearTimeout(handle); + throw reason; +} + +Promise.prototype.timeout = function (ms, message) { + ms = +ms; + var parent = this.then(); + var ret = parent.then(); + var handle = setTimeout(function timeoutTimeout() { + afterTimeout(ret, message, parent); + }, ms); + return ret._then(successClear, failureClear, undefined, handle, undefined); +}; + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/using.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/using.js new file mode 100644 index 00000000..66167940 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/using.js @@ -0,0 +1,225 @@ +"use strict"; +module.exports = function (Promise, apiRejection, tryConvertToPromise, + createContext, INTERNAL, debug) { + var util = require("./util"); + var TypeError = require("./errors").TypeError; + var inherits = require("./util").inherits; + var errorObj = util.errorObj; + var tryCatch = util.tryCatch; + + function thrower(e) { + setTimeout(function(){throw e;}, 0); + } + + function castPreservingDisposable(thenable) { + var maybePromise = tryConvertToPromise(thenable); + if (maybePromise !== thenable && + typeof thenable._isDisposable === "function" && + typeof thenable._getDisposer === "function" && + thenable._isDisposable()) { + maybePromise._setDisposable(thenable._getDisposer()); + } + return maybePromise; + } + function dispose(resources, inspection) { + var i = 0; + var len = resources.length; + var ret = new Promise(INTERNAL); + function iterator() { + if (i >= len) return ret._fulfill(); + var maybePromise = castPreservingDisposable(resources[i++]); + if (maybePromise instanceof Promise && + maybePromise._isDisposable()) { + try { + maybePromise = tryConvertToPromise( + maybePromise._getDisposer().tryDispose(inspection), + resources.promise); + } catch (e) { + return thrower(e); + } + if (maybePromise instanceof Promise) { + return maybePromise._then(iterator, thrower, + null, null, null); + } + } + iterator(); + } + iterator(); + return ret; + } + + function Disposer(data, promise, context) { + this._data = data; + this._promise = promise; + this._context = context; + } + + Disposer.prototype.data = function () { + return this._data; + }; + + Disposer.prototype.promise = function () { + return this._promise; + }; + + Disposer.prototype.resource = function () { + if (this.promise().isFulfilled()) { + return this.promise().value(); + } + return null; + }; + + Disposer.prototype.tryDispose = function(inspection) { + var resource = this.resource(); + var context = this._context; + if (context !== undefined) context._pushContext(); + var ret = resource !== null + ? this.doDispose(resource, inspection) : null; + if (context !== undefined) context._popContext(); + this._promise._unsetDisposable(); + this._data = null; + return ret; + }; + + Disposer.isDisposer = function (d) { + return (d != null && + typeof d.resource === "function" && + typeof d.tryDispose === "function"); + }; + + function FunctionDisposer(fn, promise, context) { + this.constructor$(fn, promise, context); + } + inherits(FunctionDisposer, Disposer); + + FunctionDisposer.prototype.doDispose = function (resource, inspection) { + var fn = this.data(); + return fn.call(resource, resource, inspection); + }; + + function maybeUnwrapDisposer(value) { + if (Disposer.isDisposer(value)) { + this.resources[this.index]._setDisposable(value); + return value.promise(); + } + return value; + } + + function ResourceList(length) { + this.length = length; + this.promise = null; + this[length-1] = null; + } + + ResourceList.prototype._resultCancelled = function() { + var len = this.length; + for (var i = 0; i < len; ++i) { + var item = this[i]; + if (item instanceof Promise) { + item.cancel(); + } + } + }; + + Promise.using = function () { + var len = arguments.length; + if (len < 2) return apiRejection( + "you must pass at least 2 arguments to Promise.using"); + var fn = arguments[len - 1]; + if (typeof fn !== "function") { + return apiRejection("expecting a function but got " + util.classString(fn)); + } + var input; + var spreadArgs = true; + if (len === 2 && Array.isArray(arguments[0])) { + input = arguments[0]; + len = input.length; + spreadArgs = false; + } else { + input = arguments; + len--; + } + var resources = new ResourceList(len); + for (var i = 0; i < len; ++i) { + var resource = input[i]; + if (Disposer.isDisposer(resource)) { + var disposer = resource; + resource = resource.promise(); + resource._setDisposable(disposer); + } else { + var maybePromise = tryConvertToPromise(resource); + if (maybePromise instanceof Promise) { + resource = + maybePromise._then(maybeUnwrapDisposer, null, null, { + resources: resources, + index: i + }, undefined); + } + } + resources[i] = resource; + } + + var reflectedResources = new Array(resources.length); + for (var i = 0; i < reflectedResources.length; ++i) { + reflectedResources[i] = Promise.resolve(resources[i]).reflect(); + } + + var resultPromise = Promise.all(reflectedResources) + .then(function(inspections) { + for (var i = 0; i < inspections.length; ++i) { + var inspection = inspections[i]; + if (inspection.isRejected()) { + errorObj.e = inspection.error(); + return errorObj; + } else if (!inspection.isFulfilled()) { + resultPromise.cancel(); + return; + } + inspections[i] = inspection.value(); + } + promise._pushContext(); + + fn = tryCatch(fn); + var ret = spreadArgs + ? fn.apply(undefined, inspections) : fn(inspections); + var promiseCreated = promise._popContext(); + debug.checkForgottenReturns( + ret, promiseCreated, "Promise.using", promise); + return ret; + }); + + var promise = resultPromise.lastly(function() { + var inspection = new Promise.PromiseInspection(resultPromise); + return dispose(resources, inspection); + }); + resources.promise = promise; + promise._setOnCancel(resources); + return promise; + }; + + Promise.prototype._setDisposable = function (disposer) { + this._bitField = this._bitField | 131072; + this._disposer = disposer; + }; + + Promise.prototype._isDisposable = function () { + return (this._bitField & 131072) > 0; + }; + + Promise.prototype._getDisposer = function () { + return this._disposer; + }; + + Promise.prototype._unsetDisposable = function () { + this._bitField = this._bitField & (~131072); + this._disposer = undefined; + }; + + Promise.prototype.disposer = function (fn) { + if (typeof fn === "function") { + return new FunctionDisposer(fn, this, createContext()); + } + throw new TypeError(); + }; + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/util.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/util.js new file mode 100644 index 00000000..2f001c02 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/js/release/util.js @@ -0,0 +1,344 @@ +"use strict"; +var es5 = require("./es5"); +var canEvaluate = typeof navigator == "undefined"; + +var errorObj = {e: {}}; +var tryCatchTarget; +function tryCatcher() { + try { + var target = tryCatchTarget; + tryCatchTarget = null; + return target.apply(this, arguments); + } catch (e) { + errorObj.e = e; + return errorObj; + } +} +function tryCatch(fn) { + tryCatchTarget = fn; + return tryCatcher; +} + +var inherits = function(Child, Parent) { + var hasProp = {}.hasOwnProperty; + + function T() { + this.constructor = Child; + this.constructor$ = Parent; + for (var propertyName in Parent.prototype) { + if (hasProp.call(Parent.prototype, propertyName) && + propertyName.charAt(propertyName.length-1) !== "$" + ) { + this[propertyName + "$"] = Parent.prototype[propertyName]; + } + } + } + T.prototype = Parent.prototype; + Child.prototype = new T(); + return Child.prototype; +}; + + +function isPrimitive(val) { + return val == null || val === true || val === false || + typeof val === "string" || typeof val === "number"; + +} + +function isObject(value) { + return typeof value === "function" || + typeof value === "object" && value !== null; +} + +function maybeWrapAsError(maybeError) { + if (!isPrimitive(maybeError)) return maybeError; + + return new Error(safeToString(maybeError)); +} + +function withAppended(target, appendee) { + var len = target.length; + var ret = new Array(len + 1); + var i; + for (i = 0; i < len; ++i) { + ret[i] = target[i]; + } + ret[i] = appendee; + return ret; +} + +function getDataPropertyOrDefault(obj, key, defaultValue) { + if (es5.isES5) { + var desc = Object.getOwnPropertyDescriptor(obj, key); + + if (desc != null) { + return desc.get == null && desc.set == null + ? desc.value + : defaultValue; + } + } else { + return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; + } +} + +function notEnumerableProp(obj, name, value) { + if (isPrimitive(obj)) return obj; + var descriptor = { + value: value, + configurable: true, + enumerable: false, + writable: true + }; + es5.defineProperty(obj, name, descriptor); + return obj; +} + +function thrower(r) { + throw r; +} + +var inheritedDataKeys = (function() { + var excludedPrototypes = [ + Array.prototype, + Object.prototype, + Function.prototype + ]; + + var isExcludedProto = function(val) { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (excludedPrototypes[i] === val) { + return true; + } + } + return false; + }; + + if (es5.isES5) { + var getKeys = Object.getOwnPropertyNames; + return function(obj) { + var ret = []; + var visitedKeys = Object.create(null); + while (obj != null && !isExcludedProto(obj)) { + var keys; + try { + keys = getKeys(obj); + } catch (e) { + return ret; + } + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (visitedKeys[key]) continue; + visitedKeys[key] = true; + var desc = Object.getOwnPropertyDescriptor(obj, key); + if (desc != null && desc.get == null && desc.set == null) { + ret.push(key); + } + } + obj = es5.getPrototypeOf(obj); + } + return ret; + }; + } else { + var hasProp = {}.hasOwnProperty; + return function(obj) { + if (isExcludedProto(obj)) return []; + var ret = []; + + /*jshint forin:false */ + enumeration: for (var key in obj) { + if (hasProp.call(obj, key)) { + ret.push(key); + } else { + for (var i = 0; i < excludedPrototypes.length; ++i) { + if (hasProp.call(excludedPrototypes[i], key)) { + continue enumeration; + } + } + ret.push(key); + } + } + return ret; + }; + } + +})(); + +var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; +function isClass(fn) { + try { + if (typeof fn === "function") { + var keys = es5.names(fn.prototype); + + var hasMethods = es5.isES5 && keys.length > 1; + var hasMethodsOtherThanConstructor = keys.length > 0 && + !(keys.length === 1 && keys[0] === "constructor"); + var hasThisAssignmentAndStaticMethods = + thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; + + if (hasMethods || hasMethodsOtherThanConstructor || + hasThisAssignmentAndStaticMethods) { + return true; + } + } + return false; + } catch (e) { + return false; + } +} + +function toFastProperties(obj) { + /*jshint -W027,-W055,-W031*/ + function FakeConstructor() {} + FakeConstructor.prototype = obj; + var l = 8; + while (l--) new FakeConstructor(); + return obj; + eval(obj); +} + +var rident = /^[a-z$_][a-z$_0-9]*$/i; +function isIdentifier(str) { + return rident.test(str); +} + +function filledRange(count, prefix, suffix) { + var ret = new Array(count); + for(var i = 0; i < count; ++i) { + ret[i] = prefix + i + suffix; + } + return ret; +} + +function safeToString(obj) { + try { + return obj + ""; + } catch (e) { + return "[no string representation]"; + } +} + +function markAsOriginatingFromRejection(e) { + try { + notEnumerableProp(e, "isOperational", true); + } + catch(ignore) {} +} + +function originatesFromRejection(e) { + if (e == null) return false; + return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || + e["isOperational"] === true); +} + +function canAttachTrace(obj) { + return obj instanceof Error && es5.propertyIsWritable(obj, "stack"); +} + +var ensureErrorObject = (function() { + if (!("stack" in new Error())) { + return function(value) { + if (canAttachTrace(value)) return value; + try {throw new Error(safeToString(value));} + catch(err) {return err;} + }; + } else { + return function(value) { + if (canAttachTrace(value)) return value; + return new Error(safeToString(value)); + }; + } +})(); + +function classString(obj) { + return {}.toString.call(obj); +} + +function copyDescriptors(from, to, filter) { + var keys = es5.names(from); + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + if (filter(key)) { + try { + es5.defineProperty(to, key, es5.getDescriptor(from, key)); + } catch (ignore) {} + } + } +} + +var asArray = function(v) { + if (es5.isArray(v)) { + return v; + } + return null; +}; + +if (typeof Symbol !== "undefined" && Symbol.iterator) { + var ArrayFrom = typeof Array.from === "function" ? function(v) { + return Array.from(v); + } : function(v) { + var ret = []; + var it = v[Symbol.iterator](); + var itResult; + while (!((itResult = it.next()).done)) { + ret.push(itResult.value); + } + return ret; + }; + + asArray = function(v) { + if (es5.isArray(v)) { + return v; + } else if (v != null && typeof v[Symbol.iterator] === "function") { + return ArrayFrom(v); + } + return null; + }; +} + +var isNode = typeof process !== "undefined" && + classString(process).toLowerCase() === "[object process]"; + +function env(key, def) { + return isNode ? process.env[key] : def; +} + +var ret = { + isClass: isClass, + isIdentifier: isIdentifier, + inheritedDataKeys: inheritedDataKeys, + getDataPropertyOrDefault: getDataPropertyOrDefault, + thrower: thrower, + isArray: es5.isArray, + asArray: asArray, + notEnumerableProp: notEnumerableProp, + isPrimitive: isPrimitive, + isObject: isObject, + canEvaluate: canEvaluate, + errorObj: errorObj, + tryCatch: tryCatch, + inherits: inherits, + withAppended: withAppended, + maybeWrapAsError: maybeWrapAsError, + toFastProperties: toFastProperties, + filledRange: filledRange, + toString: safeToString, + canAttachTrace: canAttachTrace, + ensureErrorObject: ensureErrorObject, + originatesFromRejection: originatesFromRejection, + markAsOriginatingFromRejection: markAsOriginatingFromRejection, + classString: classString, + copyDescriptors: copyDescriptors, + hasDevTools: typeof chrome !== "undefined" && chrome && + typeof chrome.loadTimes === "function", + isNode: isNode, + env: env +}; +ret.isRecentNode = ret.isNode && (function() { + var version = process.versions.node.split(".").map(Number); + return (version[0] === 0 && version[1] > 10) || (version[0] > 0); +})(); + +if (ret.isNode) ret.toFastProperties(process); + +try {throw new Error(); } catch (e) {ret.lastLineError = e;} +module.exports = ret; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/package.json new file mode 100644 index 00000000..9d4aab0a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/bluebird/package.json @@ -0,0 +1,97 @@ +{ + "name": "bluebird", + "description": "Full featured Promises/A+ implementation with exceptionally good performance", + "version": "3.0.6", + "keywords": [ + "promise", + "performance", + "promises", + "promises-a", + "promises-aplus", + "async", + "await", + "deferred", + "deferreds", + "future", + "flow control", + "dsl", + "fluent interface" + ], + "scripts": { + "lint": "node scripts/jshint.js", + "test": "node tools/test.js", + "istanbul": "istanbul", + "prepublish": "node tools/build.js --no-debug --release --browser --minify", + "generate-browser-core": "node tools/build.js --features=core --no-debug --release --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js" + }, + "homepage": "https://github.com/petkaantonov/bluebird", + "repository": { + "type": "git", + "url": "git://github.com/petkaantonov/bluebird.git" + }, + "bugs": { + "url": "http://github.com/petkaantonov/bluebird/issues" + }, + "license": "MIT", + "author": { + "name": "Petka Antonov", + "email": "petka_antonov@hotmail.com", + "url": "http://github.com/petkaantonov/" + }, + "devDependencies": { + "acorn": "~0.6.0", + "baconjs": "^0.7.43", + "bluebird": "^2.9.2", + "body-parser": "^1.10.2", + "browserify": "^8.1.1", + "cli-table": "~0.3.1", + "co": "^4.2.0", + "cross-spawn": "^0.2.3", + "glob": "^4.3.2", + "grunt-saucelabs": "~8.4.1", + "highland": "^2.3.0", + "istanbul": "^0.3.5", + "jshint": "^2.6.0", + "jshint-stylish": "~0.2.0", + "mkdirp": "~0.5.0", + "mocha": "~2.1", + "open": "~0.0.5", + "optimist": "~0.6.1", + "rimraf": "~2.2.6", + "rx": "^2.3.25", + "serve-static": "^1.7.1", + "sinon": "~1.7.3", + "uglify-js": "~2.4.16", + "kefir": "^2.4.1" + }, + "main": "./js/release/bluebird.js", + "browser": "./js/browser/bluebird.js", + "files": [ + "js/browser", + "js/release", + "LICENSE" + ], + "gitHead": "37393eae4b6c8a48d16b357768e624ce2b347cac", + "_id": "bluebird@3.0.6", + "_shasum": "f2488f325782f66d174842f481992e2faba56f38", + "_from": "bluebird@*", + "_npmVersion": "2.11.1", + "_nodeVersion": "2.3.0", + "_npmUser": { + "name": "esailija", + "email": "petka_antonov@hotmail.com" + }, + "maintainers": [ + { + "name": "esailija", + "email": "petka_antonov@hotmail.com" + } + ], + "dist": { + "shasum": "f2488f325782f66d174842f481992e2faba56f38", + "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-3.0.6.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.0.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/README.md new file mode 100644 index 00000000..f54ddaba --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/README.md @@ -0,0 +1,16 @@ +!nstant-markdown-d +================ +instant-markdown-d is a small Node.js server that enables instant compilation and previewing of Markup files. A plugin can easily be written for any text editor to interface with it. One currently exists for VIm: https://github.com/suan/vim-instant-markdown + +Installation +------------ +- `[sudo] npm -g install instant-markdown-d` + +REST API +-------- +| Action | HTTP Method | Request URL | Request Body | +|---------------------|-------------|---------------------------|--------------------| +| Refresh Markdown on page | PUT | http://localhost:\ | \ | +| Close Webpage | DELETE | http://localhost:\ | | + +By default, `` is 8090 diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/github-markdown.css b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/github-markdown.css new file mode 100644 index 00000000..328bea95 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/github-markdown.css @@ -0,0 +1,758 @@ +@font-face { + font-family: octicons-anchor; + src: url(data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAYcAA0AAAAACjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABMAAAABwAAAAca8vGTk9TLzIAAAFMAAAARAAAAFZG1VHVY21hcAAAAZAAAAA+AAABQgAP9AdjdnQgAAAB0AAAAAQAAAAEACICiGdhc3AAAAHUAAAACAAAAAj//wADZ2x5ZgAAAdwAAADRAAABEKyikaNoZWFkAAACsAAAAC0AAAA2AtXoA2hoZWEAAALgAAAAHAAAACQHngNFaG10eAAAAvwAAAAQAAAAEAwAACJsb2NhAAADDAAAAAoAAAAKALIAVG1heHAAAAMYAAAAHwAAACABEAB2bmFtZQAAAzgAAALBAAAFu3I9x/Nwb3N0AAAF/AAAAB0AAAAvaoFvbwAAAAEAAAAAzBdyYwAAAADP2IQvAAAAAM/bz7t4nGNgZGFgnMDAysDB1Ml0hoGBoR9CM75mMGLkYGBgYmBlZsAKAtJcUxgcPsR8iGF2+O/AEMPsznAYKMwIkgMA5REMOXicY2BgYGaAYBkGRgYQsAHyGMF8FgYFIM0ChED+h5j//yEk/3KoSgZGNgYYk4GRCUgwMaACRoZhDwCs7QgGAAAAIgKIAAAAAf//AAJ4nHWMMQrCQBBF/0zWrCCIKUQsTDCL2EXMohYGSSmorScInsRGL2DOYJe0Ntp7BK+gJ1BxF1stZvjz/v8DRghQzEc4kIgKwiAppcA9LtzKLSkdNhKFY3HF4lK69ExKslx7Xa+vPRVS43G98vG1DnkDMIBUgFN0MDXflU8tbaZOUkXUH0+U27RoRpOIyCKjbMCVejwypzJJG4jIwb43rfl6wbwanocrJm9XFYfskuVC5K/TPyczNU7b84CXcbxks1Un6H6tLH9vf2LRnn8Ax7A5WQAAAHicY2BkYGAA4teL1+yI57f5ysDNwgAC529f0kOmWRiYVgEpDgYmEA8AUzEKsQAAAHicY2BkYGB2+O/AEMPCAAJAkpEBFbAAADgKAe0EAAAiAAAAAAQAAAAEAAAAAAAAKgAqACoAiAAAeJxjYGRgYGBhsGFgYgABEMkFhAwM/xn0QAIAD6YBhwB4nI1Ty07cMBS9QwKlQapQW3VXySvEqDCZGbGaHULiIQ1FKgjWMxknMfLEke2A+IJu+wntrt/QbVf9gG75jK577Lg8K1qQPCfnnnt8fX1NRC/pmjrk/zprC+8D7tBy9DHgBXoWfQ44Av8t4Bj4Z8CLtBL9CniJluPXASf0Lm4CXqFX8Q84dOLnMB17N4c7tBo1AS/Qi+hTwBH4rwHHwN8DXqQ30XXAS7QaLwSc0Gn8NuAVWou/gFmnjLrEaEh9GmDdDGgL3B4JsrRPDU2hTOiMSuJUIdKQQayiAth69r6akSSFqIJuA19TrzCIaY8sIoxyrNIrL//pw7A2iMygkX5vDj+G+kuoLdX4GlGK/8Lnlz6/h9MpmoO9rafrz7ILXEHHaAx95s9lsI7AHNMBWEZHULnfAXwG9/ZqdzLI08iuwRloXE8kfhXYAvE23+23DU3t626rbs8/8adv+9DWknsHp3E17oCf+Z48rvEQNZ78paYM38qfk3v/u3l3u3GXN2Dmvmvpf1Srwk3pB/VSsp512bA/GG5i2WJ7wu430yQ5K3nFGiOqgtmSB5pJVSizwaacmUZzZhXLlZTq8qGGFY2YcSkqbth6aW1tRmlaCFs2016m5qn36SbJrqosG4uMV4aP2PHBmB3tjtmgN2izkGQyLWprekbIntJFing32a5rKWCN/SdSoga45EJykyQ7asZvHQ8PTm6cslIpwyeyjbVltNikc2HTR7YKh9LBl9DADC0U/jLcBZDKrMhUBfQBvXRzLtFtjU9eNHKin0x5InTqb8lNpfKv1s1xHzTXRqgKzek/mb7nB8RZTCDhGEX3kK/8Q75AmUM/eLkfA+0Hi908Kx4eNsMgudg5GLdRD7a84npi+YxNr5i5KIbW5izXas7cHXIMAau1OueZhfj+cOcP3P8MNIWLyYOBuxL6DRylJ4cAAAB4nGNgYoAALjDJyIAOWMCiTIxMLDmZedkABtIBygAAAA==) format('woff'); +} + +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100% +} + +body { + min-width: 1020px; + font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; + /* color: #333; */ + background-color: #fff; +} + +table { + border-collapse: collapse; + border-spacing: 0 +} + +td,th { + padding: 0 +} + +* { + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.container { + width: 980px; + margin-right: auto; + margin-left: auto +} + +.container:before { + display: table; + content: "" +} + +.container:after { + display: table; + clear: both; + content: "" +} + +.boxed-group { + position: relative; + border-radius: 3px; + margin-bottom: 30px +} + +#readme .markdown-body, #readme .plain { + background-color: #fff; + border: 1px solid #ddd; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; + padding: 30px; + word-wrap: break-word; +} + +#readme .plain pre { + font-size: 15px; + white-space: pre-wrap +} + +.repository-with-sidebar:before { + display: table; + content: "" +} + +.repository-with-sidebar:after { + display: table; + clear: both; + content: "" +} + +.repository-with-sidebar .repository-sidebar { + float: right; + width: 38px +} + +.repository-with-sidebar .repository-sidebar .sidebar-button { + width: 100%; + margin: 0 0 10px; + text-align: center +} + +.repository-with-sidebar .repository-sidebar h3 { + margin-bottom: 5px; + font-size: 11px; + font-weight: normal; + color: #999 +} + +.repository-with-sidebar .repository-sidebar .clone-url { + display: none; + margin-top: -5px +} + +.repository-with-sidebar .repository-sidebar .clone-url.open { + display: block +} + +.repository-with-sidebar .repository-sidebar .clone-options { + margin: 8px 0 15px; + font-size: 11px; + color: #666 +} + +.repository-with-sidebar .repository-sidebar .clone-options .octicon-question { + position: relative; + bottom: 1px; + font-size: 11px; + color: #000; + cursor: pointer +} + +.repository-with-sidebar .repository-content { + /* float: left; */ + width: 920px; +} + +.repository-with-sidebar.with-full-navigation .repository-content { + width: 790px; +} + +.repository-with-sidebar.with-full-navigation .repository-sidebar { + width: 170px +} + +.repository-with-sidebar.with-full-navigation .sunken-menu-group .tooltipped:before, .repository-with-sidebar.with-full-navigation .sunken-menu-group .tooltipped:after { + display: none +} + +.markdown-body { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + color: #333; + overflow: hidden; + font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif; + font-size: 16px; + line-height: 1.6; + word-wrap: break-word; +} + +.markdown-body a { + background: transparent; +} + +.markdown-body a:active, +.markdown-body a:hover { + outline: 0; +} + +.markdown-body strong { + font-weight: bold; +} + +.markdown-body h1 { + font-size: 2em; + margin: 0.67em 0; +} + +.markdown-body img { + border: 0; +} + +.markdown-body hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} + +.markdown-body pre { + overflow: auto; +} + +.markdown-body code, +.markdown-body kbd, +.markdown-body pre { + font-family: monospace, monospace; + font-size: 1em; +} + +.markdown-body input { + color: inherit; + font: inherit; + margin: 0; +} + +.markdown-body html input[disabled] { + cursor: default; +} + +.markdown-body input { + line-height: normal; +} + +.markdown-body input[type="checkbox"] { + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} + +.markdown-body table { + border-collapse: collapse; + border-spacing: 0; +} + +.markdown-body td, +.markdown-body th { + padding: 0; +} + +.markdown-body * { + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.markdown-body input { + font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol"; +} + +.markdown-body a { + color: #4183c4; + text-decoration: none; +} + +.markdown-body a:hover, +.markdown-body a:focus, +.markdown-body a:active { + text-decoration: underline; +} + +.markdown-body hr { + height: 0; + margin: 15px 0; + overflow: hidden; + background: transparent; + border: 0; + border-bottom: 1px solid #ddd; +} + +.markdown-body hr:before { + display: table; + content: ""; +} + +.markdown-body hr:after { + display: table; + clear: both; + content: ""; +} + +.markdown-body h1, +.markdown-body h2, +.markdown-body h3, +.markdown-body h4, +.markdown-body h5, +.markdown-body h6 { + margin-top: 15px; + margin-bottom: 15px; + line-height: 1.1; +} + +.markdown-body h1 { + font-size: 30px; +} + +.markdown-body h2 { + font-size: 21px; +} + +.markdown-body h3 { + font-size: 16px; +} + +.markdown-body h4 { + font-size: 14px; +} + +.markdown-body h5 { + font-size: 12px; +} + +.markdown-body h6 { + font-size: 11px; +} + +.markdown-body blockquote { + margin: 0; +} + +.markdown-body ul, +.markdown-body ol { + padding: 0; + margin-top: 0; + margin-bottom: 0; +} + +.markdown-body ol ol, +.markdown-body ul ol { + list-style-type: lower-roman; +} + +.markdown-body ul ul ol, +.markdown-body ul ol ol, +.markdown-body ol ul ol, +.markdown-body ol ol ol { + list-style-type: lower-alpha; +} + +.markdown-body dd { + margin-left: 0; +} + +.markdown-body code { + font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace; +} + +.markdown-body pre { + margin-top: 0; + margin-bottom: 0; + font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace; +} + +.markdown-body .octicon { + font: normal normal 16px octicons-anchor; + line-height: 1; + display: inline-block; + text-decoration: none; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.markdown-body .octicon-link:before { + content: '\f05c'; +} + +.markdown-body>*:first-child { + margin-top: 0 !important; +} + +.markdown-body>*:last-child { + margin-bottom: 0 !important; +} + +.markdown-body .anchor { + position: absolute; + top: 0; + bottom: 0; + left: 0; + display: block; + padding-right: 6px; + padding-left: 30px; + margin-left: -30px; +} + +.markdown-body .anchor:focus { + outline: none; +} + +.markdown-body h1, +.markdown-body h2, +.markdown-body h3, +.markdown-body h4, +.markdown-body h5, +.markdown-body h6 { + position: relative; + margin-top: 1em; + margin-bottom: 16px; + font-weight: bold; + line-height: 1.4; +} + +.markdown-body h1 .octicon-link, +.markdown-body h2 .octicon-link, +.markdown-body h3 .octicon-link, +.markdown-body h4 .octicon-link, +.markdown-body h5 .octicon-link, +.markdown-body h6 .octicon-link { + display: none; + color: #000; + vertical-align: middle; +} + +.markdown-body h1:hover .anchor, +.markdown-body h2:hover .anchor, +.markdown-body h3:hover .anchor, +.markdown-body h4:hover .anchor, +.markdown-body h5:hover .anchor, +.markdown-body h6:hover .anchor { + padding-left: 8px; + margin-left: -30px; + line-height: 1; + text-decoration: none; +} + +.markdown-body h1:hover .anchor .octicon-link, +.markdown-body h2:hover .anchor .octicon-link, +.markdown-body h3:hover .anchor .octicon-link, +.markdown-body h4:hover .anchor .octicon-link, +.markdown-body h5:hover .anchor .octicon-link, +.markdown-body h6:hover .anchor .octicon-link { + display: inline-block; +} + +.markdown-body h1 { + padding-bottom: 0.3em; + font-size: 2.25em; + line-height: 1.2; + border-bottom: 1px solid #eee; +} + +.markdown-body h2 { + padding-bottom: 0.3em; + font-size: 1.75em; + line-height: 1.225; + border-bottom: 1px solid #eee; +} + +.markdown-body h3 { + font-size: 1.5em; + line-height: 1.43; +} + +.markdown-body h4 { + font-size: 1.25em; +} + +.markdown-body h5 { + font-size: 1em; +} + +.markdown-body h6 { + font-size: 1em; + color: #777; +} + +.markdown-body p, +.markdown-body blockquote, +.markdown-body ul, +.markdown-body ol, +.markdown-body dl, +.markdown-body table, +.markdown-body pre { + margin-top: 0; + margin-bottom: 16px; +} + +.markdown-body hr { + height: 4px; + padding: 0; + margin: 16px 0; + background-color: #e7e7e7; + border: 0 none; +} + +.markdown-body ul, +.markdown-body ol { + padding-left: 2em; +} + +.markdown-body ul ul, +.markdown-body ul ol, +.markdown-body ol ol, +.markdown-body ol ul { + margin-top: 0; + margin-bottom: 0; +} + +.markdown-body li>p { + margin-top: 16px; +} + +.markdown-body dl { + padding: 0; +} + +.markdown-body dl dt { + padding: 0; + margin-top: 16px; + font-size: 1em; + font-style: italic; + font-weight: bold; +} + +.markdown-body dl dd { + padding: 0 16px; + margin-bottom: 16px; +} + +.markdown-body blockquote { + padding: 0 15px; + color: #777; + border-left: 4px solid #ddd; +} + +.markdown-body blockquote>:first-child { + margin-top: 0; +} + +.markdown-body blockquote>:last-child { + margin-bottom: 0; +} + +.markdown-body table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + word-break: keep-all; +} + +.markdown-body table th { + font-weight: bold; +} + +.markdown-body table th, +.markdown-body table td { + padding: 6px 13px; + border: 1px solid #ddd; +} + +.markdown-body table tr { + background-color: #fff; + border-top: 1px solid #ccc; +} + +.markdown-body table tr:nth-child(2n) { + background-color: #f8f8f8; +} + +.markdown-body img { + max-width: 100%; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.markdown-body code { + padding: 0; + padding-top: 0.2em; + padding-bottom: 0.2em; + margin: 0; + font-size: 85%; + background-color: rgba(0,0,0,0.04); + border-radius: 3px; +} + +.markdown-body code:before, +.markdown-body code:after { + letter-spacing: -0.2em; + content: "\00a0"; +} + +.markdown-body pre>code { + padding: 0; + margin: 0; + font-size: 100%; + word-break: normal; + white-space: pre; + background: transparent; + border: 0; +} + +.markdown-body .highlight { + margin-bottom: 16px; +} + +.markdown-body .highlight pre, +.markdown-body pre { + padding: 16px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + background-color: #f7f7f7; + border-radius: 3px; +} + +.markdown-body .highlight pre { + margin-bottom: 0; + word-break: normal; +} + +.markdown-body pre { + word-wrap: normal; +} + +.markdown-body pre code { + display: inline; + max-width: initial; + padding: 0; + margin: 0; + overflow: initial; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0; +} + +.markdown-body pre code:before, +.markdown-body pre code:after { + content: normal; +} + +.markdown-body .pl-c { + color: #969896; +} + +.markdown-body .pl-c1, +.markdown-body .pl-mdh, +.markdown-body .pl-mm, +.markdown-body .pl-mp, +.markdown-body .pl-mr, +.markdown-body .pl-s1 .pl-v, +.markdown-body .pl-s3, +.markdown-body .pl-sc, +.markdown-body .pl-sv { + color: #0086b3; +} + +.markdown-body .pl-e, +.markdown-body .pl-en { + color: #795da3; +} + +.markdown-body .pl-s1 .pl-s2, +.markdown-body .pl-smi, +.markdown-body .pl-smp, +.markdown-body .pl-stj, +.markdown-body .pl-vo, +.markdown-body .pl-vpf { + color: #333; +} + +.markdown-body .pl-ent { + color: #63a35c; +} + +.markdown-body .pl-k, +.markdown-body .pl-s, +.markdown-body .pl-st { + color: #a71d5d; +} + +.markdown-body .pl-pds, +.markdown-body .pl-s1, +.markdown-body .pl-s1 .pl-pse .pl-s2, +.markdown-body .pl-sr, +.markdown-body .pl-sr .pl-cce, +.markdown-body .pl-sr .pl-sra, +.markdown-body .pl-sr .pl-sre, +.markdown-body .pl-src, +.markdown-body .pl-v { + color: #df5000; +} + +.markdown-body .pl-id { + color: #b52a1d; +} + +.markdown-body .pl-ii { + background-color: #b52a1d; + color: #f8f8f8; +} + +.markdown-body .pl-sr .pl-cce { + color: #63a35c; + font-weight: bold; +} + +.markdown-body .pl-ml { + color: #693a17; +} + +.markdown-body .pl-mh, +.markdown-body .pl-mh .pl-en, +.markdown-body .pl-ms { + color: #1d3e81; + font-weight: bold; +} + +.markdown-body .pl-mq { + color: #008080; +} + +.markdown-body .pl-mi { + color: #333; + font-style: italic; +} + +.markdown-body .pl-mb { + color: #333; + font-weight: bold; +} + +.markdown-body .pl-md, +.markdown-body .pl-mdhf { + background-color: #ffecec; + color: #bd2c00; +} + +.markdown-body .pl-mdht, +.markdown-body .pl-mi1 { + background-color: #eaffea; + color: #55a532; +} + +.markdown-body .pl-mdr { + color: #795da3; + font-weight: bold; +} + +.markdown-body .pl-mo { + color: #1d3e81; +} + +.markdown-body kbd { + background-color: #e7e7e7; + background-image: -webkit-linear-gradient(#fefefe, #e7e7e7); + background-image: linear-gradient(#fefefe, #e7e7e7); + background-repeat: repeat-x; + display: inline-block; + padding: 3px 5px; + font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 10px; + color: #000; + border: 1px solid #cfcfcf; + border-radius: 2px; +} + +.markdown-body .task-list-item { + list-style-type: none; +} + +.markdown-body .task-list-item+.task-list-item { + margin-top: 3px; +} + +.markdown-body .task-list-item input { + float: left; + margin: 0.3em 0 0.25em -1.6em; + vertical-align: middle; +} + +.markdown-body :checked+.radio-label { + z-index: 1; + position: relative; + border-color: #4183c4; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/github-syntax-highlight.css b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/github-syntax-highlight.css new file mode 100644 index 00000000..7cc0e7a2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/github-syntax-highlight.css @@ -0,0 +1,121 @@ +/* + +github.com style (c) Vasily Polovnyov + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + color: #333; + background: #f8f8f8; + -webkit-text-size-adjust: none; +} + +.hljs-comment, +.diff .hljs-header, +.hljs-javadoc { + color: #998; + font-style: italic; +} + +.hljs-keyword, +.css .rule .hljs-keyword, +.hljs-winutils, +.nginx .hljs-title, +.hljs-subst, +.hljs-request, +.hljs-status { + color: #a71d5d; +} + +.hljs-number, +.hljs-hexcolor, +.ruby .hljs-constant { + color: #0086b3; +} + +.hljs-string, +.hljs-tag .hljs-value, +.hljs-phpdoc, +.hljs-dartdoc, +.tex .hljs-formula { + color: #df5000; +} + +.hljs-title, +.hljs-id, +.scss .hljs-preprocessor { + color: #900; +} + +.hljs-list .hljs-keyword, +.hljs-subst { + font-weight: normal; +} + +.hljs-class .hljs-title, +.hljs-type, +.vhdl .hljs-literal, +.tex .hljs-command { + color: #795da3; +} + +.hljs-tag, +.hljs-tag .hljs-title, +.hljs-rules .hljs-property, +.django .hljs-tag .hljs-keyword { + color: #000080; + font-weight: normal; +} + +.hljs-attribute, +.hljs-variable, +.lisp .hljs-body { + color: #008080; +} + +.hljs-regexp { + color: #009926; +} + +.hljs-symbol, +.ruby .hljs-symbol .hljs-string, +.lisp .hljs-keyword, +.clojure .hljs-keyword, +.scheme .hljs-keyword, +.tex .hljs-special, +.hljs-prompt { + color: #990073; +} + +.hljs-built_in { + color: #795da3; +} + +.hljs-preprocessor, +.hljs-pragma, +.hljs-pi, +.hljs-doctype, +.hljs-shebang, +.hljs-cdata { + color: #999; + font-weight: bold; +} + +.hljs-deletion { + background: #fdd; +} + +.hljs-addition { + background: #dfd; +} + +.diff .hljs-change { + background: #0086b3; +} + +.hljs-chunk { + color: #aaa; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/index.html b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/index.html new file mode 100644 index 00000000..97642a67 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/index.html @@ -0,0 +1,50 @@ + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/instant-markdown-d b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/instant-markdown-d new file mode 100755 index 00000000..c75208fd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/instant-markdown-d @@ -0,0 +1,101 @@ +#!/bin/sh +':' //; exec "`command -v nodejs || command -v node`" "$0" + +var MarkdownIt = require('markdown-it'); +var hljs = require('highlight.js'); +var server = require('http').createServer(httpHandler), + exec = require('child_process').exec, + io = require('socket.io').listen(server), + send = require('send'), + server, + socket; + +server.listen(8090); + +var md = new MarkdownIt({ + html: true, + linkify: true, + highlight: function(str, lang) { + if (lang && hljs.getLanguage(lang)) { + try { + return hljs.highlight(lang, str).value; + } catch (err) { + // Do nothing + } + } else { + return str; + } + } +}); + +function writeMarkdown(input, output) { + var body = ''; + input.on('data', function(data) { + body += data; + if (body.length > 1e6) { + throw new Error('The request body is too long.'); + } + }); + input.on('end', function() { + output.emit('newContent', md.render(body)); + }); +} + +function httpHandler(req, res) { + switch(req.method) + { + case 'GET': + // Example: /my-repo/raw/master/sub-dir/some.png + var githubUrl = req.url.match(/\/[^\/]+\/raw\/[^\/]+\/(.+)/); + if (githubUrl) { + // Serve the file out of the current working directory + send(req, githubUrl[1]) + .root(process.cwd()) + .pipe(res); + return; + } + + // Otherwise serve the file from the directory this module is in + send(req, req.url) + .root(__dirname) + .pipe(res); + break; + + // case 'HEAD': + // res.writeHead(200); + // res.end(); + // exec('open -g http://localhost:8090', function(error, stdout, stderr){ + // http.request({port: 8090}) + // }); + // break; + + case 'DELETE': + socket.emit('die'); + process.exit(); + break; + + case 'PUT': + writeMarkdown(req, socket); + res.writeHead(200); + res.end(); + break; + + default: + } +} + +io.set('log level', 1); +io.sockets.on('connection', function(sock){ + socket = sock; + process.stdout.write('connection established!'); + writeMarkdown(process.stdin, socket); + process.stdin.resume(); +}); + + +if (process.platform.toLowerCase().indexOf('darwin') >= 0){ + exec('open -g http://localhost:8090', function(error, stdout, stderr){}); +} +else { // assume unix/linux + exec('xdg-open http://localhost:8090', function(error, stdout, stderr){}); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/.bin/markdown-it b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/.bin/markdown-it new file mode 100755 index 00000000..290c3ae1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/.bin/markdown-it @@ -0,0 +1,105 @@ +#!/usr/bin/env node +/*eslint no-console:0*/ + +'use strict'; + + +var fs = require('fs'); +var argparse = require('argparse'); + + +//////////////////////////////////////////////////////////////////////////////// + +var cli = new argparse.ArgumentParser({ + prog: 'markdown-it', + version: require('../package.json').version, + addHelp: true +}); + +cli.addArgument([ '--no-html' ], { + help: 'Disable embedded HTML', + action: 'storeTrue' +}); + +cli.addArgument([ '-l', '--linkify' ], { + help: 'Autolink text', + action: 'storeTrue' +}); + +cli.addArgument([ '-t', '--typographer' ], { + help: 'Enable smartquotes and other typographic replacements', + action: 'storeTrue' +}); + +cli.addArgument([ '--trace' ], { + help: 'Show stack trace on error', + action: 'storeTrue' +}); + +cli.addArgument([ 'file' ], { + help: 'File to read', + nargs: '?', + defaultValue: '-' +}); + +var options = cli.parseArgs(); + + +function readFile(filename, encoding, callback) { + if (options.file === '-') { + // read from stdin + var chunks = []; + + process.stdin.on('data', function(chunk) { chunks.push(chunk); }); + + process.stdin.on('end', function() { + return callback(null, Buffer.concat(chunks).toString(encoding)); + }); + } else { + fs.readFile(filename, encoding, callback); + } +} + + +//////////////////////////////////////////////////////////////////////////////// + +readFile(options.file, 'utf8', function (err, input) { + var output, md; + + if (err) { + if (err.code === 'ENOENT') { + console.error('File not found: ' + options.file); + process.exit(2); + } + + console.error( + options.trace && err.stack || + err.message || + String(err)); + + process.exit(1); + } + + md = require('..')({ + html: !options['no-html'], + xhtmlOut: false, + typographer: options.typographer, + linkify: options.linkify + }); + + try { + output = md.render(input); + + } catch (e) { + console.error( + options.trace && e.stack || + e.message || + String(e)); + + process.exit(1); + } + + process.stdout.write(output); + + process.exit(0); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/LICENSE new file mode 100644 index 00000000..422deb73 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2006, Ivan Sagalaev +All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of highlight.js nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/README.md new file mode 100644 index 00000000..e03877bf --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/README.md @@ -0,0 +1,106 @@ +# Highlight.js + +[![Build Status](https://travis-ci.org/isagalaev/highlight.js.svg?branch=master)](https://travis-ci.org/isagalaev/highlight.js) + +Highlight.js is a syntax highlighter written in JavaScript. It works in +the browser as well as on the server. It works with pretty much any +markup, doesn’t depend on any framework and has automatic language +detection. + +## Getting Started + +The bare minimum for using highlight.js on a web page is linking to the +library along with one of the styles and calling +[`initHighlightingOnLoad`][1]: + +```html + + + +``` + +This will find and highlight code inside of `
` tags; it tries
+to detect the language automatically. If automatic detection doesn’t
+work for you, you can specify the language in the `class` attribute:
+
+```html
+
...
+``` + +The list of supported language classes is available in the [class +reference][2]. Classes can also be prefixed with either `language-` or +`lang-`. + +To disable highlighting altogether use the `nohighlight` class: + +```html +
...
+``` + +## Custom Initialization + +When you need a bit more control over the initialization of +highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4] +functions. This allows you to control *what* to highlight and *when*. + +Here’s an equivalent way to calling [`initHighlightingOnLoad`][1] using +jQuery: + +```javascript +$(document).ready(function() { + $('pre code').each(function(i, block) { + hljs.highlightBlock(block); + }); +}); +``` + +You can use any tags instead of `
` to mark up your code. If
+you don't use a container that preserve line breaks you will need to
+configure highlight.js to use the `
` tag: + +```javascript +hljs.configure({useBR: true}); + +$('div.code').each(function(i, block) { + hljs.highlightBlock(block); +}); +``` + +For other options refer to the documentation for [`configure`][4]. + +## Getting the Library + +You can get highlight.js as a hosted, or custom-build, browser script or +as a server module. Right out of the box the browser script supports +both AMD and CommonJS, so if you wish you can use RequireJS or +Browserify without having to build from source. The server module also +works perfectly fine with Browserify, but there is the option to use a +build specific to browsers rather than something meant for a server. +Head over to the [download page][5] for all the options. + +**Note:** the library is not supposed to work straight from the source +on GitHub; it requires building. If none of the pre-packaged options +work for you refer to the [building documentation][6]. + +## License + +Highlight.js is released under the BSD License. See [LICENSE][7] file +for details. + +## Links + +The official site for the library is at . + +Further in-depth documentation for the API and other topics is at +. + +Authors and contributors are listed in the [AUTHORS.en.txt][8] file. + +[1]: http://highlightjs.readthedocs.org/en/latest/api.html#inithighlightingonload +[2]: http://highlightjs.readthedocs.org/en/latest/css-classes-reference.html +[3]: http://highlightjs.readthedocs.org/en/latest/api.html#highlightblock-block +[4]: http://highlightjs.readthedocs.org/en/latest/api.html#configure-options +[5]: https://highlightjs.org/download/ +[6]: http://highlightjs.readthedocs.org/en/latest/building-testing.html +[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE +[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.en.txt diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/api.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/api.rst new file mode 100644 index 00000000..d8039539 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/api.rst @@ -0,0 +1,120 @@ +Library API +=========== + +Highlight.js exports a few functions as methods of the ``hljs`` object. + + +``highlight(name, value, ignore_illegals, continuation)`` +--------------------------------------------------------- + +Core highlighting function. +Accepts a language name, or an alias, and a string with the code to highlight. +The ``ignore_illegals`` parameter, when present and evaluates to a true value, +forces highlighting to finish even in case of detecting illegal syntax for the +language instead of throwing an exception. +The ``continuation`` is an optional mode stack representing unfinished parsing. +When present, the function will restart parsing from this state instead of +initializing a new one. +Returns an object with the following properties: + +* ``language``: language name, same as the one passed into a function, returned for consistency with ``highlightAuto`` +* ``relevance``: integer value +* ``value``: HTML string with highlighting markup +* ``top``: top of the current mode stack + + +``highlightAuto(value, languageSubset)`` +---------------------------------------- + +Highlighting with language detection. +Accepts a string with the code to highlight and an optional array of language names and aliases restricting detection to only those languages. The subset can also be set with ``configure``, but the local parameter overrides the option if set. +Returns an object with the following properties: + +* ``language``: detected language +* ``relevance``: integer value +* ``value``: HTML string with highlighting markup +* ``second_best``: object with the same structure for second-best heuristically detected language, may be absent + + +``fixMarkup(value)`` +-------------------- + +Post-processing of the highlighted markup. Currently consists of replacing indentation TAB characters and using ``
`` tags instead of new-line characters. Options are set globally with ``configure``. + +Accepts a string with the highlighted markup. + + +``highlightBlock(block)`` +------------------------- + +Applies highlighting to a DOM node containing code. + +This function is the one to use to apply highlighting dynamically after page load +or within initialization code of third-party Javascript frameworks. + +The function uses language detection by default but you can specify the language +in the ``class`` attribute of the DOM node. See the :doc:`class reference +` for all available language names and aliases. + + +``configure(options)`` +---------------------- + +Configures global options: + +* ``tabReplace``: a string used to replace TAB characters in indentation. +* ``useBR``: a flag to generate ``
`` tags instead of new-line characters in the output, useful when code is marked up using a non-``
`` container.
+* ``classPrefix``: a string prefix added before class names in the generated markup, used for backwards compatibility with stylesheets.
+* ``languages``: an array of language names and aliases restricting auto detection to only these languages.
+
+Accepts an object representing options with the values to updated. Other options don't change
+::
+
+  hljs.configure({
+    tabReplace: '    ', // 4 spaces
+    classPrefix: ''     // don't append class prefix
+                        // … other options aren't changed
+  })
+  hljs.initHighlighting();
+
+
+``initHighlighting()``
+----------------------
+
+Applies highlighting to all ``
..
`` blocks on a page. + + + +``initHighlightingOnLoad()`` +---------------------------- + +Attaches highlighting to the page load event. + + +``registerLanguage(name, language)`` +------------------------------------ + +Adds new language to the library under the specified name. Used mostly internally. + +* ``name``: a string with the name of the language being registered +* ``language``: a function that returns an object which represents the + language definition. The function is passed the ``hljs`` object to be able + to use common regular expressions defined within it. + + +``listLanguages()`` +---------------------------- + +Returns the languages names list. + + + +.. _getLanguage: + + +``getLanguage(name)`` +--------------------- + +Looks up a language by name or alias. + +Returns the language object if found, ``undefined`` otherwise. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/building-testing.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/building-testing.rst new file mode 100644 index 00000000..16292cb8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/building-testing.rst @@ -0,0 +1,88 @@ +Building and testing +==================== + +To actually run highlight.js it is necessary to build it for the environment +where you're going to run it: a browser, the node.js server, etc. + + +Building +-------- + +The build tool is written in JavaScript using node.js. Before running the +script, make sure to have node installed and run ``npm install`` to get the +dependencies. + +The tool is located in ``tools/build.js``. A few useful examples: + +* Build for a browser using only common languages:: + + node tools/build.js :common + +* Build for node.js including all available languages:: + + node tools/build.js -t node + +* Build two specific languages for debugging, skipping compression in this case:: + + node tools/build.js -n python ruby + +On some systems the node binary is named ``nodejs``; simply replace ``node`` +with ``nodejs`` in the examples above if that is the case. + +The full option reference is available with the usual ``--help`` option. + +The build result will be in the ``build/`` directory. + +.. _basic-testing: + +Basic testing +------------- + +The usual approach to debugging and testing a language is first doing it +visually. You need to build highlight.js with only the language you're working +on (without compression, to have readable code in browser error messages) and +then use the Developer tool in ``tools/developer.html`` to see how it highlights +a test snippet in that language. + +A test snippet should be short and give the idea of the overall look of the +language. It shouldn't include every possible syntactic element and shouldn't +even make practical sense. + +After you satisfied with the result you need to make sure that language +detection still works with your language definition included in the whole suite. + +Testing is done using `Mocha `_ and the +files are found in the ``test/`` directory. You can use the node build to +run the tests in the command line with ``npm test`` after installing the +dependencies with ``npm install``. + +**Note**: for Debian-based machine, like Ubuntu, you might need to create an +alias or symbolic link for nodejs to node. The reason for this is the +dependencies that are requires to test highlight.js has a reference to +"node". + +Place the snippet you used inside the browser in +``test/detect//default.txt``, build the package with all the languages +for node and run the test suite. If your language breaks auto-detection, it +should be fixed by :ref:`improving relevance `, which is a black art +in and of itself. When in doubt, please refer to the discussion group! + + +Testing markup +-------------- + +You can also provide additional markup tests for the language to test isolated +cases of various syntactic construct. If your language has 19 different string +literals or complicated heuristics for telling division (``/``) apart from +regexes (``/ .. /``) -- this is the place. + +A test case consists of two files: + +* ``test/markup//.txt``: test code +* ``test/markup//.expect.txt``: reference rendering + +To generate reference rendering use the Developer tool located at +``tools/developer.html``. Make sure to explicitly select your language in the +drop-down menu, as automatic detection is unlikely to work in this case. + + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/css-classes-reference.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/css-classes-reference.rst new file mode 100644 index 00000000..1b28d36e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/css-classes-reference.rst @@ -0,0 +1,1558 @@ +CSS classes reference +===================== + +This is a full list of available classes corresponding to languages' +syntactic structures. The parentheses after language name contain identifiers +used as class names in ```` element. + + +Gams ("gms", "gams") +-------------------- + +* ``section``: section +* ``keyword``: keyword +* ``number``: number +* ``string``: string + + +Python ("python", "py", "gyp") +------------------------------ + +* ``keyword``: keyword +* ``built_in``: built-in objects (None, False, True and Ellipsis) +* ``number``: number +* ``string``: string (of any type) +* ``comment``: comment +* ``decorator``: @-decorator for functions +* ``function``: function header "def some_name(...):" +* ``class``: class header "class SomeName(...):" +* ``title``: name of a function or a class inside a header +* ``params``: everything inside parentheses in a function's or class' header + +Python profiler results ("profile") +----------------------------------- + +* ``number``: number +* ``string``: string +* ``built_in``: built-in function entry +* ``filename``: filename in an entry +* ``summary``: profiling summary +* ``header``: header of table of results +* ``keyword``: column header +* ``function``: function name in an entry (including parentheses) +* ``title``: actual name of a function in an entry (excluding parentheses) +* ``prompt``: interpreter prompt (>>> or ...) + +Ruby ("ruby", "rb", "gemspec", "podspec", "thor", "irb") +-------------------------------------------------------- + +* ``keyword``: keyword +* ``string``: string +* ``subst``: in-string substitution (#{...}) +* ``comment``: comment +* ``doctag``: YARD doctag +* ``function``: function header "def some_name(...):" +* ``class``: class header "class SomeName(...):" +* ``title``: name of a function or a class inside a header +* ``parent``: name of a parent class +* ``symbol``: symbol +* ``input``: complete input line (interpreter) +* ``output``: complete output line (interpreter) +* ``prompt``: interpreter prompt (>>) +* ``status``: interpreter response (=>) + +Haml ("haml") +------------- + +* ``tag``: any tag starting with "%" +* ``title``: tag's name +* ``attribute``: tag's attribute +* ``keyword``: tag's attribute that is a keyword +* ``string``: attribute's value that is a string +* ``value``: attribute's value, shorthand id or class for tag +* ``comment``: comment +* ``doctype``: !!! declaration +* ``bullet``: line defined by variable + +Perl ("perl", "pl") +------------------- + +* ``keyword``: keyword +* ``comment``: comment +* ``number``: number +* ``string``: string +* ``regexp``: regular expression +* ``sub``: subroutine header (from "sub" till "{") +* ``variable``: variable starting with "$", "%", "@" +* ``operator``: operator +* ``pod``: plain old doc + +PHP ("php", "php3", "php4", "php5", "php6") +------------------------------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string (of any type) +* ``comment``: comment +* ``doctag``: phpdoc params in comments +* ``variable``: variable starting with "$" +* ``preprocessor``: preprocessor marks: "" +* ``class``: class header +* ``function``: header of a function +* ``title``: name of a function inside a header +* ``params``: parentheses and everything inside them in a function's header + +Scala ("scala") +--------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``doctag``: @-tag in javadoc comment +* ``annotation``: annotation +* ``class``: class header +* ``title``: class name inside a header +* ``params``: everything in parentheses inside a class header +* ``inheritance``: keywords "extends" and "with" inside class header + +Groovy ("groovy") +----------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string, map string keys and named argument labels +* ``regex``: regular expression +* ``comment``: comment +* ``doctag``: @-tag in javadoc comment +* ``annotation``: annotation +* ``class``: class header +* ``title``: class name inside a header +* ``label``: label +* ``shebang``: Groovy shell script header + +Go ("go", "golang") +------------------- + +* ``comment``: comment +* ``string``: string constant +* ``number``: number +* ``keyword``: language keywords +* ``constant``: true false nil iota +* ``typename``: built-in plain types (int, string etc.) +* ``built_in``: built-in functions + +Golo ("golo", "gololang") +------------------- + +* ``keyword``: language keywords +* ``literal``: true false null +* ``typename``: Golo type objects (DynamicObject, struct, ...) +* ``annotation``: decorator + +Gradle ("gradle") +----------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string and character +* ``comment``: comment +* ``regexp``: regular expression + + +HTML, XML ("xml", "html", "xhtml", "rss", "atom", "xsl", "plist") +----------------------------------------------------------------- + +* ``tag``: any tag from "<" till ">" +* ``attribute``: tag's attribute with or without value +* ``value``: attribute's value +* ``comment``: comment +* ``pi``: processing instruction () +* ``doctype``: declaration +* ``cdata``: CDATA section + +Lasso ("lasso", "ls", "lassoscript") +------------------------------------ + +* ``preprocessor``: delimiters and interpreter flags +* ``shebang``: Lasso 9 shell script header +* ``comment``: single- or multi-line comment +* ``keyword``: keyword +* ``literal``: keyword representing a value +* ``built_in``: built-in types and variables +* ``number``: number +* ``string``: string +* ``variable``: variable reference starting with "#" or "$" +* ``tag``: tag literal +* ``attribute``: named or rest parameter in method signature +* ``subst``: unary/binary/ternary operator symbols +* ``class``: type, trait, or method header +* ``title``: name following "define" inside a header + +CSS ("css") +----------- + +* ``tag``: tag in selectors +* ``id``: #some_name in selectors +* ``class``: .some_name in selectors +* ``at_rule``: @-rule till first "{" or ";" +* ``keyword``: name of @-rule after @ sign +* ``attr_selector``: attribute selector (square brackets in a[href^=http://]) +* ``pseudo``: pseudo classes and elements (:after, ::after etc.) +* ``comment``: comment +* ``rules``: everything from "{" till "}" +* ``rule``: rule itself — everything inside "{" and "}" +* ``attribute``: property name inside a rule +* ``value``: property value inside a rule, from ":" till ";" or till the end of rule block +* ``number``: number within a value +* ``string``: string within a value +* ``hexcolor``: hex color (#FFFFFF) within a value +* ``function``: CSS function within a value +* ``important``: "!important" symbol + +SCSS ("scss") +------------- + +* ``tag``: tag in selectors +* ``id``: #some_name in selectors +* ``class``: .some_name in selectors +* ``at_rule``: @-rule till first "{" or ";" +* ``attr_selector``: attribute selector (square brackets in a[href^=http://]) +* ``pseudo``: pseudo classes and elements (:after, ::after etc.) +* ``comment``: comment +* ``rules``: everything from "{" till "}" +* ``attribute``: property name inside a rule +* ``value``: property value inside a rule, from ":" till ";" or till the end of rule block +* ``number``: number within a value +* ``string``: string within a value +* ``hexcolor``: hex color (#FFFFFF) within a value +* ``function``: CSS function within a value +* ``important``: "!important" symbol +* ``variable``: variable starting with "$" +* ``preprocessor``: keywords after @ + +Less ("less") +------------- + +* ``comment``: comment +* ``number``: number +* ``string``: string +* ``attribute``: property name +* ``variable``: @var, @@var or @{var} +* ``keyword``: Less keywords (when, extend etc.) +* ``function``: Less and CSS functions (rgba, unit etc.) +* ``tag``: tag +* ``id``: #id +* ``class``: .class +* ``at_rule``: at-rule keyword (@media, @keyframes etc.) +* ``attr_selector``: attribute selector (e.g. [href^=http://]) +* ``pseudo``: pseudo classes and elements (:hover, ::before etc.) +* ``hexcolor``: hex color (#FFF) +* ``built_in``: inline javascript (or whatever host language) string + +Stylus ("stylus", "styl") +------------------------- + +* ``at_rule``: @-rule till first "{" or ";" +* ``attribute``: property name inside a rule +* ``class``: .some_name in selectors +* ``comment``: comment +* ``function``: Stylus function +* ``hexcolor``: hex color (#FFFFFF) within a value +* ``id``: #some_name in selectors +* ``number``: number within a value +* ``pseudo``: pseudo classes and elements (:after, ::after etc.) +* ``string``: string within a value +* ``tag``: tag in selectors +* ``variable``: variable starting with "$" + +Markdown ("markdown", "md", "mkdown", "mkd") +-------------------------------------------- + +* ``header``: header +* ``bullet``: list bullet +* ``emphasis``: emphasis +* ``strong``: strong emphasis +* ``blockquote``: blockquote +* ``code``: code +* ``horizontal_rule``: horizontal rule +* ``link_label``: link label +* ``link_url``: link url +* ``link_reference``: link reference + +AsciiDoc ("asciidoc", "adoc") +----------------------------- + +* ``header``: heading +* ``bullet``: list or labeled bullet +* ``emphasis``: emphasis +* ``strong``: strong emphasis +* ``blockquote``: blockquote +* ``code``: inline or block code +* ``horizontal_rule``: horizontal rule +* ``link_label``: link or image label +* ``link_url``: link or image url +* ``comment``: comment +* ``attribute``: document attribute, block attributes +* ``label``: admonition label + +Django ("django", "jinja") +-------------------------- + +* ``keyword``: HTML tag in HTML, default tags and default filters in templates +* ``tag``: any tag from "<" till ">" +* ``comment``: template comment, both {# .. #} and {% comment %} +* ``doctype``: declaration +* ``attribute``: tag's attribute with or without value +* ``value``: attribute's value +* ``template_tag``: template tag {% .. %} +* ``variable``: template variable {{ .. }} +* ``filter``: filter from "|" till the next filter or the end of tag +* ``argument``: filter argument + + +Twig ("twig", "craftcms") +------------------------- + +* ``keyword``: HTML tag in HTML, default tags and default filters in templates +* ``tag``: any tag from "<" till ">" +* ``comment``: template comment {# .. #} +* ``doctype``: declaration +* ``attribute``: tag's attribute with or withou value +* ``value``: attribute's value +* ``template_tag``: template tag {% .. %} +* ``variable``: template variable {{ .. }} +* ``filter``: filter from "|" till the next filter or the end of tag +* ``argument``: filter argument + + +Handlebars ("handlebars", "hbs", "html.hbs", "html.handlebars") +--------------------------------------------------------------- + +* ``expression``: expression to be evaluated +* ``variable``: variable +* ``begin-block``: the beginning of a block +* ``end-block``: the ending of a block +* ``string``: string + +Dust ("dust", "dst") +-------------------- + +* ``expression``: expression to be evaluated +* ``variable``: variable +* ``begin-block``: the beginning of a block +* ``end-block``: the ending of a block +* ``string``: string + +JSON ("json") +------------- + +* ``number``: number +* ``literal``: "true", "false" and "null" +* ``string``: string value +* ``attribute``: name of an object property +* ``value``: value of an object property + +Mathematica ("mathematica", "mma") +---------------------------------- + +* ``keyword``: keyword +* ``number``: number +* ``comment``: comment +* ``string``: string +* ``list``: a list { .. } - the basic Mma structure + +JavaScript ("javascript", "js") +------------------------------- + +* ``keyword``: keyword +* ``comment``: comment +* ``number``: number +* ``literal``: special literal: "true", "false" and "null" +* ``built_in``: built-in objects and functions ("window", "console", "require", etc...) +* ``string``: string +* ``regexp``: regular expression +* ``function``: header of a function +* ``title``: name of a function inside a header +* ``params``: parentheses and everything inside them in a function's header +* ``pi``: 'use strict' processing instruction + +TypeScript ("typescript", "ts") +------------------------------- + +* ``keyword``: keyword +* ``comment``: comment +* ``number``: number +* ``literal``: special literal: "true", "false" and "null" +* ``built_in``: built-in objects and functions ("window", "console", "require", etc...) +* ``string``: string +* ``regexp``: regular expression +* ``function``: header of a function +* ``title``: name of a function inside a header +* ``params``: parentheses and everything inside them in a function's header +* ``pi``: 'use strict' processing instruction + +CoffeeScript ("coffeescript", "coffee", "cson", "iced") +------------------------------------------------------- + +* ``keyword``: keyword +* ``comment``: comment +* ``number``: number +* ``literal``: special literal: "true", "false" and "null" +* ``built_in``: built-in objects and functions ("window", "console", "require", etc...) +* ``string``: string +* ``subst``: #{ ... } interpolation in double-quoted strings +* ``regexp``: regular expression +* ``function``: header of a function +* ``class``: header of a class +* ``title``: name of a function variable inside a header +* ``params``: parentheses and everything inside them in a function's header +* ``property``: @-property within class and functions + +Dart ("dart") +------------- + +* ``keyword``: keyword +* ``literal``: keyword that can be uses as identifier but have special meaning in some cases +* ``built_in``: some of basic built in classes and function +* ``number``: number +* ``string``: string +* ``subst``: in-string substitution (${...}) +* ``comment``: commment +* ``annotation``: annotation +* ``class``: class header from "class" till "{" +* ``title``: class name + +LiveScript ("livescript", "ls") +------------------------------- + +* ``keyword``: keyword +* ``comment``: comment +* ``number``: number +* ``literal``: special literal: "true", "false" and "null" +* ``built_in``: built-in objects and functions ("window", "console", "require", etc...) +* ``string``: string +* ``subst``: #{ ... } interpolation in double-quoted strings +* ``regexp``: regular expression +* ``function``: header of a function +* ``class``: header of a class +* ``title``: name of a function variable inside a header +* ``params``: parentheses and everything inside them in a function's header +* ``property``: @-property within class and functions + +ActionScript ("actionscript", "as") +----------------------------------- + +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``keyword``: keywords +* ``literal``: literal +* ``reserved``: reserved keyword +* ``title``: name of declaration (package, class or function) +* ``preprocessor``: preprocessor directive (import, include) +* ``type``: type of returned value (for functions) +* ``package``: package (named or not) +* ``class``: class/interface +* ``function``: function +* ``param``: params of function +* ``rest_arg``: rest argument of function + +Haxe ("haxe", "hx") +------------------- + +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``keyword``: keywords +* ``literal``: literal +* ``reserved``: reserved keyword +* ``title``: name of declaration (package, class or function) +* ``preprocessor``: preprocessor directive (if, else, elseif, error) +* ``type``: type of returned value (for functions) +* ``package``: package (named or not) +* ``class``: class/interface +* ``function``: function +* ``param``: params of function +* ``rest_arg``: rest argument of function + +VBScript ("vbscript", "vbs") +---------------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``built_in``: built-in function + +VB.Net ("vbnet", "vb") +---------------------- + +* ``keyword``: keyword +* ``built_in``: built-in types +* ``literal``: "true", "false" and "nothing" +* ``string``: string +* ``comment``: comment +* ``xmlDocTag``: xmldoc tag ("'''", "", "<..>") +* ``preprocessor``: preprocessor directive + +Protocol Buffers ("protobuf") +----------------------------- + +* ``keyword``: keyword +* ``built_in``: built-in types (e.g. `int64`, `string`) +* ``string``: string +* ``number``: number +* ``literal``: "true" and "false" +* ``comment``: comment +* ``class``: message, service or enum definition header +* ``title``: message, service or enum identifier +* ``function``: RPC call identifier + +Cap’n Proto ("capnproto", "capnp") +---------------------------------- + +* ``shebang``: message identifier +* ``keyword``: keyword +* ``built_in``: built-in types (e.g. `Int64`, `Text`) +* ``string``: string +* ``number``: number or field number (e.g. @N) +* ``literal``: "true" and "false" +* ``comment``: comment +* ``class``: message, interface or enum definition header +* ``title``: message, interface or enum identifier + +Thrift ("thrift") +----------------- + +* ``keyword``: keyword +* ``built_in``: built-in types (e.g. `byte`, `i32`) +* ``string``: string +* ``number``: number +* ``literal``: "true" and "false" +* ``comment``: comment +* ``class``: struct, enum, service or exception definition header +* ``title``: struct, enum, service or exception identifier + +HTTP ("http", "https") +---------------------- + +* ``request``: first line of a request +* ``status``: first line of a response +* ``attribute``: header name +* ``string``: header value or query string in a request line +* ``number``: status code + +Lua ("lua") +----------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``built_in``: built-in operator +* ``function``: header of a function +* ``title``: name of a function inside a header +* ``params``: everything inside parentheses in a function's header +* ``long_brackets``: multiline string in [=[ .. ]=] + +Delphi ("delphi") +----------------- + +* ``keyword``: keyword +* ``comment``: comment (of any type) +* ``number``: number +* ``string``: string +* ``function``: header of a function, procedure, constructor and destructor +* ``title``: name of a function, procedure, constructor or destructor inside a header +* ``params``: everything inside parentheses in a function's header +* ``class``: class' body from "= class" till "end;" + +Oxygene ("oxygene") +------------------- + +* ``keyword``: keyword +* ``comment``: comment (of any type) +* ``string``: string/char +* ``function``: method, destructor, procedure or function +* ``title``: name of a function (inside function) +* ``params``: everything inside parentheses in a function's header +* ``number``: number +* ``class``: class' body from "= class" till "end;" + +Java ("java", "jsp") +-------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``annotaion``: annotation +* ``class``: class header from "class" till "{" +* ``function``: method header +* ``title``: class or method name +* ``params``: everything in parentheses inside a class header +* ``inheritance``: keywords "extends" and "implements" inside class header + +Processing ("processing") +------------------------- + +* ``constant``: Processing constants +* ``variable``: Processing special variables +* ``keyword``: Variable types +* ``function``: Processing setup and draw functions +* ``built_in``: Processing built in functions + +AspectJ ("aspectj") +------------------- + +* ``comment``: comment +* ``doctag``: @-tag in javadoc comment +* ``string``: string +* ``number``: number +* ``keyword``: keyword +* ``annotation``: annotation +* ``function``: method and intertype method header +* ``aspect``: aspect header from "aspect" till "{" +* ``params``: everything in parentheses inside an aspect header +* ``inheritance``: keywords "extends" and "implements" inside an aspect header +* ``title``: aspect, (intertype) method name or pointcut name inside an aspect header + +Fortran ("fortran", "f90", "f95") +--------------------------------- + +* ``comment``: comment +* ``function``: name of a function or a subroutine +* ``keyword``: language keywords (function, if) +* ``number``: number +* ``string``: string constant (single or double quote) + +IRPF90 ("irpf90") +----------------- + +* ``comment``: comment +* ``function``: name of a function or a subroutine +* ``keyword``: language keywords (function, if) +* ``number``: number +* ``string``: string constant (single or double quote) + +C++ ("cpp", "c", "cc", "h", "c++", "h++", "hpp") +------------------------------------------------ + +* ``keyword``: keyword +* ``number``: number +* ``string``: string and character +* ``comment``: comment +* ``preprocessor``: preprocessor directive + +Objective C ("objectivec", "mm", "objc", "obj-c") +------------------------------------------------- + +* ``keyword``: keyword +* ``built_in``: Cocoa/Cocoa Touch constants and classes +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``preprocessor``: preprocessor directive +* ``class``: interface/implementation, protocol and forward class declaration +* ``title``: title (id) of interface, implementation, protocol, class +* ``variable``: properties and struct accessors + +Vala ("vala") +------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``class``: class definitions +* ``title``: in class definition +* ``constant``: ALL_UPPER_CASE + +C# ("cs", "csharp") +------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``xmlDocTag``: xmldoc tag ("///", "", "<..>") +* ``class``: class header from "class" till "{" +* ``function``: method header +* ``title``: title of namespace or class + +F# ("fsharp", "fs") +------------------- + +* ``keywords``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``class``: any custom F# type +* ``title``: the name of a custom F# type +* ``annotation``: any attribute + +OCaml ("ocaml", "ml") +--------------------- + +* ``keywords``: keyword +* ``literal``: true false etc. +* ``number``: number +* ``string``: string +* ``char``: character +* ``comment``: comment +* ``built_in``: built-in type (int, list etc.) +* ``type``: variant constructor, module name +* ``tag``: polymorphic variant tag +* ``symbol``: type variable + +D ("d") +------- + +* ``comment``: comment +* ``string``: string constant +* ``number``: number +* ``keyword``: language keywords (including @attributes) +* ``constant``: true false null +* ``built_in``: built-in plain types (int, string etc.) + +RenderMan RSL ("rsl") +--------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string (including @"..") +* ``comment``: comment +* ``preprocessor``: preprocessor directive +* ``shader``: shader keywords +* ``shading``: shading keywords +* ``built_in``: built-in function + +RenderMan RIB ("rib") +--------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``commands``: command + +Maya Embedded Language ("mel") +------------------------------ + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``variable``: variable + +SQL ("sql") +----------- + +* ``keyword``: keyword (mostly SQL'92, SQL'99 and T-SQL) +* ``literal``: special literal: "true" and "false" +* ``built_in``: built-in type name +* ``number``: number +* ``string``: string (of any type: "..", '..', \`..\`) +* ``comment``: comment +* ``variable``: mixed-case names + +Smalltalk ("smalltalk", "st") +----------------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``symbol``: symbol +* ``array``: array +* ``class``: name of a class +* ``char``: char +* ``localvars``: block of local variables + +Lisp ("lisp") +------------- + +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``variable``: variable +* ``literal``: b, t and nil +* ``list``: non-quoted list +* ``keyword``: first symbol in a non-quoted list +* ``body``: remainder of the non-quoted list +* ``quoted``: quoted list, both "(quote .. )" and "'(..)" + +Clojure ("clojure", "clj") +-------------------------- + +* ``comment``: comments and hints +* ``string``: string +* ``number``: number +* ``collection``: collections +* ``attribute``: :keyword +* ``list``: non-quoted list +* ``keyword``: first symbol in a list +* ``built_in``: built-in function name as the first symbol in a list +* ``prompt``: REPL prompt + +Scheme ("scheme") +----------------- + +* ``shebang``: script interpreter header +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``regexp``: regexp +* ``variable``: single-quote 'identifier +* ``list``: non-quoted list +* ``keyword``: first symbol in a list +* ``built_in``: built-in function name as the first symbol in a list +* ``literal``: #t, #f, #\...\ + +Ini ("ini") +----------- + +* ``title``: title of a section +* ``value``: value of a setting of any type +* ``string``: string +* ``number``: number +* ``keyword``: boolean value keyword + +Apache ("apache", "apacheconf") +------------------------------- + +* ``keyword``: keyword +* ``number``: number +* ``comment``: comment +* ``literal``: On and Off +* ``sqbracket``: variables in rewrites "%{..}" +* ``cbracket``: options in rewrites "[..]" +* ``tag``: begin and end of a configuration section + +Nginx ("nginx", "nginxconf") +---------------------------- + +* ``title``: directive title +* ``string``: string +* ``number``: number +* ``comment``: comment +* ``built_in``: built-in constant +* ``variable``: $-variable +* ``regexp``: regexp + +Diff ("diff", "patch") +---------------------- + +* ``header``: file header +* ``chunk``: chunk header within a file +* ``addition``: added lines +* ``deletion``: deleted lines +* ``change``: changed lines + +DOS ("dos", "bat", "cmd") +------------------------- + +* ``keyword``: keyword +* ``flow``: batch control keyword +* ``stream``: DOS special files ("con", "prn", ...) +* ``winutils``: some commands (see dos.js specifically) +* ``envvar``: environment variables + +PowerShell ("powershell", "ps") +------------------------------- + +* ``keyword``: keyword +* ``string``: string +* ``number``: number +* ``comment``: comment +* ``literal``: special literal: "true" and "false" +* ``variable``: variable + +Bash ("bash", "sh", "zsh") +-------------------------- + +* ``keyword``: keyword +* ``string``: string +* ``number``: number +* ``comment``: comment +* ``literal``: special literal: "true" and "false" +* ``variable``: variable +* ``shebang``: script interpreter header + +Makefile ("makefile", "mk", "mak") +---------------------------------- + +* ``keyword``: keyword ".PHONY" within the phony line +* ``string``: string +* ``comment``: comment +* ``variable``: $(..) variable +* ``title``: target title +* ``constant``: constant within the initial definition + +CMake ("cmake", "cmake.in") +--------------------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``envvar``: $-variable +* ``operator``: operator (LESS, STREQUAL, MATCHES, etc) + +Nix ("nix") +----------- + +* ``keyword``: keyword +* ``built_in``: built-in constant +* ``number``: number +* ``string``: single and double quotes +* ``subst``: antiquote ${} +* ``comment``: comment +* ``variable``: function parameter name + +NSIS ("nsis") +------------- + +* ``symbol``: directory constants +* ``number``: number +* ``constant``: definitions, language-strings, compiler commands +* ``variable``: $-variable +* ``string``: string +* ``comment``: comment +* ``params``: parameters +* ``keyword``: keywords +* ``literal``: keyword options + +Axapta ("axapta") +----------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``class``: class header from "class" till "{" +* ``title``: class name inside a header +* ``params``: everything in parentheses inside a class header +* ``preprocessor``: preprocessor directive + +Oracle Rules Language ("ruleslanguage") +--------------------------------------- + +* ``comment``: comment +* ``string``: string constant +* ``number``: number +* ``keyword``: language keywords +* ``built_in``: built-in functions +* ``array``: array stem + +1C ("1c") +--------- + +* ``keyword``: keyword +* ``number``: number +* ``date``: date +* ``string``: string +* ``comment``: comment +* ``function``: header of function or procedure +* ``title``: function name inside a header +* ``params``: everything in parentheses inside a function header +* ``preprocessor``: preprocessor directive + +x86 Assembly ("x86asm") +----------------------- + +* ``keyword``: instruction mnemonic +* ``literal``: register name +* ``pseudo``: assembler's pseudo instruction +* ``preprocessor``: macro +* ``built_in``: assembler's keyword +* ``comment``: comment +* ``number``: number +* ``string``: string +* ``label``: jump label +* ``argument``: macro's argument + +AVR assembler ("avrasm") +------------------------ + +* ``keyword``: keyword +* ``built_in``: pre-defined register +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``label``: label +* ``preprocessor``: preprocessor directive +* ``localvars``: substitution in .macro + +VHDL ("vhdl") +------------- + +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``literal``: signal logical value +* ``typename``: typename +* ``attribute``: signal attribute + +Parser3 ("parser3") +------------------- + +* ``keyword``: keyword +* ``number``: number +* ``comment``: comment +* ``variable``: variable starting with "$" +* ``preprocessor``: preprocessor directive +* ``title``: user-defined name starting with "@" + +LiveCode Server ("livecodeserver") +---------------------------------- + +* ``variable``: variable starting with "g", "t", "p", "s", "$_" +* ``string``: string +* ``comment``: comment +* ``number``: number +* ``title``: name of a command or a function +* ``keyword``: keyword +* ``constant``: constant +* ``operator``: operator +* ``built_in``: built_in functions and commands +* ``function``: header of a function +* ``command``: header of a command +* ``preprocessor``: preprocessor marks: "" + +TeX ("tex") +----------- + +* ``comment``: comment +* ``number``: number +* ``command``: command +* ``parameter``: parameter +* ``formula``: formula +* ``special``: special symbol + +Haskell ("haskell", "hs") +------------------------- + +* ``comment``: comment +* ``pragma``: GHC pragma +* ``preprocessor``: CPP preprocessor directive +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``title``: function or variable name +* ``type``: value, type or type class constructor name (i.e. capitalized) +* ``container``: (..., ...) or {...; ...} list in declaration or record +* ``module``: module declaration +* ``import``: import declaration +* ``class``: type class or instance declaration +* ``typedef``: type declaration (type, newtype, data) +* ``default``: default declaration +* ``infix``: infix declaration +* ``foreign``: FFI declaration +* ``shebang``: shebang line + +Elm ("elm") +------------------------- + +* ``comment``: comment +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``title``: function or variable name +* ``type``: value or type constructor name (i.e. capitalized) +* ``container``: (..., ...) or {...; ...} list in declaration or record +* ``module``: module declaration +* ``import``: import declaration +* ``typedef``: type declaration (type, type alias) +* ``infix``: infix declaration +* ``foreign``: javascript interop declaration + +Erlang ("erlang", "erl") +------------------------ + +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``keyword``: keyword +* ``record_name``: record access (#record_name) +* ``title``: name of declaration function +* ``variable``: variable (starts with capital letter or with _) +* ``pp``:.keywords module's attribute (-attribute) +* ``function_name``: atom or atom:atom in case of function call + +Elixir ("elixir") +----------------- + +* ``keyword``: keyword +* ``string``: string +* ``subst``: in-string substitution (#{...}) +* ``comment``: comment +* ``function``: function header "def some_name(...):" +* ``class``: defmodule and defrecord headers +* ``title``: name of a function or a module inside a header +* ``symbol``: atom +* ``constant``: name of a module +* ``number``: number +* ``variable``: variable +* ``regexp``: regexp + +Rust ("rust", "rs") +------------------- + +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``keyword``: keyword +* ``title``: name of declaration +* ``preprocessor``: preprocessor directive + +Matlab ("matlab") +----------------- + +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``keyword``: keyword +* ``title``: function name +* ``function``: function +* ``param``: params of function +* ``matrix``: matrix in [ .. ] +* ``cell``: cell in { .. } + +Scilab ("scilab", "sci") +------------------------ + +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``keyword``: keyword +* ``title``: function name +* ``function``: function +* ``param``: params of function +* ``matrix``: matrix in [ .. ] + +R ("r") +------- + +* ``comment``: comment +* ``string``: string constant +* ``number``: number +* ``keyword``: language keywords (function, if) plus "structural" functions (attach, require, setClass) +* ``literal``: special literal: TRUE, FALSE, NULL, NA, etc. + +OpenGL Shading Language ("glsl") +-------------------------------- + +* ``comment``: comment +* ``number``: number +* ``preprocessor``: preprocessor directive +* ``keyword``: keyword +* ``built_in``: GLSL built-in functions and variables +* ``literal``: true false + +AppleScript ("applescript", "osascript") +---------------------------------------- + +* ``keyword``: keyword +* ``command``: core AppleScript command +* ``constant``: AppleScript built in constant +* ``type``: AppleScript variable type (integer, etc.) +* ``property``: Applescript built in property (length, etc.) +* ``number``: number +* ``string``: string +* ``comment``: comment +* ``title``: name of a handler + +Vim Script ("vim") +------------------ + +* ``keyword``: keyword +* ``built_in``: built-in functions +* ``string``: string, comment +* ``number``: number +* ``function``: function header "function Foo(...)" +* ``title``: name of a function +* ``params``: everything inside parentheses in a function's header +* ``variable``: vim variables with different visibilities "g:foo, b:bar" + +Brainfuck ("brainfuck", "bf") +----------------------------- + +* ``title``: Brainfuck while loop command +* ``literal``: Brainfuck inc and dec commands +* ``comment``: comment +* ``string``: Brainfuck input and output commands + +Mizar ("mizar") +--------------- + +* ``keyword``: keyword +* ``comment``: comment + +AutoHotkey ("autohotkey") +------------------------- + +* ``keyword``: keyword +* ``literal``: A (active window), true, false, NOT, AND, OR +* ``built_in``: built-in variables +* ``string``: string +* ``comment``: comment +* ``number``: number +* ``var_expand``: variable expansion (enclosed in percent sign) +* ``label``: label, hotkey label, hotstring label + +Monkey ("monkey") +----------------- + +* ``keyword``: keyword +* ``built_in``: built-in functions, variables and types of variables +* ``literal``: True, False, Null, And, Or, Shl, Shr, Mod +* ``string``: string +* ``comment``: comment +* ``number``: number +* ``function``: header of a function, method and constructor +* ``class``: class header +* ``title``: name of an alias, class, interface, function or method inside a header +* ``variable``: self and super keywords +* ``preprocessor``: import and preprocessor +* ``pi``: Strict directive + +FIX ("fix") +----------- + +* ``attribute``: attribute name +* ``string``: attribute value + +Gherkin ("gherkin") +------------------- + +* ``keyword``: keyword +* ``number``: number +* ``comment``: comment +* ``string``: string + +TP ("tp") +--------- + +* ``keyword``: keyword +* ``constant``: ON, OFF, max_speed, LPOS, JPOS, ENABLE, DISABLE, START, STOP, RESET +* ``number``: number +* ``comment``: comment +* ``string``: string +* ``data``: numeric registers, positions, position registers, etc. +* ``io``: inputs and outputs +* ``label``: data and io labels +* ``variable``: system variables +* ``units``: units (e.g. mm/sec, sec, deg) + +Nimrod ("nimrod", "nim") +------------------------ + +* ``decorator`` pragma +* ``string`` string literal +* ``type`` variable type +* ``number`` numeric literal +* ``comment`` comment + +Swift ("swift") +--------------- + +* ``keyword``: keyword +* ``comment``: comment +* ``number``: number +* ``string``: string +* ``literal``: special literal: "true", "false" and "nil" +* ``built_in``: built-in Swift functions +* ``func``: header of a function +* ``class``: class, protocol, enum, struct, or extension declaration +* ``title``: name of a function or class (or protocol, etc) +* ``generics``: generic type of a function +* ``params``: parameters of a function +* ``type``: a type +* ``preprocessor``: @attributes + +G-Code ("gcode", "nc") +---------------------- + +* ``keyword``: G words, looping constructs and conditional operators +* ``comment``: comment +* ``number``: number +* ``built_in``: trigonometric and mathematical functions +* ``title``: M words and variable registers +* ``preprocessor``: program number and ending character +* ``label``: block number + +Q ("k", "kdb") +-------------- + +* ``comment``: comment +* ``string``: string constant +* ``number``: number +* ``keyword``: language keywords +* ``constant``: 0/1b +* ``typename``: built-in plain types (int, symbol etc.) +* ``built_in``: built-in function + +Tcl ("tcl", "tk") +----------------- + +* ``keyword``: keyword +* ``comment``: comment +* ``symbol``: function (proc) +* ``variable``: variable +* ``string``: string +* ``number``: number + +Puppet ("puppet", "pp") +----------------------- + +* ``comment``: comment +* ``string``: string +* ``number``: number +* ``keyword``: classes and types +* ``constant``: dependencies + +Stata ("stata") +--------------- + +* ``keyword``: commands and control flow +* ``label``: macros (locals and globals) +* ``string``: string +* ``comment``: comment +* ``literal``: built-in functions + +XL ("xl", "tao") +---------------- + +* ``keyword``: keywords defined in the default syntax file +* ``literal``: names entered in the compiler (true, false, nil) +* ``type``: basic types (integer, real, text, name, etc) +* ``built_in``: built-in functions (sin, exp, mod, etc) +* ``module``: names of frequently used Tao modules +* ``id``: names of frequently used Tao functions +* ``constant``: all-uppercase names such as HELLO +* ``variable``: Mixed-case names such as Hello (style convention) +* ``id``: Lower-case names such as hello +* ``string``: Text between single or double quote, long text << >> +* ``number``: Number values +* ``function``: Function or variable definition +* ``import``: Import clause + +Roboconf ("graph", "instances") +------------------------------- + +* ``keyword``: keyword +* ``string``: names of imported variables +* ``comment``: comment +* ``facet``: a **facet** section +* ``component``: a **component** section +* ``instance-of``: an **instance** section + +STEP Part 21 ("p21", "step", "stp") +----------------------------------- + +* ``preprocessor``: delimiters +* ``comment``: single- or multi-line comment +* ``keyword``: keyword +* ``number``: number +* ``string``: string +* ``label``: variable reference starting with "#" + +Mercury ("mercury") +------------------- + +* ``keyword``: keyword +* ``pragma``: compiler directive +* ``preprocessor``: foreign language interface +* ``built_in``: control flow, logical, implication, head-body conjunction, purity +* ``number``: number, numcode of character +* ``comment``: comment +* ``label``: TODO label inside comment +* ``string``: string +* ``constant``: string format + +Smali ("smali") +--------------- + +* ``string``: string +* ``comment``: comment +* ``keyword``: smali keywords +* ``instruction``: instruction +* ``class``: classtypes +* ``function``: function (call or signature) +* ``variable``: variable or parameter + +Verilog ("verilog", "v") +------------------------ + +* ``keyword``: keyword, operator +* ``comment``: comment +* ``typename``: types of data, register, and net +* ``number``: number literals (including X and Z) +* ``value``: parameters passed to instances + +Dockerfile ("dockerfile", "docker") +----------------------------------- + +* ``keyword``: instruction keyword +* ``comment``: comment +* ``number``: number +* ``string``: string + +PF ("pf", "pf.conf") +-------------------- + +* ``built_in``: top level action, e.g. block/match/pass +* ``keyword``: some parameter/modifier to an action (in, on, nat-to, most reserved words) +* ``literal``: words representing special values, e.g. all, egress +* ``comment``: comment +* ``number``: number +* ``string``: string +* ``variable``: used for both macros and tables + +XQuery ("xpath", "xq") +---------------------- + +* ``keyword``: instruction keyword +* ``literal``: words representing special values, e.g. all, egress +* ``comment``: comment +* ``number``: number +* ``string``: string +* ``variable``: variable +* ``decorator``: annotations +* ``function``: function + +C/AL ("cal") +------------ + +* ``keyword``: keyword +* ``comment``: comment (of any type) +* ``number``: number +* ``string``: string +* ``date``: date, time, or datetime +* ``function``: header of a procedure +* ``title``: name of an object or procedure inside a header +* ``params``: everything inside parentheses in a function's header +* ``class``: objects body +* ``variable``: reference to variables + +Inform7 ("I7") +-------------- + +* ``string``: string +* ``comment``: comment +* ``title``: a section header or table header +* ``subst``: a substitution inside a string +* ``kind``: a built-in kind (thing, room, person, etc), for relevance +* ``characteristic``: a commonly-used characteristic (open, closed, scenery, etc), for relevance +* ``verb``: a commonly-used verb (is, understand), for relevance. +* ``misc_keyword``: a word with specific I7 meaning (kind, rule), for relevance. + +Prolog ("prolog") +----------------- + +* ``atom``: non-quoted atoms and functor names +* ``string``: quoted atoms, strings, character code list literals, character code literals +* ``number``: numbers +* ``variable``: variables +* ``comment``: comments + +DNS Zone file ("dns", "zone", "bind") +------------------------------------- + +* ``keyword``: DNS resource records as defined in various RFCs +* ``operator``: operator +* ``number``: IPv4 and IPv6 addresses +* ``comment``: comments + +Ceylon ("ceylon") +----------------- + +* ``keyword``: keyword +* ``annotation``: language annotation or compiler annotation +* ``string``: string literal, part of string template, character literal +* ``number``: number +* ``comment``: comment + +OpenSCAD ("openscad", "scad") +----------------------------- + +* ``built_in``: built-in functions (cube, sphere, translate, ...) +* ``comment``: comments +* ``function``: function or module definition +* ``keyword``: keywords +* ``literal``: words representing values (e.g. false, undef, PI) +* ``number``: numbers +* ``params``: parameters in function or module header or call +* ``preprocessor``: file includes (i.e. include, use) +* ``string``: quoted strings +* ``title``: names of function or module in a header + +ARM assembler ("armasm", "arm") +------------------------------- + +* ``keyword``: keyword (instruction mnemonics) +* ``literal``: pre-defined register +* ``number``: number +* ``built_in``: constants (true, false) +* ``string``: string +* ``comment``: comment +* ``label``: label +* ``preprocessor``: preprocessor directive +* ``title``: symbol versions + +AutoIt ("autoit") +----------------- + +* ``keyword``: keyword +* ``literal``: True, False, And, Null, Not, Or +* ``built_in``: built-in functions and UDF +* ``constant``: constant, macros +* ``variable``: variables +* ``string``: string +* ``comment``: comment +* ``number``: number +* ``preprocessor``: AutoIt3Wrapper directives section + +Access log ("accesslog") +------------------------ + +* ``keyword``: HTTP method name +* ``string``: date, request string, user-agent etc +* ``number``: IP-address, numbers + +Crystal ("crystal", "cr") +------------------------- + +* ``keyword``: keyword +* ``string``: string +* ``number``: number +* ``symbol``: symbol +* ``regexp``: regexp +* ``literal``: true, false or nil +* ``constant``: constant +* ``variable``: global, instance, class and fresh variables +* ``subst``: in-string substitution (#{...}) +* ``expansion``: macro expansion ({{...}}, {%...%}) +* ``class``: class, module, struct, enum, union or lib header +* ``function``: method or function header +* ``title``: a method name or class name +* ``parent``: name of a parent class +* ``annotation``: any attribute + +Crmsh ("crmsh", "crm", "pcmk") +------------------------------ + +* ``keyword``: command name +* ``title``: resource id +* ``identifier``: node or property set identifier +* ``pragma``: resource agent +* ``string``: string +* ``number``: number +* ``literal``: literal +* ``type``: data type +* ``variable``: name-value pair variable name +* ``comment``: comment +* ``tag``: XML tag diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/index.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/index.rst new file mode 100644 index 00000000..f80250d7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/index.rst @@ -0,0 +1,51 @@ +.. highlight.js documentation master file, created by + sphinx-quickstart on Wed Sep 12 23:48:27 2012. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +``highlight.js`` developer documentation +========================================== + +Contents: + +.. toctree:: + :maxdepth: 1 + + api + language-guide + reference + css-classes-reference + style-guide + building-testing + release-process + +Contribution: + +.. toctree:: + :maxdepth: 1 + + language-contribution + style-contribution + +Miscellaneous: + +.. toctree:: + :maxdepth: 1 + + line-numbers + language-requests + +Links: + +- Code: https://github.com/isagalaev/highlight.js +- Discussion: http://groups.google.com/group/highlightjs +- Bug tracking: https://github.com/isagalaev/highlight.js/issues + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-contribution.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-contribution.rst new file mode 100644 index 00000000..4deae3f3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-contribution.rst @@ -0,0 +1,78 @@ +Language contributor checklist +============================== + +1. Put language definition into a .js file +------------------------------------------ + +The file defines a function accepting a reference to the library and returning a language object. +The library parameter is useful to access common modes and regexps. You should not immediately call this function, +this is done during the build process and details differ for different build targets. + +:: + + function(hljs) { + return { + keywords: 'foo bar', + contains: [ ..., hljs.NUMBER_MODE, ... ] + } + } + +The name of the file is used as a short language identifier and should be usable as a class name in HTML and CSS. + + +2. Provide meta data +-------------------- + +At the top of the file there is a specially formatted comment with meta data processed by a build system. +Meta data format is simply key-value pairs each occupying its own line: + +:: + + /* + Language: Superlanguage + Requires: java.js, sql.js + Author: John Smith + Contributors: Mike Johnson <...@...>, Matt Wilson <...@...> + Description: Some cool language definition + */ + +``Language`` — the only required header giving a human-readable language name. + +``Requires`` — a list of other language files required for this language to work. +This make it possible to describe languages that extend definitions of other ones. +Required files aren't processed in any special way. +The build system just makes sure that they will be in the final package in +``LANGUAGES`` object. + +The meaning of the other headers is pretty obvious. + + +3. Create a code example +------------------------ + +The code example is used both to test language detection and for the demo page +on https://highlightjs.org/. Put it in ``test/detect//default.txt``. + +Take inspiration from other languages in ``test/detect/`` and read +:ref:`testing instructions ` for more details. + + +4. Write class reference +------------------------ + +Class reference lives in the :doc:`CSS classes reference `.. +Describe shortly names of all meaningful modes used in your language definition. + + +5. Add yourself to AUTHORS.*.txt and CHANGES.md +----------------------------------------------- + +If you're a new contributor add yourself to the authors list. Feel free to use +either English and/or Russian version. +Also it will be good to update CHANGES.md. + + +6. Create a pull request +------------------------ + +Send your contribution as a pull request on GitHub. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-guide.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-guide.rst new file mode 100644 index 00000000..e5df0f8a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-guide.rst @@ -0,0 +1,247 @@ +Language definition guide +========================= + +Highlighting overview +--------------------- + +Programming language code consists of parts with different rules of parsing: keywords like ``for`` or ``if`` +don't make sense inside strings, strings may contain backslash-escaped symbols like ``\"`` +and comments usually don't contain anything interesting except the end of the comment. + +In highlight.js such parts are called "modes". + +Each mode consists of: + +* starting condition +* ending condition +* list of contained sub-modes +* lexing rules and keywords +* …exotic stuff like another language inside a language + +The parser's work is to look for modes and their keywords. +Upon finding, it wraps them into the markup ``...`` +and puts the name of the mode ("string", "comment", "number") +or a keyword group name ("keyword", "literal", "built-in") as the span's class name. + + +General syntax +-------------- + +A language definition is a JavaScript object describing the default parsing mode for the language. +This default mode contains sub-modes which in turn contain other sub-modes, effectively making the language definition a tree of modes. + +Here's an example: + +:: + + { + case_insensitive: true, // language is case-insensitive + keywords: 'for if while', + contains: [ + { + className: 'string', + begin: '"', end: '"' + }, + hljs.COMMENT( + '/\\*', // begin + '\\*/', // end + { + contains: [ + { + className: 'doc', begin: '@\\w+' + } + ] + } + ) + ] + } + +Usually the default mode accounts for the majority of the code and describes all language keywords. +A notable exception here is XML in which a default mode is just a user text that doesn't contain any keywords, +and most interesting parsing happens inside tags. + + +Keywords +-------- + +In the simple case language keywords are defined in a string, separated by space: + +:: + + { + keywords: 'else for if while' + } + +Some languages have different kinds of "keywords" that might not be called as such by the language spec +but are very close to them from the point of view of a syntax highlighter. These are all sorts of "literals", "built-ins", "symbols" and such. +To define such keyword groups the attribute ``keywords`` becomes an object each property of which defines its own group of keywords: + +:: + + { + keywords: { + keyword: 'else for if while', + literal: 'false true null' + } + } + +The group name becomes then a class name in a generated markup enabling different styling for different kinds of keywords. + +To detect keywords highlight.js breaks the processed chunk of code into separate words — a process called lexing. +The "word" here is defined by the regexp ``[a-zA-Z][a-zA-Z0-9_]*`` that works for keywords in most languages. +Different lexing rules can be defined by the ``lexemes`` attribute: + +:: + + { + lexemes '-[a-z]+', + keywords: '-import -export' + } + + +Sub-modes +--------- + +Sub-modes are listed in the ``contains`` attribute: + +:: + + { + keywords: '...', + contains: [ + hljs.QUOTE_STRING_MODE, + hljs.C_LINE_COMMENT, + { ... custom mode definition ... } + ] + } + +A mode can reference itself in the ``contains`` array by using a special keyword ``'self``'. +This is commonly used to define nested modes: + +:: + + { + className: 'object', + begin: '{', end: '}', + contains: [hljs.QUOTE_STRING_MODE, 'self'] + } + + +Markup generation +----------------- + +Modes usually generate actual highlighting markup — ```` elements with specific class names that are defined by the ``className`` attribute: + +:: + + { + contains: [ + { + className: 'string', + // ... other attributes + }, + { + className: 'number', + // ... + } + ] + } + +Names are not required to be unique, it's quite common to have several definitions with the same name. +For example, many languages have various syntaxes for strings, comments, etc… + +Sometimes modes are defined only to support specific parsing rules and aren't needed in the final markup. +A classic example is an escaping sequence inside strings allowing them to contain an ending quote. + +:: + + { + className: 'string', + begin: '"', end: '"', + contains: [{begin: '\\\\.'}], + } + +For such modes ``className`` attribute should be omitted so they won't generate excessive markup. + + +Mode attributes +--------------- + +Other useful attributes are defined in the :doc:`mode reference `. + + +.. _relevance: + +Relevance +--------- + +Highlight.js tries to automatically detect the language of a code fragment. +The heuristics is essentially simple: it tries to highlight a fragment with all the language definitions +and the one that yields most specific modes and keywords wins. The job of a language definition +is to help this heuristics by hinting relative relevance (or irrelevance) of modes. + +This is best illustrated by example. Python has special kinds of strings defined by prefix letters before the quotes: +``r"..."``, ``u"..."``. If a code fragment contains such strings there is a good chance that it's in Python. +So these string modes are given high relevance: + +:: + + { + className: 'string', + begin: 'r"', end: '"', + relevance: 10 + } + +On the other hand, conventional strings in plain single or double quotes aren't specific to any language +and it makes sense to bring their relevance to zero to lessen statistical noise: + +:: + + { + className: 'string', + begin: '"', end: '"', + relevance: 0 + } + +The default value for relevance is 1. When setting an explicit value it's recommended to use either 10 or 0. + +Keywords also influence relevance. Each of them usually has a relevance of 1, but there are some unique names +that aren't likely to be found outside of their languages, even in the form of variable names. +For example just having ``reinterpret_cast`` somewhere in the code is a good indicator that we're looking at C++. +It's worth to set relevance of such keywords a bit higher. This is done with a pipe: + +:: + + { + keywords: 'for if reinterpret_cast|10' + } + + +Illegal symbols +--------------- + +Another way to improve language detection is to define illegal symbols for a mode. +For example in Python first line of class definition (``class MyClass(object):``) cannot contain symbol "{" or a newline. +Presence of these symbols clearly shows that the language is not Python and the parser can drop this attempt early. + +Illegal symbols are defined as a a single regular expression: + +:: + + { + className: 'class', + illegal: '[${]' + } + + +Pre-defined modes and regular expressions +----------------------------------------- + +Many languages share common modes and regular expressions. Such expressions are defined in core highlight.js code +at the end under "Common regexps" and "Common modes" titles. Use them when possible. + + +Contributing +------------ + +Follow the :doc:`contributor checklist `. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-requests.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-requests.rst new file mode 100644 index 00000000..4e4c2f0b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/language-requests.rst @@ -0,0 +1,17 @@ +On requesting new languages +=========================== + +This is a general answer to requests for adding new languages that appear from +time to time in the highlight.js issue tracker and discussion group. + + Highlight.js doesn't have a fundamental plan for implementing languages, + instead the project works by accepting language definitions from + interested contributors. There are also no rules at the moment forbidding + any languages from being added to the library, no matter how obscure or + weird. + + This means that there's no point in requesting a new language without + providing an implementation for it. If you want to see a particular language + included in highlight.js but cannot implement it, the best way to make it + happen is to get another developer interested in doing so. Here's our + :doc:`language-guide`. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/line-numbers.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/line-numbers.rst new file mode 100644 index 00000000..674542d4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/line-numbers.rst @@ -0,0 +1,39 @@ +Line numbers +============ + +Highlight.js' notable lack of line numbers support is not an oversight but a +feature. Following is the explanation of this policy from the current project +maintainer (hey guys!): + + One of the defining design principles for highlight.js from the start was + simplicity. Not the simplicity of code (in fact, it's quite complex) but + the simplicity of usage and of the actual look of highlighted snippets on + HTML pages. Many highlighters, in my opinion, are overdoing it with such + things as separate colors for every single type of lexemes, striped + backgrounds, fancy buttons around code blocks and — yes — line numbers. + The more fancy stuff resides around the code the more it distracts a + reader from understanding it. + + This is why it's not a straightforward decision: this new feature will not + just make highlight.js better, it might actually make it worse simply by + making it look more bloated in blog posts around the Internet. This is why + I'm asking people to show that it's worth it. + + The only real use-case that ever was brought up in support of line numbers + is referencing code from the descriptive text around it. On my own blog I + was always solving this either with comments within the code itself or by + breaking the larger snippets into smaller ones and describing each small + part separately. I'm not saying that my solution is better. But I don't + see how line numbers are better either. And the only way to show that they + are better is to set up some usability research on the subject. I doubt + anyone would bother to do it. + + Then there's maintenance. So far the core code of highlight.js is + maintained by only one person — yours truly. Inclusion of any new code in + highlight.js means that from that moment I will have to fix bugs in it, + improve it further, make it work together with the rest of the code, + defend its design. And I don't want to do all this for the feature that I + consider "evil" and probably will never use myself. + +This position is `subject to discuss `_. +Also it doesn't stop anyone from forking the code and maintaining line-numbers implementation separately. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/reference.rst b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/reference.rst new file mode 100644 index 00000000..ff4f2eff --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/highlight.js/docs/reference.rst @@ -0,0 +1,298 @@ +Mode reference +============== + +Types +----- + +Types of attributes values in this reference: + ++------------+-------------------------------------------------------------------------------------+ +| identifier | String suitable to be used as a Javascript variable and CSS class name | +| | (i.e. mostly ``/[A-Za-z0-9_]+/``) | ++------------+-------------------------------------------------------------------------------------+ +| regexp | String representing a Javascript regexp. | +| | Note that since it's not a literal regexp all back-slashes should be repeated twice | ++------------+-------------------------------------------------------------------------------------+ +| boolean | Javascript boolean: ``true`` or ``false`` | ++------------+-------------------------------------------------------------------------------------+ +| number | Javascript number | ++------------+-------------------------------------------------------------------------------------+ +| object | Javascript object: ``{ ... }`` | ++------------+-------------------------------------------------------------------------------------+ +| array | Javascript array: ``[ ... ]`` | ++------------+-------------------------------------------------------------------------------------+ + + +Attributes +---------- + +case_insensitive +^^^^^^^^^^^^^^^^ + +**type**: boolean + +Case insensitivity of language keywords and regexps. Used only on the top-level mode. + + +aliases +^^^^^^^ + +**type**: array + +A list of additional names (besides the canonical one given by the filename) that can be used to identify a language in HTML classes and in a call to :ref:`getLanguage `. + + +className +^^^^^^^^^ + +**type**: identifier + +The name of the mode. It is used as a class name in HTML markup. + +Multiple modes can have the same name. This is useful when a language has multiple variants of syntax +for one thing like string in single or double quotes. + + +begin +^^^^^ + +**type**: regexp + +Regular expression starting a mode. For example a single quote for strings or two forward slashes for C-style comments. +If absent, ``begin`` defaults to a regexp that matches anything, so the mode starts immediately. + + +end +^^^ + +**type**: regexp + +Regular expression ending a mode. For example a single quote for strings or "$" (end of line) for one-line comments. + +It's often the case that a beginning regular expression defines the entire mode and doesn't need any special ending. +For example a number can be defined with ``begin: "\\b\\d+"`` which spans all the digits. + +If absent, ``end`` defaults to a regexp that matches anything, so the mode ends immediately. + +Sometimes a mode can end not by itself but implicitly with its containing (parent) mode. +This is achieved with :ref:`endsWithParent ` attribute. + + +beginKeywords +^^^^^^^^^^^^^^^^ + +**type**: string + +Used instead of ``begin`` for modes starting with keywords to avoid needless repetition: + +:: + + { + begin: '\\b(extends|implements) ', + keywords: 'extends implements' + } + +… becomes: + +:: + + { + beginKeywords: 'extends implements' + } + +Unlike the :ref:`keywords ` attribute, this one allows only a simple list of space separated keywords. +If you do need additional features of ``keywords`` or you just need more keywords for this mode you may include ``keywords`` along with ``beginKeywords``. + + +.. _endsWithParent: + +endsWithParent +^^^^^^^^^^^^^^ + +**type**: boolean + +A flag showing that a mode ends when its parent ends. + +This is best demonstrated by example. In CSS syntax a selector has a set of rules contained within symbols "{" and "}". +Individual rules separated by ";" but the last one in a set can omit the terminating semicolon: + +:: + + p { + width: 100%; color: red + } + +This is when ``endsWithParent`` comes into play: + +:: + + { + className: 'rules', begin: '{', end: '}', + contains: [ + {className: 'rule', /* ... */ end: ';', endsWithParent: true} + ] + } + +.. _endsParent: + +endsParent +^^^^^^^^^^^^^^ + +**type**: boolean + +Forces closing of the parent mode right after the current mode is closed. + +This is used for modes that don't have an easily expressible ending lexeme but +instead could be closed after the last interesting sub-mode is found. + +Here's an example with two ways of defining functions in Elixir, one using a +keyword ``do`` and another using a comma: + +:: + + def foo :clear, list do + :ok + end + + def foo, do: IO.puts "hello world" + +Note that in the first case the parameter list after the function title may also +include a comma. And iIf we're only interested in highlighting a title we can +tell it to end the function definition after itself: + +:: + + { + className: 'function', + beginKeywords: 'def', end: /\B\b/, + contains: [ + { + className: 'title', + begin: hljs.IDENT_RE, endsParent: true + } + ] + } + +(The ``end: /\B\b/`` regex tells function to never end by itself.) + +.. _lexemes: + +lexemes +^^^^^^^ + +**type**: regexp + +A regular expression that extracts individual lexemes from language text to find :ref:`keywords ` among them. +Default value is ``hljs.IDENT_RE`` which works for most languages. + + +.. _keywords: + +keywords +^^^^^^^^ + +**type**: object + +Keyword definition comes in two forms: + +* ``'for while if else weird_voodoo|10 ... '`` -- a string of space-separated keywords with an optional relevance over a pipe +* ``{'keyword': ' ... ', 'literal': ' ... '}`` -- an object whose keys are names of different kinds of keywords and values are keyword definition strings in the first form + +For detailed explanation see :doc:`Language definition guide `. + + +illegal +^^^^^^^ + +**type**: regexp + +A regular expression that defines symbols illegal for the mode. +When the parser finds a match for illegal expression it immediately drops parsing the whole language altogether. + + +excludeBegin, excludeEnd +^^^^^^^^^^^^^^^^^^^^^^^^ + +**type**: boolean + +Exclude beginning or ending lexemes out of mode's generated markup. For example in CSS syntax a rule ends with a semicolon. +However visually it's better not to color it as the rule contents. Having ``excludeEnd: true`` forces a ```` element for the rule to close before the semicolon. + + +returnBegin +^^^^^^^^^^^ + +**type**: boolean + +Returns just found beginning lexeme back into parser. This is used when beginning of a sub-mode is a complex expression +that should not only be found within a parent mode but also parsed according to the rules of a sub-mode. + +Since the parser is effectively goes back it's quite possible to create a infinite loop here so use with caution! + + +returnEnd +^^^^^^^^^ + +**type**: boolean + +Returns just found ending lexeme back into parser. This is used for example to parse Javascript embedded into HTML. +A Javascript block ends with the HTML closing tag ```` that cannot be parsed with Javascript rules. +So it is returned back into its parent HTML mode that knows what to do with it. + +Since the parser is effectively goes back it's quite possible to create a infinite loop here so use with caution! + + +contains +^^^^^^^^ + +**type**: array + +The list of sub-modes that can be found inside the mode. For detailed explanation see :doc:`Language definition guide `. + + +starts +^^^^^^ + +**type**: identifier + +The name of the mode that will start right after the current mode ends. The new mode won't be contained within the current one. + +Currently this attribute is used to highlight Javascript and CSS contained within HTML. +Tags `` + + + + +
{{ "%+010d"|sprintf:-123 }}
+
{{ "%+010d"|vsprintf:[-123] }}
+
{{ "%+010d"|fmt:-123 }}
+
{{ "%+010d"|vfmt:[-123] }}
+
{{ "I've got %2$d apples and %1$d oranges."|fmt:4:2 }}
+
{{ "I've got %(apples)d apples and %(oranges)d oranges."|fmt:{apples: 2, oranges: 4} }}
+ + + + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js new file mode 100644 index 00000000..dbaf744d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js @@ -0,0 +1,4 @@ +/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ + +angular.module("sprintf",[]).filter("sprintf",function(){return function(){return sprintf.apply(null,arguments)}}).filter("fmt",["$filter",function(a){return a("sprintf")}]).filter("vsprintf",function(){return function(a,b){return vsprintf(a,b)}}).filter("vfmt",["$filter",function(a){return a("vsprintf")}]); +//# sourceMappingURL=angular-sprintf.min.map \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js.map b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js.map new file mode 100644 index 00000000..055964c6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map new file mode 100644 index 00000000..055964c6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/angular-sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"angular-sprintf.min.js","sources":["../src/angular-sprintf.js"],"names":["angular","module","filter","sprintf","apply","arguments","$filter","format","argv","vsprintf"],"mappings":";;AAAAA,QACIC,OAAO,cACPC,OAAO,UAAW,WACd,MAAO,YACH,MAAOC,SAAQC,MAAM,KAAMC,cAGnCH,OAAO,OAAQ,UAAW,SAASI,GAC/B,MAAOA,GAAQ,cAEnBJ,OAAO,WAAY,WACf,MAAO,UAASK,EAAQC,GACpB,MAAOC,UAASF,EAAQC,MAGhCN,OAAO,QAAS,UAAW,SAASI,GAChC,MAAOA,GAAQ"} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js new file mode 100644 index 00000000..dc61e51a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js @@ -0,0 +1,4 @@ +/*! sprintf-js | Alexandru Marasteanu (http://alexei.ro/) | BSD-3-Clause */ + +!function(a){function b(){var a=arguments[0],c=b.cache;return c[a]&&c.hasOwnProperty(a)||(c[a]=b.parse(a)),b.format.call(null,c[a],arguments)}function c(a){return Object.prototype.toString.call(a).slice(8,-1).toLowerCase()}function d(a,b){return Array(b+1).join(a)}var e={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(a,f){var g,h,i,j,k,l,m,n=1,o=a.length,p="",q=[],r=!0,s="";for(h=0;o>h;h++)if(p=c(a[h]),"string"===p)q[q.length]=a[h];else if("array"===p){if(j=a[h],j[2])for(g=f[n],i=0;i=0),j[8]){case"b":g=g.toString(2);break;case"c":g=String.fromCharCode(g);break;case"d":case"i":g=parseInt(g,10);break;case"j":g=JSON.stringify(g,null,j[6]?parseInt(j[6]):0);break;case"e":g=j[7]?g.toExponential(j[7]):g.toExponential();break;case"f":g=j[7]?parseFloat(g).toFixed(j[7]):parseFloat(g);break;case"g":g=j[7]?parseFloat(g).toPrecision(j[7]):parseFloat(g);break;case"o":g=g.toString(8);break;case"s":g=(g=String(g))&&j[7]?g.substring(0,j[7]):g;break;case"u":g>>>=0;break;case"x":g=g.toString(16);break;case"X":g=g.toString(16).toUpperCase()}e.json.test(j[8])?q[q.length]=g:(!e.number.test(j[8])||r&&!j[3]?s="":(s=r?"+":"-",g=g.toString().replace(e.sign,"")),l=j[4]?"0"===j[4]?"0":j[4].charAt(1):" ",m=j[6]-(s+g).length,k=j[6]&&m>0?d(l,m):"",q[q.length]=j[5]?s+g+k:"0"===l?s+k+g:k+s+g)}return q.join("")},b.cache={},b.parse=function(a){for(var b=a,c=[],d=[],f=0;b;){if(null!==(c=e.text.exec(b)))d[d.length]=c[0];else if(null!==(c=e.modulo.exec(b)))d[d.length]="%";else{if(null===(c=e.placeholder.exec(b)))throw new SyntaxError("[sprintf] unexpected placeholder");if(c[2]){f|=1;var g=[],h=c[2],i=[];if(null===(i=e.key.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g[g.length]=i[1];""!==(h=h.substring(i[0].length));)if(null!==(i=e.key_access.exec(h)))g[g.length]=i[1];else{if(null===(i=e.index_access.exec(h)))throw new SyntaxError("[sprintf] failed to parse named argument key");g[g.length]=i[1]}c[2]=g}else f|=2;if(3===f)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");d[d.length]=c}b=b.substring(c[0].length)}return d};var f=function(a,c,d){return d=(c||[]).slice(0),d.splice(0,0,a),b.apply(null,d)};"undefined"!=typeof exports?(exports.sprintf=b,exports.vsprintf=f):(a.sprintf=b,a.vsprintf=f,"function"==typeof define&&define.amd&&define(function(){return{sprintf:b,vsprintf:f}}))}("undefined"==typeof window?this:window); +//# sourceMappingURL=sprintf.min.map \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js.map b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js.map new file mode 100644 index 00000000..369dbafa --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA4JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GApLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,SACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAIyB,UAAU,EAAGtB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAI+C,cAG3BvC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWgD,QAAQxC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAGyB,OAAO,GAAK,IACzEtB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAASyD,GAErB,IADA,GAAIC,GAAOD,EAAK1B,KAAYL,KAAiBiC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC3B,EAAQhB,EAAGK,KAAKwC,KAAKF,IACtBhC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOuC,KAAKF,IAC7BhC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYsC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI9B,EAAM,GAAI,CACV4B,GAAa,CACb,IAAIG,MAAiBC,EAAoBhC,EAAM,GAAIiC,IACnD,IAAuD,QAAlDA,EAAcjD,EAAGnB,IAAIgE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAWzB,QAAU2B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG3B,UACnE,GAA8D,QAAzD2B,EAAcjD,EAAGQ,WAAWqC,KAAKG,IAClCD,EAAWA,EAAWzB,QAAU2B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAcjD,EAAGS,aAAaoC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAWzB,QAAU2B,EAAY,GAUxDjC,EAAM,GAAK+B,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAIlB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC2B,EAAOA,EAAKL,UAAUtB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIuC,GAAW,SAASR,EAAK9B,EAAMuC,GAG/B,MAFAA,IAASvC,OAAYnB,MAAM,GAC3B0D,EAAMC,OAAO,EAAG,EAAGV,GACZ9D,EAAQyE,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ1E,QAAUA,EAClB0E,QAAQJ,SAAWA,IAGnBvE,EAAOC,QAAUA,EACjBD,EAAOuE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI3E,QAASA,EACTsE,SAAUA,OAKT,mBAAXvE,QAAyB8E,KAAO9E"} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map new file mode 100644 index 00000000..ee011aaa --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/dist/sprintf.min.map @@ -0,0 +1 @@ +{"version":3,"file":"sprintf.min.js","sources":["../src/sprintf.js"],"names":["window","sprintf","key","arguments","cache","hasOwnProperty","parse","format","call","get_type","variable","Object","prototype","toString","slice","toLowerCase","str_repeat","input","multiplier","Array","join","re","not_string","number","json","not_json","text","modulo","placeholder","key_access","index_access","sign","parse_tree","argv","arg","i","k","match","pad","pad_character","pad_length","cursor","tree_length","length","node_type","output","is_positive","Error","test","isNaN","TypeError","String","fromCharCode","parseInt","JSON","stringify","toExponential","parseFloat","toFixed","toPrecision","substring","toUpperCase","replace","charAt","fmt","_fmt","arg_names","exec","SyntaxError","field_list","replacement_field","field_match","vsprintf","_argv","splice","apply","exports","define","amd","this"],"mappings":";;CAAA,SAAUA,GAeN,QAASC,KACL,GAAIC,GAAMC,UAAU,GAAIC,EAAQH,EAAQG,KAIxC,OAHMA,GAAMF,IAAQE,EAAMC,eAAeH,KACrCE,EAAMF,GAAOD,EAAQK,MAAMJ,IAExBD,EAAQM,OAAOC,KAAK,KAAMJ,EAAMF,GAAMC,WA+JjD,QAASM,GAASC,GACd,MAAOC,QAAOC,UAAUC,SAASL,KAAKE,GAAUI,MAAM,EAAG,IAAIC,cAGjE,QAASC,GAAWC,EAAOC,GACvB,MAAOC,OAAMD,EAAa,GAAGE,KAAKH,GAvLtC,GAAII,IACAC,WAAY,OACZC,OAAQ,UACRC,KAAM,MACNC,SAAU,OACVC,KAAM,YACNC,OAAQ,WACRC,YAAa,yFACb1B,IAAK,sBACL2B,WAAY,wBACZC,aAAc,aACdC,KAAM,UAWV9B,GAAQM,OAAS,SAASyB,EAAYC,GAClC,GAAiEC,GAAkBC,EAAGC,EAAGC,EAAOC,EAAKC,EAAeC,EAAhHC,EAAS,EAAGC,EAAcV,EAAWW,OAAQC,EAAY,GAASC,KAA0DC,GAAc,EAAMf,EAAO,EAC3J,KAAKI,EAAI,EAAOO,EAAJP,EAAiBA,IAEzB,GADAS,EAAYnC,EAASuB,EAAWG,IACd,WAAdS,EACAC,EAAOA,EAAOF,QAAUX,EAAWG,OAElC,IAAkB,UAAdS,EAAuB,CAE5B,GADAP,EAAQL,EAAWG,GACfE,EAAM,GAEN,IADAH,EAAMD,EAAKQ,GACNL,EAAI,EAAGA,EAAIC,EAAM,GAAGM,OAAQP,IAAK,CAClC,IAAKF,EAAI7B,eAAegC,EAAM,GAAGD,IAC7B,KAAM,IAAIW,OAAM9C,EAAQ,yCAA0CoC,EAAM,GAAGD,IAE/EF,GAAMA,EAAIG,EAAM,GAAGD,QAIvBF,GADKG,EAAM,GACLJ,EAAKI,EAAM,IAGXJ,EAAKQ,IAOf,IAJqB,YAAjBhC,EAASyB,KACTA,EAAMA,KAGNb,EAAGC,WAAW0B,KAAKX,EAAM,KAAOhB,EAAGI,SAASuB,KAAKX,EAAM,KAAyB,UAAjB5B,EAASyB,IAAoBe,MAAMf,GAClG,KAAM,IAAIgB,WAAUjD,EAAQ,0CAA2CQ,EAASyB,IAOpF,QAJIb,EAAGE,OAAOyB,KAAKX,EAAM,MACrBS,EAAcZ,GAAO,GAGjBG,EAAM,IACV,IAAK,IACDH,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,EAAMiB,OAAOC,aAAalB,EAC9B,MACA,KAAK,IACL,IAAK,IACDA,EAAMmB,SAASnB,EAAK,GACxB,MACA,KAAK,IACDA,EAAMoB,KAAKC,UAAUrB,EAAK,KAAMG,EAAM,GAAKgB,SAAShB,EAAM,IAAM,EACpE,MACA,KAAK,IACDH,EAAMG,EAAM,GAAKH,EAAIsB,cAAcnB,EAAM,IAAMH,EAAIsB,eACvD,MACA,KAAK,IACDtB,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKwB,QAAQrB,EAAM,IAAMoB,WAAWvB,EACpE,MACA,KAAK,IACDA,EAAMG,EAAM,GAAKoB,WAAWvB,GAAKyB,YAAYtB,EAAM,IAAMoB,WAAWvB,EACxE,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,EACvB,MACA,KAAK,IACDqB,GAAQA,EAAMiB,OAAOjB,KAASG,EAAM,GAAKH,EAAI0B,UAAU,EAAGvB,EAAM,IAAMH,CAC1E,MACA,KAAK,IACDA,KAAc,CAClB,MACA,KAAK,IACDA,EAAMA,EAAIrB,SAAS,GACvB,MACA,KAAK,IACDqB,EAAMA,EAAIrB,SAAS,IAAIgD,cAG3BxC,EAAGG,KAAKwB,KAAKX,EAAM,IACnBQ,EAAOA,EAAOF,QAAUT,IAGpBb,EAAGE,OAAOyB,KAAKX,EAAM,KAASS,IAAeT,EAAM,GAKnDN,EAAO,IAJPA,EAAOe,EAAc,IAAM,IAC3BZ,EAAMA,EAAIrB,WAAWiD,QAAQzC,EAAGU,KAAM,KAK1CQ,EAAgBF,EAAM,GAAkB,MAAbA,EAAM,GAAa,IAAMA,EAAM,GAAG0B,OAAO,GAAK,IACzEvB,EAAaH,EAAM,IAAMN,EAAOG,GAAKS,OACrCL,EAAMD,EAAM,IAAMG,EAAa,EAAIxB,EAAWuB,EAAeC,GAAoB,GACjFK,EAAOA,EAAOF,QAAUN,EAAM,GAAKN,EAAOG,EAAMI,EAAyB,MAAlBC,EAAwBR,EAAOO,EAAMJ,EAAMI,EAAMP,EAAOG,GAI3H,MAAOW,GAAOzB,KAAK,KAGvBnB,EAAQG,SAERH,EAAQK,MAAQ,SAAS0D,GAErB,IADA,GAAIC,GAAOD,EAAK3B,KAAYL,KAAiBkC,EAAY,EAClDD,GAAM,CACT,GAAqC,QAAhC5B,EAAQhB,EAAGK,KAAKyC,KAAKF,IACtBjC,EAAWA,EAAWW,QAAUN,EAAM,OAErC,IAAuC,QAAlCA,EAAQhB,EAAGM,OAAOwC,KAAKF,IAC7BjC,EAAWA,EAAWW,QAAU,QAE/B,CAAA,GAA4C,QAAvCN,EAAQhB,EAAGO,YAAYuC,KAAKF,IAgClC,KAAM,IAAIG,aAAY,mCA/BtB,IAAI/B,EAAM,GAAI,CACV6B,GAAa,CACb,IAAIG,MAAiBC,EAAoBjC,EAAM,GAAIkC,IACnD,IAAuD,QAAlDA,EAAclD,EAAGnB,IAAIiE,KAAKG,IAe3B,KAAM,IAAIF,aAAY,+CAbtB,KADAC,EAAWA,EAAW1B,QAAU4B,EAAY,GACwC,MAA5ED,EAAoBA,EAAkBV,UAAUW,EAAY,GAAG5B,UACnE,GAA8D,QAAzD4B,EAAclD,EAAGQ,WAAWsC,KAAKG,IAClCD,EAAWA,EAAW1B,QAAU4B,EAAY,OAE3C,CAAA,GAAgE,QAA3DA,EAAclD,EAAGS,aAAaqC,KAAKG,IAIzC,KAAM,IAAIF,aAAY,+CAHtBC,GAAWA,EAAW1B,QAAU4B,EAAY,GAUxDlC,EAAM,GAAKgC,MAGXH,IAAa,CAEjB,IAAkB,IAAdA,EACA,KAAM,IAAInB,OAAM,4EAEpBf,GAAWA,EAAWW,QAAUN,EAKpC4B,EAAOA,EAAKL,UAAUvB,EAAM,GAAGM,QAEnC,MAAOX,GAGX,IAAIwC,GAAW,SAASR,EAAK/B,EAAMwC,GAG/B,MAFAA,IAASxC,OAAYnB,MAAM,GAC3B2D,EAAMC,OAAO,EAAG,EAAGV,GACZ/D,EAAQ0E,MAAM,KAAMF,GAiBR,oBAAZG,UACPA,QAAQ3E,QAAUA,EAClB2E,QAAQJ,SAAWA,IAGnBxE,EAAOC,QAAUA,EACjBD,EAAOwE,SAAWA,EAEI,kBAAXK,SAAyBA,OAAOC,KACvCD,OAAO,WACH,OACI5E,QAASA,EACTuE,SAAUA,OAKT,mBAAXxE,QAAyB+E,KAAO/E"} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/gruntfile.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/gruntfile.js new file mode 100644 index 00000000..246e1c3b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/gruntfile.js @@ -0,0 +1,36 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + + uglify: { + options: { + banner: "/*! <%= pkg.name %> | <%= pkg.author %> | <%= pkg.license %> */\n", + sourceMap: true + }, + build: { + files: [ + { + src: "src/sprintf.js", + dest: "dist/sprintf.min.js" + }, + { + src: "src/angular-sprintf.js", + dest: "dist/angular-sprintf.min.js" + } + ] + } + }, + + watch: { + js: { + files: "src/*.js", + tasks: ["uglify"] + } + } + }) + + grunt.loadNpmTasks("grunt-contrib-uglify") + grunt.loadNpmTasks("grunt-contrib-watch") + + grunt.registerTask("default", ["uglify", "watch"]) +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/package.json new file mode 100644 index 00000000..6e9f1d73 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/package.json @@ -0,0 +1,52 @@ +{ + "name": "sprintf-js", + "version": "1.0.3", + "description": "JavaScript sprintf implementation", + "author": { + "name": "Alexandru Marasteanu", + "email": "hello@alexei.ro", + "url": "http://alexei.ro/" + }, + "main": "src/sprintf.js", + "scripts": { + "test": "mocha test/test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/alexei/sprintf.js.git" + }, + "license": "BSD-3-Clause", + "devDependencies": { + "mocha": "*", + "grunt": "*", + "grunt-contrib-watch": "*", + "grunt-contrib-uglify": "*" + }, + "gitHead": "747b806c2dab5b64d5c9958c42884946a187c3b1", + "bugs": { + "url": "https://github.com/alexei/sprintf.js/issues" + }, + "homepage": "https://github.com/alexei/sprintf.js#readme", + "_id": "sprintf-js@1.0.3", + "_shasum": "04e6926f662895354f3dd015203633b857297e2c", + "_from": "sprintf-js@>=1.0.2 <1.1.0", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "alexei", + "email": "hello@alexei.ro" + }, + "dist": { + "shasum": "04e6926f662895354f3dd015203633b857297e2c", + "tarball": "http://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + }, + "maintainers": [ + { + "name": "alexei", + "email": "hello@alexei.ro" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js new file mode 100644 index 00000000..9c69123b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/src/angular-sprintf.js @@ -0,0 +1,18 @@ +angular. + module("sprintf", []). + filter("sprintf", function() { + return function() { + return sprintf.apply(null, arguments) + } + }). + filter("fmt", ["$filter", function($filter) { + return $filter("sprintf") + }]). + filter("vsprintf", function() { + return function(format, argv) { + return vsprintf(format, argv) + } + }). + filter("vfmt", ["$filter", function($filter) { + return $filter("vsprintf") + }]) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js new file mode 100644 index 00000000..c0fc7c08 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/src/sprintf.js @@ -0,0 +1,208 @@ +(function(window) { + var re = { + not_string: /[^s]/, + number: /[diefg]/, + json: /[j]/, + not_json: /[^j]/, + text: /^[^\x25]+/, + modulo: /^\x25{2}/, + placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/, + key: /^([a-z_][a-z_\d]*)/i, + key_access: /^\.([a-z_][a-z_\d]*)/i, + index_access: /^\[(\d+)\]/, + sign: /^[\+\-]/ + } + + function sprintf() { + var key = arguments[0], cache = sprintf.cache + if (!(cache[key] && cache.hasOwnProperty(key))) { + cache[key] = sprintf.parse(key) + } + return sprintf.format.call(null, cache[key], arguments) + } + + sprintf.format = function(parse_tree, argv) { + var cursor = 1, tree_length = parse_tree.length, node_type = "", arg, output = [], i, k, match, pad, pad_character, pad_length, is_positive = true, sign = "" + for (i = 0; i < tree_length; i++) { + node_type = get_type(parse_tree[i]) + if (node_type === "string") { + output[output.length] = parse_tree[i] + } + else if (node_type === "array") { + match = parse_tree[i] // convenience purposes only + if (match[2]) { // keyword argument + arg = argv[cursor] + for (k = 0; k < match[2].length; k++) { + if (!arg.hasOwnProperty(match[2][k])) { + throw new Error(sprintf("[sprintf] property '%s' does not exist", match[2][k])) + } + arg = arg[match[2][k]] + } + } + else if (match[1]) { // positional argument (explicit) + arg = argv[match[1]] + } + else { // positional argument (implicit) + arg = argv[cursor++] + } + + if (get_type(arg) == "function") { + arg = arg() + } + + if (re.not_string.test(match[8]) && re.not_json.test(match[8]) && (get_type(arg) != "number" && isNaN(arg))) { + throw new TypeError(sprintf("[sprintf] expecting number but found %s", get_type(arg))) + } + + if (re.number.test(match[8])) { + is_positive = arg >= 0 + } + + switch (match[8]) { + case "b": + arg = arg.toString(2) + break + case "c": + arg = String.fromCharCode(arg) + break + case "d": + case "i": + arg = parseInt(arg, 10) + break + case "j": + arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0) + break + case "e": + arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential() + break + case "f": + arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg) + break + case "g": + arg = match[7] ? parseFloat(arg).toPrecision(match[7]) : parseFloat(arg) + break + case "o": + arg = arg.toString(8) + break + case "s": + arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg) + break + case "u": + arg = arg >>> 0 + break + case "x": + arg = arg.toString(16) + break + case "X": + arg = arg.toString(16).toUpperCase() + break + } + if (re.json.test(match[8])) { + output[output.length] = arg + } + else { + if (re.number.test(match[8]) && (!is_positive || match[3])) { + sign = is_positive ? "+" : "-" + arg = arg.toString().replace(re.sign, "") + } + else { + sign = "" + } + pad_character = match[4] ? match[4] === "0" ? "0" : match[4].charAt(1) : " " + pad_length = match[6] - (sign + arg).length + pad = match[6] ? (pad_length > 0 ? str_repeat(pad_character, pad_length) : "") : "" + output[output.length] = match[5] ? sign + arg + pad : (pad_character === "0" ? sign + pad + arg : pad + sign + arg) + } + } + } + return output.join("") + } + + sprintf.cache = {} + + sprintf.parse = function(fmt) { + var _fmt = fmt, match = [], parse_tree = [], arg_names = 0 + while (_fmt) { + if ((match = re.text.exec(_fmt)) !== null) { + parse_tree[parse_tree.length] = match[0] + } + else if ((match = re.modulo.exec(_fmt)) !== null) { + parse_tree[parse_tree.length] = "%" + } + else if ((match = re.placeholder.exec(_fmt)) !== null) { + if (match[2]) { + arg_names |= 1 + var field_list = [], replacement_field = match[2], field_match = [] + if ((field_match = re.key.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + while ((replacement_field = replacement_field.substring(field_match[0].length)) !== "") { + if ((field_match = re.key_access.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + } + else if ((field_match = re.index_access.exec(replacement_field)) !== null) { + field_list[field_list.length] = field_match[1] + } + else { + throw new SyntaxError("[sprintf] failed to parse named argument key") + } + } + } + else { + throw new SyntaxError("[sprintf] failed to parse named argument key") + } + match[2] = field_list + } + else { + arg_names |= 2 + } + if (arg_names === 3) { + throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported") + } + parse_tree[parse_tree.length] = match + } + else { + throw new SyntaxError("[sprintf] unexpected placeholder") + } + _fmt = _fmt.substring(match[0].length) + } + return parse_tree + } + + var vsprintf = function(fmt, argv, _argv) { + _argv = (argv || []).slice(0) + _argv.splice(0, 0, fmt) + return sprintf.apply(null, _argv) + } + + /** + * helpers + */ + function get_type(variable) { + return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase() + } + + function str_repeat(input, multiplier) { + return Array(multiplier + 1).join(input) + } + + /** + * export to either browser or node.js + */ + if (typeof exports !== "undefined") { + exports.sprintf = sprintf + exports.vsprintf = vsprintf + } + else { + window.sprintf = sprintf + window.vsprintf = vsprintf + + if (typeof define === "function" && define.amd) { + define(function() { + return { + sprintf: sprintf, + vsprintf: vsprintf + } + }) + } + } +})(typeof window === "undefined" ? this : window); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/test/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/test/test.js new file mode 100644 index 00000000..6f57b253 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/node_modules/sprintf-js/test/test.js @@ -0,0 +1,82 @@ +var assert = require("assert"), + sprintfjs = require("../src/sprintf.js"), + sprintf = sprintfjs.sprintf, + vsprintf = sprintfjs.vsprintf + +describe("sprintfjs", function() { + var pi = 3.141592653589793 + + it("should return formated strings for simple placeholders", function() { + assert.equal("%", sprintf("%%")) + assert.equal("10", sprintf("%b", 2)) + assert.equal("A", sprintf("%c", 65)) + assert.equal("2", sprintf("%d", 2)) + assert.equal("2", sprintf("%i", 2)) + assert.equal("2", sprintf("%d", "2")) + assert.equal("2", sprintf("%i", "2")) + assert.equal('{"foo":"bar"}', sprintf("%j", {foo: "bar"})) + assert.equal('["foo","bar"]', sprintf("%j", ["foo", "bar"])) + assert.equal("2e+0", sprintf("%e", 2)) + assert.equal("2", sprintf("%u", 2)) + assert.equal("4294967294", sprintf("%u", -2)) + assert.equal("2.2", sprintf("%f", 2.2)) + assert.equal("3.141592653589793", sprintf("%g", pi)) + assert.equal("10", sprintf("%o", 8)) + assert.equal("%s", sprintf("%s", "%s")) + assert.equal("ff", sprintf("%x", 255)) + assert.equal("FF", sprintf("%X", 255)) + assert.equal("Polly wants a cracker", sprintf("%2$s %3$s a %1$s", "cracker", "Polly", "wants")) + assert.equal("Hello world!", sprintf("Hello %(who)s!", {"who": "world"})) + }) + + it("should return formated strings for complex placeholders", function() { + // sign + assert.equal("2", sprintf("%d", 2)) + assert.equal("-2", sprintf("%d", -2)) + assert.equal("+2", sprintf("%+d", 2)) + assert.equal("-2", sprintf("%+d", -2)) + assert.equal("2", sprintf("%i", 2)) + assert.equal("-2", sprintf("%i", -2)) + assert.equal("+2", sprintf("%+i", 2)) + assert.equal("-2", sprintf("%+i", -2)) + assert.equal("2.2", sprintf("%f", 2.2)) + assert.equal("-2.2", sprintf("%f", -2.2)) + assert.equal("+2.2", sprintf("%+f", 2.2)) + assert.equal("-2.2", sprintf("%+f", -2.2)) + assert.equal("-2.3", sprintf("%+.1f", -2.34)) + assert.equal("-0.0", sprintf("%+.1f", -0.01)) + assert.equal("3.14159", sprintf("%.6g", pi)) + assert.equal("3.14", sprintf("%.3g", pi)) + assert.equal("3", sprintf("%.1g", pi)) + assert.equal("-000000123", sprintf("%+010d", -123)) + assert.equal("______-123", sprintf("%+'_10d", -123)) + assert.equal("-234.34 123.2", sprintf("%f %f", -234.34, 123.2)) + + // padding + assert.equal("-0002", sprintf("%05d", -2)) + assert.equal("-0002", sprintf("%05i", -2)) + assert.equal(" <", sprintf("%5s", "<")) + assert.equal("0000<", sprintf("%05s", "<")) + assert.equal("____<", sprintf("%'_5s", "<")) + assert.equal("> ", sprintf("%-5s", ">")) + assert.equal(">0000", sprintf("%0-5s", ">")) + assert.equal(">____", sprintf("%'_-5s", ">")) + assert.equal("xxxxxx", sprintf("%5s", "xxxxxx")) + assert.equal("1234", sprintf("%02u", 1234)) + assert.equal(" -10.235", sprintf("%8.3f", -10.23456)) + assert.equal("-12.34 xxx", sprintf("%f %s", -12.34, "xxx")) + assert.equal('{\n "foo": "bar"\n}', sprintf("%2j", {foo: "bar"})) + assert.equal('[\n "foo",\n "bar"\n]', sprintf("%2j", ["foo", "bar"])) + + // precision + assert.equal("2.3", sprintf("%.1f", 2.345)) + assert.equal("xxxxx", sprintf("%5.5s", "xxxxxx")) + assert.equal(" x", sprintf("%5.1s", "xxxxxx")) + + }) + + it("should return formated strings for callbacks", function() { + assert.equal("foobar", sprintf("%s", function() { return "foobar" })) + assert.equal(Date.now(), sprintf("%s", Date.now)) // should pass... + }) +}) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/package.json new file mode 100644 index 00000000..928f0e43 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/argparse/package.json @@ -0,0 +1,62 @@ +{ + "name": "argparse", + "description": "Very powerful CLI arguments parser. Native port of argparse - python's options parsing library", + "version": "1.0.3", + "keywords": [ + "cli", + "parser", + "argparse", + "option", + "args" + ], + "homepage": "https://github.com/nodeca/argparse", + "contributors": [ + { + "name": "Eugene Shkuropat" + }, + { + "name": "Paul Jacobson" + } + ], + "license": "MIT", + "repository": { + "type": "git", + "url": "git+https://github.com/nodeca/argparse.git" + }, + "scripts": { + "test": "make test" + }, + "dependencies": { + "lodash": ">= 3.2.0 < 4.0.0", + "sprintf-js": "~1.0.2" + }, + "devDependencies": { + "mocha": "*" + }, + "gitHead": "e46e471f113ba31074c0d0c156f93fd7a618b27c", + "bugs": { + "url": "https://github.com/nodeca/argparse/issues" + }, + "_id": "argparse@1.0.3", + "_shasum": "14389deeb0c28fc4cda9405b9f532a4e3785ce84", + "_from": "argparse@>=1.0.0 <1.1.0", + "_npmVersion": "2.14.7", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + }, + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "14389deeb0c28fc4cda9405b9f532a4e3785ce84", + "tarball": "http://registry.npmjs.org/argparse/-/argparse-1.0.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/CHANGELOG.md new file mode 100644 index 00000000..9594c214 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/CHANGELOG.md @@ -0,0 +1,41 @@ +0.1.5 / 2015-03-13 +------------------ + +- Fixed special chars handling (line breaks). +- Fixed demo permalink encode/decode. + + +0.1.4 / 2015-03-12 +------------------ + +- Allow `..` and `...` inside of link paths (#9). Useful for github links with + commit ranges. +- Added `.pretest()` method for speed optimizations. +- Autogenerate demo sample from fixtures. + + +0.1.3 / 2015-03-11 +------------------ + +- Maintenance release. Deps update. + + +0.1.2 / 2015-02-26 +------------------ + +- Fixed blockquoted links (some symbols exclusions), thanks to @MayhemYDG. +- Fixed demo permalinks, thanks to @MayhemYDG. + + +0.1.1 / 2015-02-22 +------------------ + +- Moved unicode data to external package. +- Demo permalink improvements. +- Docs update. + + +0.1.0 / 2015-02-12 +------------------ + +- First release. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/LICENSE new file mode 100644 index 00000000..67596f5f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2015 Vitaly Puzrin. + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/README.md new file mode 100644 index 00000000..8f1533bf --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/README.md @@ -0,0 +1,170 @@ +linkify-it +========== + +[![Build Status](https://img.shields.io/travis/markdown-it/linkify-it/master.svg?style=flat)](https://travis-ci.org/markdown-it/linkify-it) +[![NPM version](https://img.shields.io/npm/v/linkify-it.svg?style=flat)](https://www.npmjs.org/package/linkify-it) +[![Coverage Status](https://img.shields.io/coveralls/markdown-it/linkify-it/master.svg?style=flat)](https://coveralls.io/r/markdown-it/linkify-it?branch=master) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/markdown-it/linkify-it) + +> Links recognition library with FULL unicode support. +> Focused on high quality link patterns detection in plain text. + +__[Demo](http://markdown-it.github.io/linkify-it/)__ + +Why it's awesome: + +- Full unicode support, _with astral characters_! +- International domains support. +- Allows rules extension & custom normalizers. + + +Install +------- + +```bash +npm install linkify-it --save +``` + +Browserification is also supported. + + +Usage examples +-------------- + +##### Example 1 + +```js +var linkify = require('linkify-it')(); + +// Reload full tlds list & add uniffocial `.onion` domain. +linkify + .tlds(require('tlds')) // Reload with full tlds list + .tlds('.onion', true); // Add uniffocial `.onion` domain + .linkify.add('git:', 'http:'); // Add `git:` ptotocol as "alias" + .linkify.add('ftp:', null); // Disable `ftp:` ptotocol + +console.log(linkify.test('Site github.com!')); // true + +console.log(linkify.match('Site github.com!')); // [ { + // schema: "", + // index: 5, + // lastIndex: 15, + // raw: "github.com", + // text: "github.com", + // url: "http://github.com", + // } ] +``` + +##### Exmple 2. Add twitter mentions handler + +```js +linkify.add('@', { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.twitter) { + self.re.twitter = new RegExp( + '^([a-zA-Z0-9_]){1,15}(?!_)(?=$|' + self.re.src_ZPCcCf + ')' + ); + } + if (self.re.twitter.test(tail)) { + // Linkifier allows punctuation chars before prefix, + // but we additionally disable `@` ("@@mention" is invalid) + if (pos >= 2 && tail[pos - 2] === '@') { + return false; + } + return tail.match(self.re.twitter)[0].length; + } + return 0; + }, + normalize: function (match) { + match.url = 'https://twitter.com/' + match.url.replace(/^@/, ''); + } +}); +``` + + +API +--- + +__[API documentation](http://markdown-it.github.io/linkify-it/doc)__ + +### new LinkifyIt(schemas) + +Creates new linkifier instance with optional additional schemas. +Can be called without `new` keyword for convenience. + +By default understands: + +- `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links +- "fuzzy" links and emails (google.com, foo@bar.com). + +`schemas` is an object, where each key/value describes protocol/rule: + +- __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` + for example). `linkify-it` makes shure that prefix is not preceeded with + alphanumeric char. +- __value__ - rule to check tail after link prefix + - _String_ - just alias to existing rule + - _Object_ + - _validate_ - validator function (should return matched length on success), + or `RegExp`. + - _normalize_ - optional function to normalize text & url of matched result + (for example, for twitter mentions). + + +### .test(text) + +Searches linkifiable pattern and returns `true` on success or `false` on fail. + + +### .pretest(text) + +Quick check if link MAY BE can exist. Can be used to optimize more expensive +`.test()` calls. Return `false` if link can not be found, `true` - if `.test()` +call needed to know exactly. + + +### .testSchemaAt(text, name, offset) + +Similar to `.test()` but checks only specific protocol tail exactly at given +position. Returns length of found pattern (0 on fail). + + +### .match(text) + +Returns `Array` of found link matches or null if nothing found. + +Each match has: + +- __schema__ - link schema, can be empty for fuzzy links, or `//` for + protocol-neutral links. +- __index__ - offset of matched text +- __lastIndex__ - index of next char after mathch end +- __raw__ - matched text +- __text__ - normalized text +- __url__ - link, generated from matched text + + +### .tlds(list[, keepOld]) + +Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) +to avoid false positives. By default this algorythm used: + +- hostname with any 2-letter root zones are ok. +- biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф + are ok. +- encoded (`xn--...`) root zones are ok. + +If list is replaced, then exact match for 2-chars root zones will be checked. + + +### .add(schema, definition) + +Add new rule with `schema` prefix. For definition details see constructor +description. To disable existing rule use `.add(name, null)` + + +## License + +[MIT](https://github.com/markdown-it/linkify-it/blob/master/LICENSE) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/index.js new file mode 100644 index 00000000..5b0eb5d3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/index.js @@ -0,0 +1,564 @@ +'use strict'; + + +//////////////////////////////////////////////////////////////////////////////// +// Helpers + +// Merge objects +// +function assign(obj /*from1, from2, from3, ...*/) { + var sources = Array.prototype.slice.call(arguments, 1); + + sources.forEach(function (source) { + if (!source) { return; } + + Object.keys(source).forEach(function (key) { + obj[key] = source[key]; + }); + }); + + return obj; +} + +function _class(obj) { return Object.prototype.toString.call(obj); } +function isString(obj) { return _class(obj) === '[object String]'; } +function isObject(obj) { return _class(obj) === '[object Object]'; } +function isRegExp(obj) { return _class(obj) === '[object RegExp]'; } +function isFunction(obj) { return _class(obj) === '[object Function]'; } + + +function escapeRE (str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); } + +//////////////////////////////////////////////////////////////////////////////// + + +var defaultSchemas = { + 'http:': { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.http) { + // compile lazily, because "host"-containing variables can change on tlds update. + self.re.http = new RegExp( + '^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i' + ); + } + if (self.re.http.test(tail)) { + return tail.match(self.re.http)[0].length; + } + return 0; + } + }, + 'https:': 'http:', + 'ftp:': 'http:', + '//': { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.no_http) { + // compile lazily, becayse "host"-containing variables can change on tlds update. + self.re.no_http = new RegExp( + '^' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i' + ); + } + + if (self.re.no_http.test(tail)) { + // should not be `://`, that protects from errors in protocol name + if (pos >= 3 && text[pos - 3] === ':') { return 0; } + return tail.match(self.re.no_http)[0].length; + } + return 0; + } + }, + 'mailto:': { + validate: function (text, pos, self) { + var tail = text.slice(pos); + + if (!self.re.mailto) { + self.re.mailto = new RegExp( + '^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i' + ); + } + if (self.re.mailto.test(tail)) { + return tail.match(self.re.mailto)[0].length; + } + return 0; + } + } +}; + +// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead +var tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); + +//////////////////////////////////////////////////////////////////////////////// + +function resetScanCache(self) { + self.__index__ = -1; + self.__text_cache__ = ''; +} + +function createValidator(re) { + return function (text, pos) { + var tail = text.slice(pos); + + if (re.test(tail)) { + return tail.match(re)[0].length; + } + return 0; + }; +} + +function createNormalizer() { + return function (match, self) { + self.normalize(match); + }; +} + +// Schemas compiler. Build regexps. +// +function compile(self) { + + // Load & clone RE patterns. + var re = self.re = assign({}, require('./lib/re')); + + // Define dynamic patterns + var tlds = self.__tlds__.slice(); + + if (!self.__tlds_replaced__) { + tlds.push('[a-z]{2}'); + } + tlds.push(re.src_xn); + + re.src_tlds = tlds.join('|'); + + function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); } + + re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); + re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); + re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); + + // + // Compile each schema + // + + var aliases = []; + + self.__compiled__ = {}; // Reset compiled data + + function schemaError(name, val) { + throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); + } + + Object.keys(self.__schemas__).forEach(function (name) { + var val = self.__schemas__[name]; + + // skip disabled methods + if (val === null) { return; } + + var compiled = { validate: null, link: null }; + + self.__compiled__[name] = compiled; + + if (isObject(val)) { + if (isRegExp(val.validate)) { + compiled.validate = createValidator(val.validate); + } else if (isFunction(val.validate)) { + compiled.validate = val.validate; + } else { + schemaError(name, val); + } + + if (isFunction(val.normalize)) { + compiled.normalize = val.normalize; + } else if (!val.normalize) { + compiled.normalize = createNormalizer(); + } else { + schemaError(name, val); + } + + return; + } + + if (isString(val)) { + aliases.push(name); + return; + } + + schemaError(name, val); + }); + + // + // Compile postponed aliases + // + + aliases.forEach(function (alias) { + if (!self.__compiled__[self.__schemas__[alias]]) { + // Silently fail on missed schemas to avoid errons on disable. + // schemaError(alias, self.__schemas__[alias]); + return; + } + + self.__compiled__[alias].validate = + self.__compiled__[self.__schemas__[alias]].validate; + self.__compiled__[alias].normalize = + self.__compiled__[self.__schemas__[alias]].normalize; + }); + + // + // Fake record for guessed links + // + self.__compiled__[''] = { validate: null, normalize: createNormalizer() }; + + // + // Build schema condition + // + var slist = Object.keys(self.__compiled__) + .filter(function(name) { + // Filter disabled & fake schemas + return name.length > 0 && self.__compiled__[name]; + }) + .map(escapeRE) + .join('|'); + // (?!_) cause 1.5x slowdown + self.re.schema_test = RegExp('(^|(?!_)(?:>|' + re.src_ZPCcCf + '))(' + slist + ')', 'i'); + self.re.schema_search = RegExp('(^|(?!_)(?:>|' + re.src_ZPCcCf + '))(' + slist + ')', 'ig'); + + self.re.pretest = RegExp( + '(' + self.re.schema_test.source + ')|' + + '(' + self.re.host_fuzzy_test.source + ')|' + + '@', + 'i'); + + // + // Cleanup + // + + resetScanCache(self); +} + +/** + * class Match + * + * Match result. Single element of array, returned by [[LinkifyIt#match]] + **/ +function Match(self, shift) { + var start = self.__index__, + end = self.__last_index__, + text = self.__text_cache__.slice(start, end); + + /** + * Match#schema -> String + * + * Prefix (protocol) for matched string. + **/ + this.schema = self.__schema__.toLowerCase(); + /** + * Match#index -> Number + * + * First position of matched string. + **/ + this.index = start + shift; + /** + * Match#lastIndex -> Number + * + * Next position after matched string. + **/ + this.lastIndex = end + shift; + /** + * Match#raw -> String + * + * Matched string. + **/ + this.raw = text; + /** + * Match#text -> String + * + * Notmalized text of matched string. + **/ + this.text = text; + /** + * Match#url -> String + * + * Normalized url of matched string. + **/ + this.url = text; +} + +function createMatch(self, shift) { + var match = new Match(self, shift); + + self.__compiled__[match.schema].normalize(match, self); + + return match; +} + + +/** + * class LinkifyIt + **/ + +/** + * new LinkifyIt(schemas) + * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) + * + * Creates new linkifier instance with optional additional schemas. + * Can be called without `new` keyword for convenience. + * + * By default understands: + * + * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links + * - "fuzzy" links and emails (example.com, foo@bar.com). + * + * `schemas` is an object, where each key/value describes protocol/rule: + * + * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` + * for example). `linkify-it` makes shure that prefix is not preceeded with + * alphanumeric char and symbols. Only whitespaces and punctuation allowed. + * - __value__ - rule to check tail after link prefix + * - _String_ - just alias to existing rule + * - _Object_ + * - _validate_ - validator function (should return matched length on success), + * or `RegExp`. + * - _normalize_ - optional function to normalize text & url of matched result + * (for example, for @twitter mentions). + **/ +function LinkifyIt(schemas) { + if (!(this instanceof LinkifyIt)) { + return new LinkifyIt(schemas); + } + + // Cache last tested result. Used to skip repeating steps on next `match` call. + this.__index__ = -1; + this.__last_index__ = -1; // Next scan position + this.__schema__ = ''; + this.__text_cache__ = ''; + + this.__schemas__ = assign({}, defaultSchemas, schemas); + this.__compiled__ = {}; + + this.__tlds__ = tlds_default; + this.__tlds_replaced__ = false; + + this.re = {}; + + compile(this); +} + + +/** chainable + * LinkifyIt#add(schema, definition) + * - schema (String): rule name (fixed pattern prefix) + * - definition (String|RegExp|Object): schema definition + * + * Add new rule definition. See constructor description for details. + **/ +LinkifyIt.prototype.add = function add(schema, definition) { + this.__schemas__[schema] = definition; + compile(this); + return this; +}; + + +/** + * LinkifyIt#test(text) -> Boolean + * + * Searches linkifiable pattern and returns `true` on success or `false` on fail. + **/ +LinkifyIt.prototype.test = function test(text) { + // Reset scan cache + this.__text_cache__ = text; + this.__index__ = -1; + + if (!text.length) { return false; } + + var m, ml, me, len, shift, next, re, tld_pos, at_pos; + + // try to scan for link with schema - that's the most simple rule + if (this.re.schema_test.test(text)) { + re = this.re.schema_search; + re.lastIndex = 0; + while ((m = re.exec(text)) !== null) { + len = this.testSchemaAt(text, m[2], re.lastIndex); + if (len) { + this.__schema__ = m[2]; + this.__index__ = m.index + m[1].length; + this.__last_index__ = m.index + m[0].length + len; + break; + } + } + } + + if (this.__compiled__['http:']) { + // guess schemaless links + tld_pos = text.search(this.re.host_fuzzy_test); + if (tld_pos >= 0) { + // if tld is located after found link - no need to check fuzzy pattern + if (this.__index__ < 0 || tld_pos < this.__index__) { + if ((ml = text.match(this.re.link_fuzzy)) !== null) { + + shift = ml.index + ml[1].length; + + if (this.__index__ < 0 || shift < this.__index__) { + this.__schema__ = ''; + this.__index__ = shift; + this.__last_index__ = ml.index + ml[0].length; + } + } + } + } + } + + if (this.__compiled__['mailto:']) { + // guess schemaless emails + at_pos = text.indexOf('@'); + if (at_pos >= 0) { + // We can't skip this check, because this cases are possible: + // 192.168.1.1@gmail.com, my.in@example.com + if ((me = text.match(this.re.email_fuzzy)) !== null) { + + shift = me.index + me[1].length; + next = me.index + me[0].length; + + if (this.__index__ < 0 || shift < this.__index__ || + (shift === this.__index__ && next > this.__last_index__)) { + this.__schema__ = 'mailto:'; + this.__index__ = shift; + this.__last_index__ = next; + } + } + } + } + + return this.__index__ >= 0; +}; + + +/** + * LinkifyIt#pretest(text) -> Boolean + * + * Very quick check, that can give false positives. Returns true if link MAY BE + * can exists. Can be used for speed optimization, when you need to check that + * link NOT exists. + **/ +LinkifyIt.prototype.pretest = function pretest(text) { + return this.re.pretest.test(text); +}; + + +/** + * LinkifyIt#testSchemaAt(text, name, position) -> Number + * - text (String): text to scan + * - name (String): rule (schema) name + * - position (Number): text offset to check from + * + * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly + * at given position. Returns length of found pattern (0 on fail). + **/ +LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { + // If not supported schema check requested - terminate + if (!this.__compiled__[schema.toLowerCase()]) { + return 0; + } + return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); +}; + + +/** + * LinkifyIt#match(text) -> Array|null + * + * Returns array of found link descriptions or `null` on fail. We strongly + * to use [[LinkifyIt#test]] first, for best speed. + * + * ##### Result match description + * + * - __schema__ - link schema, can be empty for fuzzy links, or `//` for + * protocol-neutral links. + * - __index__ - offset of matched text + * - __lastIndex__ - index of next char after mathch end + * - __raw__ - matched text + * - __text__ - normalized text + * - __url__ - link, generated from matched text + **/ +LinkifyIt.prototype.match = function match(text) { + var shift = 0, result = []; + + // Try to take previous element from cache, if .test() called before + if (this.__index__ >= 0 && this.__text_cache__ === text) { + result.push(createMatch(this, shift)); + shift = this.__last_index__; + } + + // Cut head if cache was used + var tail = shift ? text.slice(shift) : text; + + // Scan string until end reached + while (this.test(tail)) { + result.push(createMatch(this, shift)); + + tail = tail.slice(this.__last_index__); + shift += this.__last_index__; + } + + if (result.length) { + return result; + } + + return null; +}; + + +/** chainable + * LinkifyIt#tlds(list [, keepOld]) -> this + * - list (Array): list of tlds + * - keepOld (Boolean): merge with current list if `true` (`false` by default) + * + * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) + * to avoid false positives. By default this algorythm used: + * + * - hostname with any 2-letter root zones are ok. + * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф + * are ok. + * - encoded (`xn--...`) root zones are ok. + * + * If list is replaced, then exact match for 2-chars root zones will be checked. + **/ +LinkifyIt.prototype.tlds = function tlds(list, keepOld) { + list = Array.isArray(list) ? list : [ list ]; + + if (!keepOld) { + this.__tlds__ = list.slice(); + this.__tlds_replaced__ = true; + compile(this); + return this; + } + + this.__tlds__ = this.__tlds__.concat(list) + .sort() + .filter(function(el, idx, arr) { + return el !== arr[idx - 1]; + }) + .reverse(); + + compile(this); + return this; +}; + +/** + * LinkifyIt#normalize(match) + * + * Default normalizer (if schema does not define it's own). + **/ +LinkifyIt.prototype.normalize = function normalize(match) { + + // Do minimal possible changes by default. Need to collect feedback prior + // to move forward https://github.com/markdown-it/linkify-it/issues/1 + + if (!match.schema) { match.url = 'http://' + match.url; } + + if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { + match.url = 'mailto:' + match.url; + } +}; + + +module.exports = LinkifyIt; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/lib/re.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/lib/re.js new file mode 100644 index 00000000..e2ed88eb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/lib/re.js @@ -0,0 +1,143 @@ +'use strict'; + +// Use direct extract instead of `regenerate` to reduse browserified size +var src_Any = exports.src_Any = require('uc.micro/properties/Any/regex').source; +var src_Cc = exports.src_Cc = require('uc.micro/categories/Cc/regex').source; +var src_Cf = exports.src_Cf = require('uc.micro/categories/Cf/regex').source; +var src_Z = exports.src_Z = require('uc.micro/categories/Z/regex').source; +var src_P = exports.src_P = require('uc.micro/categories/P/regex').source; + +// \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) +var src_ZPCcCf = exports.src_ZPCcCf = [ src_Z, src_P, src_Cc, src_Cf ].join('|'); + +// \p{\Z\Cc\CF} (white spaces + control + format) +var src_ZCcCf = exports.src_ZCcCf = [ src_Z, src_Cc, src_Cf ].join('|'); + +// All possible word characters (everything without punctuation, spaces & controls) +// Defined via punctuation & spaces to save space +// Should be something like \p{\L\N\S\M} (\w but without `_`) +var src_pseudo_letter = '(?:(?!' + src_ZPCcCf + ')' + src_Any + ')'; +// The same as abothe but without [0-9] +var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCcCf + ')' + src_Any + ')'; + +//////////////////////////////////////////////////////////////////////////////// + +var src_ip4 = exports.src_ip4 = + + '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; + +exports.src_auth = '(?:(?:(?!' + src_ZCcCf + ').)+@)?'; + +var src_port = exports.src_port = + + '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; + +var src_host_terminator = exports.src_host_terminator = + + '(?=$|' + src_ZPCcCf + ')(?!-|_|:\\d|\\.-|\\.(?!$|' + src_ZPCcCf + '))'; + +var src_path = exports.src_path = + + '(?:' + + '[/?#]' + + '(?:' + + '(?!' + src_ZCcCf + '|[()[\\]{}.,"\'?!\\-]).|' + + '\\[(?:(?!' + src_ZCcCf + '|\\]).)*\\]|' + + '\\((?:(?!' + src_ZCcCf + '|[)]).)*\\)|' + + '\\{(?:(?!' + src_ZCcCf + '|[}]).)*\\}|' + + '\\"(?:(?!' + src_ZCcCf + '|["]).)+\\"|' + + "\\'(?:(?!" + src_ZCcCf + "|[']).)+\\'|" + + "\\'(?=" + src_pseudo_letter + ').|' + // allow `I'm_king` if no pair found + '\\.{2,3}[a-zA-Z0-9%]|' + // github has ... in commit range links. Restrict to + // english & percent-encoded only, until more examples found. + '\\.(?!' + src_ZCcCf + '|[.]).|' + + '\\-(?!' + src_ZCcCf + '|--(?:[^-]|$))(?:[-]+|.)|' + // `---` => long dash, terminate + '\\,(?!' + src_ZCcCf + ').|' + // allow `,,,` in paths + '\\!(?!' + src_ZCcCf + '|[!]).|' + + '\\?(?!' + src_ZCcCf + '|[?]).' + + ')+' + + '|\\/' + + ')?'; + +var src_email_name = exports.src_email_name = + + '[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+'; + +var src_xn = exports.src_xn = + + 'xn--[a-z0-9\\-]{1,59}'; + +// More to read about domain names +// http://serverfault.com/questions/638260/ + +var src_domain_root = exports.src_domain_root = + + // Can't have digits and dashes + '(?:' + + src_xn + + '|' + + src_pseudo_letter_non_d + '{1,63}' + + ')'; + +var src_domain = exports.src_domain = + + '(?:' + + src_xn + + '|' + + '(?:' + src_pseudo_letter + ')' + + '|' + + // don't allow `--` in domain names, because: + // - that can conflict with markdown — / – + // - nobody use those anyway + '(?:' + src_pseudo_letter + '(?:-(?!-)|' + src_pseudo_letter + '){0,61}' + src_pseudo_letter + ')' + + ')'; + +var src_host = exports.src_host = + + '(?:' + + src_ip4 + + '|' + + '(?:(?:(?:' + src_domain + ')\\.)*' + src_domain_root + ')' + + ')'; + +var tpl_host_fuzzy = exports.tpl_host_fuzzy = + + '(?:' + + src_ip4 + + '|' + + '(?:(?:(?:' + src_domain + ')\\.)+(?:%TLDS%))' + + ')'; + +exports.src_host_strict = + + src_host + src_host_terminator; + +var tpl_host_fuzzy_strict = exports.tpl_host_fuzzy_strict = + + tpl_host_fuzzy + src_host_terminator; + +exports.src_host_port_strict = + + src_host + src_port + src_host_terminator; + +var tpl_host_port_fuzzy_strict = exports.tpl_host_port_fuzzy_strict = + + tpl_host_fuzzy + src_port + src_host_terminator; + +//////////////////////////////////////////////////////////////////////////////// +// Main rules + +// Rude test fuzzy links by host, for quick deny +exports.tpl_host_fuzzy_test = + + 'localhost|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + src_ZPCcCf + '|$))'; + +exports.tpl_email_fuzzy = + + '(^|>|' + src_ZCcCf + ')(' + src_email_name + '@' + tpl_host_fuzzy_strict + ')'; + +exports.tpl_link_fuzzy = + // Fuzzy link can't be prepended with .:/\- and non punctuation. + // but can start with > (markdown blockquote) + '(^|(?![.:/\\-_@])(?:[$+<=>^`|]|' + src_ZPCcCf + '))' + + '((?![$+<=>^`|])' + tpl_host_port_fuzzy_strict + src_path + ')'; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/.npmignore new file mode 100644 index 00000000..84e96aea --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/.npmignore @@ -0,0 +1,5 @@ +node_modules/ +coverage/ +demo/ +apidoc/ +*.log diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/CHANGELOG.md new file mode 100644 index 00000000..4ff5e8d8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/CHANGELOG.md @@ -0,0 +1,10 @@ +1.0.0 / 2015-03-10 +------------------ + +- Export all in index.js + + +0.1.0 / 2015-02-22 +------------------ + +- First release. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/Makefile new file mode 100644 index 00000000..cf0bd92c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/Makefile @@ -0,0 +1,44 @@ +NPM_PACKAGE := $(shell node -e 'process.stdout.write(require("./package.json").name)') +NPM_VERSION := $(shell node -e 'process.stdout.write(require("./package.json").version)') + +REMOTE_NAME ?= origin +REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url) + +CURR_HEAD := $(firstword $(shell git show-ref --hash HEAD | cut -b -6) master) +GITHUB_PROJ := https://github.com//markdown-it/${NPM_PACKAGE} + + +refresh: + rm -rf properties + rm -rf categories + + mkdir -p properties/Any + cp node_modules/unicode-7.0.0/properties/Any/regex.js properties/Any/ + mkdir -p categories/Cc + cp node_modules/unicode-7.0.0/categories/Cc/regex.js categories/Cc/ + mkdir -p categories/Cf + cp node_modules/unicode-7.0.0/categories/Cf/regex.js categories/Cf/ + mkdir -p categories/Z + cp node_modules/unicode-7.0.0/categories/Z/regex.js categories/Z/ + mkdir -p categories/P + cp node_modules/unicode-7.0.0/categories/P/regex.js categories/P/ + + +publish: + @if test 0 -ne `git status --porcelain | wc -l` ; then \ + echo "Unclean working tree. Commit or stash changes first." >&2 ; \ + exit 128 ; \ + fi + @if test 0 -ne `git fetch ; git status | grep '^# Your branch' | wc -l` ; then \ + echo "Local/Remote history differs. Please push/pull changes." >&2 ; \ + exit 128 ; \ + fi + @if test 0 -ne `git tag -l ${NPM_VERSION} | wc -l` ; then \ + echo "Tag ${NPM_VERSION} exists. Update package.json" >&2 ; \ + exit 128 ; \ + fi + git tag ${NPM_VERSION} && git push origin ${NPM_VERSION} + npm publish ${GITHUB_PROJ}/tarball/${NPM_VERSION} + +.PHONY: publish +#.SILENT: help lint test todo diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/README.md new file mode 100644 index 00000000..763fe395 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/README.md @@ -0,0 +1,16 @@ +# uc.micro + +[![NPM version](https://img.shields.io/npm/v/uc.micro.svg?style=flat)](https://www.npmjs.org/package/uc.micro) + +> Micro subset of unicode data files for [markdown-it](https://github.com/markdown-it) projects. + +Content of this repo is autogenerated from unicode package, maintained by [Mathias Bynens](https://github.com/mathiasbynens). +Curently from [unicode-7.0.0](https://github.com/mathiasbynens/unicode-7.0.0). + +That's just a proxy to reduce dependencies/install size. + +**This package content is ONLY for [markdown-it](https://github.com/markdown-it) projects needs. Don't ask to extend it!** + +## License + +[WTFPL](http://www.wtfpl.net/txt/copying/) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Cc/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Cc/regex.js new file mode 100644 index 00000000..99be991f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Cc/regex.js @@ -0,0 +1 @@ +module.exports=/[\0-\x1F\x7F-\x9F]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Cf/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Cf/regex.js new file mode 100644 index 00000000..a47587c3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Cf/regex.js @@ -0,0 +1 @@ +module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/P/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/P/regex.js new file mode 100644 index 00000000..2e7d1082 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/P/regex.js @@ -0,0 +1 @@ +module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDE38-\uDE3D]|\uD805[\uDCC6\uDDC1-\uDDC9\uDE41-\uDE43]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Z/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Z/regex.js new file mode 100644 index 00000000..76976a4d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/categories/Z/regex.js @@ -0,0 +1 @@ +module.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/index.js new file mode 100644 index 00000000..c1929bc1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/index.js @@ -0,0 +1,6 @@ + +module.exports.Any = require('./properties/Any/regex'); +module.exports.Cc = require('./categories/Cc/regex'); +module.exports.Cf = require('./categories/Cf/regex'); +module.exports.P = require('./categories/P/regex'); +module.exports.Z = require('./categories/Z/regex'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/package.json new file mode 100644 index 00000000..dc42873b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/package.json @@ -0,0 +1,44 @@ +{ + "name": "uc.micro", + "version": "1.0.0", + "description": "Micro subset of unicode data files for markdown-it projects.", + "repository": { + "type": "git", + "url": "git+https://github.com/markdown-it/uc.micro.git" + }, + "license": { + "type": "WTFPL", + "url": "http://www.wtfpl.net/txt/copying/" + }, + "main": "index.js", + "devDependencies": { + "unicode-7.0.0": "~0.1.5" + }, + "gitHead": "203bd5056107b9b27761fa8b21f88e01b7a90256", + "bugs": { + "url": "https://github.com/markdown-it/uc.micro/issues" + }, + "homepage": "https://github.com/markdown-it/uc.micro", + "_id": "uc.micro@1.0.0", + "scripts": {}, + "_shasum": "4c5a6dee941b515a5bd5cf5d05b121e0e49c5fb7", + "_from": "uc.micro@>=1.0.0 <2.0.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + }, + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "4c5a6dee941b515a5bd5cf5d05b121e0e49c5fb7", + "tarball": "http://registry.npmjs.org/uc.micro/-/uc.micro-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/properties/Any/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/properties/Any/regex.js new file mode 100644 index 00000000..67c8b125 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/node_modules/uc.micro/properties/Any/regex.js @@ -0,0 +1 @@ +module.exports=/[\0-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/package.json new file mode 100644 index 00000000..83451035 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/linkify-it/package.json @@ -0,0 +1,65 @@ +{ + "name": "linkify-it", + "version": "0.1.5", + "description": "Links recognition library with FULL unicode support", + "keywords": [ + "linkify", + "linkifier", + "autolink", + "autolinker" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/markdown-it/linkify-it.git" + }, + "license": "MIT", + "scripts": { + "test": "make test" + }, + "dependencies": { + "uc.micro": "^1.0.0" + }, + "devDependencies": { + "ansi": "~0.3.0", + "autoprefixer-stylus": "~0.5.0", + "benchmark": "~1.0.0", + "browserify": "*", + "chai": "^2.0.0", + "coveralls": "~2.11.2", + "jade": "~1.9.2", + "eslint": "0.13.0", + "eslint-plugin-nodeca": "^1.0.0", + "istanbul": "*", + "mdurl": "^1.0.0", + "mocha": "*", + "ndoc": "^3.1.0", + "stylus": "~0.50.0", + "tlds": "^1.26.0" + }, + "gitHead": "ec7be2e7ccb89715e6c635ea3a16d8592499775a", + "bugs": { + "url": "https://github.com/markdown-it/linkify-it/issues" + }, + "homepage": "https://github.com/markdown-it/linkify-it", + "_id": "linkify-it@0.1.5", + "_shasum": "38c583d32fa93ed726da00c7af001078bfb6b945", + "_from": "linkify-it@>=0.1.2 <0.2.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + }, + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "38c583d32fa93ed726da00c7af001078bfb6b945", + "tarball": "http://registry.npmjs.org/linkify-it/-/linkify-it-0.1.5.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-0.1.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/CHANGELOG.md new file mode 100644 index 00000000..ed33c789 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/CHANGELOG.md @@ -0,0 +1,16 @@ +1.0.1 / 2015-09-15 +------------------ + +- Fixed closure compiler compatibility (#1). + + +1.0.0 / 2015-03-04 +------------------ + +- Added `.decode()`, `.parse()`, `.format()`. + + +0.0.1 / 2015-03-02 +------------------ + +- First release. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/LICENSE new file mode 100644 index 00000000..3b2c7bfb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/LICENSE @@ -0,0 +1,45 @@ +Copyright (c) 2015 Vitaly Puzrin, Alex Kocharin. + +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. + +-------------------------------------------------------------------------------- + +.parse() is based on Joyent's node.js `url` code: + +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/README.md new file mode 100644 index 00000000..72aebef0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/README.md @@ -0,0 +1,102 @@ +# mdurl + +[![Build Status](https://img.shields.io/travis/markdown-it/mdurl/master.svg?style=flat)](https://travis-ci.org/markdown-it/mdurl) +[![NPM version](https://img.shields.io/npm/v/mdurl.svg?style=flat)](https://www.npmjs.org/package/mdurl) + +> URL utilities for [markdown-it](https://github.com/markdown-it/markdown-it) parser. + + +## API + +### .encode(str [, exclude, keepEncoded]) -> String + +Percent-encode a string, avoiding double encoding. Don't touch `/a-zA-Z0-9/` + +excluded chars + `/%[a-fA-F0-9]{2}/` (if not disabled). Broken surrorates are +replaced with `U+FFFD`. + +Params: + +- __str__ - input string. +- __exclude__ - optional, `;/?:@&=+$,-_.!~*'()#`. Additional chars to keep intact + (except `/a-zA-Z0-9/`). +- __keepEncoded__ - optional, `true`. By default it skips already encoded sequences + (`/%[a-fA-F0-9]{2}/`). If set to `false`, `%` will be encoded. + + +### encode.defaultChars, encode.componentChars + +You can use these constants as second argument to `encode` function. + + - `encode.defaultChars` is the same exclude set as in the standard `encodeURI()` function + - `encode.componentChars` is the same exclude set as in the `encodeURIComponent()` function + +For example, `encode('something', encode.componentChars, true)` is roughly the equivalent of +the `encodeURIComponent()` function (except `encode()` doesn't throw). + + +### .decode(str [, exclude]) -> String + +Decode percent-encoded string. Invalid percent-encoded sequences (e.g. `%2G`) +are left as is. Invalid UTF-8 characters are replaced with `U+FFFD`. + + +Params: + +- __str__ - input string. +- __exclude__ - set of characters to leave encoded, optional, `;/?:@&=+$,#`. + + +### decode.defaultChars, decode.componentChars + +You can use these constants as second argument to `decode` function. + + - `decode.defaultChars` is the same exclude set as in the standard `decodeURI()` function + - `decode.componentChars` is the same exclude set as in the `decodeURIComponent()` function + +For example, `decode('something', decode.defaultChars)` has the same behavior as +`decodeURI('something')` on a correctly encoded input. + + +### .parse(url, slashesDenoteHost) -> urlObs + +Parse url string. Similar to node's [url.parse](http://nodejs.org/api/url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost), but without any +normalizations and query string parse. + + - __url__ - input url (string) + - __slashesDenoteHost__ - if url starts with `//`, expect a hostname after it. Optional, `false`. + +Result (hash): + +- protocol +- slashes +- auth +- port +- hostname +- hash +- search +- pathname + +Difference with node's `url`: + +1. No leading slash in paths, e.g. in `url.parse('http://foo?bar')` pathname is + ``, not `/` +2. Backslashes are not replaced with slashes, so `http:\\example.org\` is + treated like a relative path +3. Trailing colon is treated like a part of the path, i.e. in + `http://example.org:foo` pathname is `:foo` +4. Nothing is URL-encoded in the resulting object, (in joyent/node some chars + in auth and paths are encoded) +5. `url.parse()` does not have `parseQueryString` argument +6. Removed extraneous result properties: `host`, `path`, `query`, etc., + which can be constructed using other parts of the url. + + +### .format(urlObject) + +Format an object previously obtained with `.parse()` function. Similar to node's +[url.format](http://nodejs.org/api/url.html#url_url_format_urlobj). + + +## License + +[MIT](https://github.com/markdown-it/mdurl/blob/master/LICENSE) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/decode.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/decode.js new file mode 100644 index 00000000..189d7b9c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/decode.js @@ -0,0 +1,122 @@ + +'use strict'; + + +/* eslint-disable no-bitwise */ + +var decodeCache = {}; + +function getDecodeCache(exclude) { + var i, ch, cache = decodeCache[exclude]; + if (cache) { return cache; } + + cache = decodeCache[exclude] = []; + + for (i = 0; i < 128; i++) { + ch = String.fromCharCode(i); + cache.push(ch); + } + + for (i = 0; i < exclude.length; i++) { + ch = exclude.charCodeAt(i); + cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2); + } + + return cache; +} + + +// Decode percent-encoded string. +// +function decode(string, exclude) { + var cache; + + if (typeof exclude !== 'string') { + exclude = decode.defaultChars; + } + + cache = getDecodeCache(exclude); + + return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) { + var i, l, b1, b2, b3, b4, chr, + result = ''; + + for (i = 0, l = seq.length; i < l; i += 3) { + b1 = parseInt(seq.slice(i + 1, i + 3), 16); + + if (b1 < 0x80) { + result += cache[b1]; + continue; + } + + if ((b1 & 0xE0) === 0xC0 && (i + 3 < l)) { + // 110xxxxx 10xxxxxx + b2 = parseInt(seq.slice(i + 4, i + 6), 16); + + if ((b2 & 0xC0) === 0x80) { + chr = ((b1 << 6) & 0x7C0) | (b2 & 0x3F); + + if (chr < 0x80) { + result += '\ufffd\ufffd'; + } else { + result += String.fromCharCode(chr); + } + + i += 3; + continue; + } + } + + if ((b1 & 0xF0) === 0xE0 && (i + 6 < l)) { + // 1110xxxx 10xxxxxx 10xxxxxx + b2 = parseInt(seq.slice(i + 4, i + 6), 16); + b3 = parseInt(seq.slice(i + 7, i + 9), 16); + + if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { + chr = ((b1 << 12) & 0xF000) | ((b2 << 6) & 0xFC0) | (b3 & 0x3F); + + if (chr < 0x800 || (chr >= 0xD800 && chr <= 0xDFFF)) { + result += '\ufffd\ufffd\ufffd'; + } else { + result += String.fromCharCode(chr); + } + + i += 6; + continue; + } + } + + if ((b1 & 0xF8) === 0xF0 && (i + 9 < l)) { + // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx + b2 = parseInt(seq.slice(i + 4, i + 6), 16); + b3 = parseInt(seq.slice(i + 7, i + 9), 16); + b4 = parseInt(seq.slice(i + 10, i + 12), 16); + + if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { + chr = ((b1 << 18) & 0x1C0000) | ((b2 << 12) & 0x3F000) | ((b3 << 6) & 0xFC0) | (b4 & 0x3F); + + if (chr < 0x10000 || chr > 0x10FFFF) { + result += '\ufffd\ufffd\ufffd\ufffd'; + } else { + chr -= 0x10000; + result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)); + } + + i += 9; + continue; + } + } + + result += '\ufffd'; + } + + return result; + }); +} + + +decode.defaultChars = ';/?:@&=+$,#'; +decode.componentChars = ''; + + +module.exports = decode; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/encode.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/encode.js new file mode 100644 index 00000000..6dff4f96 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/encode.js @@ -0,0 +1,98 @@ + +'use strict'; + + +var encodeCache = {}; + + +// Create a lookup array where anything but characters in `chars` string +// and alphanumeric chars is percent-encoded. +// +function getEncodeCache(exclude) { + var i, ch, cache = encodeCache[exclude]; + if (cache) { return cache; } + + cache = encodeCache[exclude] = []; + + for (i = 0; i < 128; i++) { + ch = String.fromCharCode(i); + + if (/^[0-9a-z]$/i.test(ch)) { + // always allow unencoded alphanumeric characters + cache.push(ch); + } else { + cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); + } + } + + for (i = 0; i < exclude.length; i++) { + cache[exclude.charCodeAt(i)] = exclude[i]; + } + + return cache; +} + + +// Encode unsafe characters with percent-encoding, skipping already +// encoded sequences. +// +// - string - string to encode +// - exclude - list of characters to ignore (in addition to a-zA-Z0-9) +// - keepEscaped - don't encode '%' in a correct escape sequence (default: true) +// +function encode(string, exclude, keepEscaped) { + var i, l, code, nextCode, cache, + result = ''; + + if (typeof exclude !== 'string') { + // encode(string, keepEscaped) + keepEscaped = exclude; + exclude = encode.defaultChars; + } + + if (typeof keepEscaped === 'undefined') { + keepEscaped = true; + } + + cache = getEncodeCache(exclude); + + for (i = 0, l = string.length; i < l; i++) { + code = string.charCodeAt(i); + + if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { + if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { + result += string.slice(i, i + 3); + i += 2; + continue; + } + } + + if (code < 128) { + result += cache[code]; + continue; + } + + if (code >= 0xD800 && code <= 0xDFFF) { + if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { + nextCode = string.charCodeAt(i + 1); + if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { + result += encodeURIComponent(string[i] + string[i + 1]); + i++; + continue; + } + } + result += '%EF%BF%BD'; + continue; + } + + result += encodeURIComponent(string[i]); + } + + return result; +} + +encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; +encode.componentChars = "-_.!~*'()"; + + +module.exports = encode; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/format.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/format.js new file mode 100644 index 00000000..c4eb9f4a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/format.js @@ -0,0 +1,25 @@ + +'use strict'; + + +module.exports = function format(url) { + var result = ''; + + result += url.protocol || ''; + result += url.slashes ? '//' : ''; + result += url.auth ? url.auth + '@' : ''; + + if (url.hostname && url.hostname.indexOf(':') !== -1) { + // ipv6 address + result += '[' + url.hostname + ']'; + } else { + result += url.hostname || ''; + } + + result += url.port ? ':' + url.port : ''; + result += url.pathname || ''; + result += url.search || ''; + result += url.hash || ''; + + return result; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/index.js new file mode 100644 index 00000000..194abff5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/index.js @@ -0,0 +1,7 @@ +'use strict'; + + +module.exports.encode = require('./encode'); +module.exports.decode = require('./decode'); +module.exports.format = require('./format'); +module.exports.parse = require('./parse'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/package.json new file mode 100644 index 00000000..f7796b38 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/package.json @@ -0,0 +1,46 @@ +{ + "name": "mdurl", + "version": "1.0.1", + "description": "URL utilities for markdown-it", + "repository": { + "type": "git", + "url": "git+https://github.com/markdown-it/mdurl.git" + }, + "license": "MIT", + "scripts": { + "test": "make test" + }, + "devDependencies": { + "mocha": "*", + "eslint": "0.13.0", + "eslint-plugin-nodeca": "^1.0.0", + "istanbul": "*" + }, + "gitHead": "8bfd33610062a71155cc64254271555a49db8332", + "bugs": { + "url": "https://github.com/markdown-it/mdurl/issues" + }, + "homepage": "https://github.com/markdown-it/mdurl#readme", + "_id": "mdurl@1.0.1", + "_shasum": "fe85b2ec75a59037f2adfec100fd6c601761152e", + "_from": "mdurl@>=1.0.0 <1.1.0", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + }, + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "fe85b2ec75a59037f2adfec100fd6c601761152e", + "tarball": "http://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/parse.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/parse.js new file mode 100644 index 00000000..6c33ac12 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/mdurl/parse.js @@ -0,0 +1,312 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +'use strict'; + +// +// Changes from joyent/node: +// +// 1. No leading slash in paths, +// e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` +// +// 2. Backslashes are not replaced with slashes, +// so `http:\\example.org\` is treated like a relative path +// +// 3. Trailing colon is treated like a part of the path, +// i.e. in `http://example.org:foo` pathname is `:foo` +// +// 4. Nothing is URL-encoded in the resulting object, +// (in joyent/node some chars in auth and paths are encoded) +// +// 5. `url.parse()` does not have `parseQueryString` argument +// +// 6. Removed extraneous result properties: `host`, `path`, `query`, etc., +// which can be constructed using other parts of the url. +// + + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.pathname = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = [ '<', '>', '"', '`', ' ', '\r', '\n', '\t' ], + + // RFC 2396: characters not allowed for various reasons. + unwise = [ '{', '}', '|', '\\', '^', '`' ].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = [ '\'' ].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = [ '%', '/', '?', ';', '#' ].concat(autoEscape), + hostEndingChars = [ '/', '?', '#' ], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + /* eslint-disable no-script-url */ + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }; + /* eslint-enable no-script-url */ + +function urlParse(url, slashesDenoteHost) { + if (url && url instanceof Url) { return url; } + + var u = new Url(); + u.parse(url, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, slashesDenoteHost) { + var i, l, lowerProto, hec, slashes, + rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + lowerProto = proto.toLowerCase(); + this.protocol = proto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (i = 0; i < hostEndingChars.length; i++) { + hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = auth; + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (i = 0; i < nonHostChars.length; i++) { + hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { + hostEnd = hec; + } + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) { + hostEnd = rest.length; + } + + if (rest[hostEnd - 1] === ':') { hostEnd--; } + var host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(host); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) { continue; } + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + } + } + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + rest = rest.slice(0, qm); + } + if (rest) { this.pathname = rest; } + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = ''; + } + + return this; +}; + +Url.prototype.parseHost = function(host) { + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) { this.hostname = host; } +}; + +module.exports = urlParse; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/.npmignore new file mode 100644 index 00000000..84e96aea --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/.npmignore @@ -0,0 +1,5 @@ +node_modules/ +coverage/ +demo/ +apidoc/ +*.log diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/Makefile new file mode 100644 index 00000000..cf0bd92c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/Makefile @@ -0,0 +1,44 @@ +NPM_PACKAGE := $(shell node -e 'process.stdout.write(require("./package.json").name)') +NPM_VERSION := $(shell node -e 'process.stdout.write(require("./package.json").version)') + +REMOTE_NAME ?= origin +REMOTE_REPO ?= $(shell git config --get remote.${REMOTE_NAME}.url) + +CURR_HEAD := $(firstword $(shell git show-ref --hash HEAD | cut -b -6) master) +GITHUB_PROJ := https://github.com//markdown-it/${NPM_PACKAGE} + + +refresh: + rm -rf properties + rm -rf categories + + mkdir -p properties/Any + cp node_modules/unicode-7.0.0/properties/Any/regex.js properties/Any/ + mkdir -p categories/Cc + cp node_modules/unicode-7.0.0/categories/Cc/regex.js categories/Cc/ + mkdir -p categories/Cf + cp node_modules/unicode-7.0.0/categories/Cf/regex.js categories/Cf/ + mkdir -p categories/Z + cp node_modules/unicode-7.0.0/categories/Z/regex.js categories/Z/ + mkdir -p categories/P + cp node_modules/unicode-7.0.0/categories/P/regex.js categories/P/ + + +publish: + @if test 0 -ne `git status --porcelain | wc -l` ; then \ + echo "Unclean working tree. Commit or stash changes first." >&2 ; \ + exit 128 ; \ + fi + @if test 0 -ne `git fetch ; git status | grep '^# Your branch' | wc -l` ; then \ + echo "Local/Remote history differs. Please push/pull changes." >&2 ; \ + exit 128 ; \ + fi + @if test 0 -ne `git tag -l ${NPM_VERSION} | wc -l` ; then \ + echo "Tag ${NPM_VERSION} exists. Update package.json" >&2 ; \ + exit 128 ; \ + fi + git tag ${NPM_VERSION} && git push origin ${NPM_VERSION} + npm publish ${GITHUB_PROJ}/tarball/${NPM_VERSION} + +.PHONY: publish +#.SILENT: help lint test todo diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/README.md new file mode 100644 index 00000000..763fe395 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/README.md @@ -0,0 +1,16 @@ +# uc.micro + +[![NPM version](https://img.shields.io/npm/v/uc.micro.svg?style=flat)](https://www.npmjs.org/package/uc.micro) + +> Micro subset of unicode data files for [markdown-it](https://github.com/markdown-it) projects. + +Content of this repo is autogenerated from unicode package, maintained by [Mathias Bynens](https://github.com/mathiasbynens). +Curently from [unicode-7.0.0](https://github.com/mathiasbynens/unicode-7.0.0). + +That's just a proxy to reduce dependencies/install size. + +**This package content is ONLY for [markdown-it](https://github.com/markdown-it) projects needs. Don't ask to extend it!** + +## License + +[WTFPL](http://www.wtfpl.net/txt/copying/) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Cc/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Cc/regex.js new file mode 100644 index 00000000..99be991f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Cc/regex.js @@ -0,0 +1 @@ +module.exports=/[\0-\x1F\x7F-\x9F]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Cf/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Cf/regex.js new file mode 100644 index 00000000..a47587c3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Cf/regex.js @@ -0,0 +1 @@ +module.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804\uDCBD|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/P/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/P/regex.js new file mode 100644 index 00000000..2e7d1082 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/P/regex.js @@ -0,0 +1 @@ +module.exports=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDE38-\uDE3D]|\uD805[\uDCC6\uDDC1-\uDDC9\uDE41-\uDE43]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Z/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Z/regex.js new file mode 100644 index 00000000..76976a4d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/categories/Z/regex.js @@ -0,0 +1 @@ +module.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/index.js new file mode 100644 index 00000000..d9d6e9eb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/index.js @@ -0,0 +1,2 @@ +// Dummy. Require files directly. +module.exports = null; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/package.json new file mode 100644 index 00000000..7f2cf544 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/package.json @@ -0,0 +1,44 @@ +{ + "name": "uc.micro", + "version": "0.1.0", + "description": "Micro subset of unicode data files for markdown-it projects.", + "repository": { + "type": "git", + "url": "git+https://github.com/markdown-it/uc.micro.git" + }, + "license": { + "type": "WTFPL", + "url": "http://www.wtfpl.net/txt/copying/" + }, + "main": "index.js", + "devDependencies": { + "unicode-7.0.0": "~0.1.5" + }, + "gitHead": "5e4cdb61d0ddf610c167f11f0a5d1dc95abbde03", + "bugs": { + "url": "https://github.com/markdown-it/uc.micro/issues" + }, + "homepage": "https://github.com/markdown-it/uc.micro", + "_id": "uc.micro@0.1.0", + "scripts": {}, + "_shasum": "eda1121d1fdb96154ed6fde8247bbbdb833308ca", + "_from": "uc.micro@>=0.1.0 <0.2.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + }, + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "eda1121d1fdb96154ed6fde8247bbbdb833308ca", + "tarball": "http://registry.npmjs.org/uc.micro/-/uc.micro-0.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-0.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/properties/Any/regex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/properties/Any/regex.js new file mode 100644 index 00000000..67c8b125 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/node_modules/uc.micro/properties/Any/regex.js @@ -0,0 +1 @@ +module.exports=/[\0-\uD7FF\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF]/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/package.json new file mode 100644 index 00000000..2888a6af --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/markdown-it/package.json @@ -0,0 +1,83 @@ +{ + "name": "markdown-it", + "version": "3.1.0", + "description": "Markdown-it - modern pluggable markdown parser.", + "keywords": [ + "markdown", + "parser", + "commonmark", + "markdown-it", + "markdown-it-plugin" + ], + "homepage": "https://github.com/markdown-it/markdown-it", + "repository": { + "type": "git", + "url": "git+https://github.com/markdown-it/markdown-it.git" + }, + "license": "MIT", + "main": "index.js", + "bin": { + "markdown-it": "bin/markdown-it.js" + }, + "scripts": { + "test": "make test" + }, + "dependencies": { + "argparse": "~ 1.0.0", + "linkify-it": "~ 0.1.2", + "mdurl": "~ 1.0.0", + "uc.micro": "~ 0.1.0" + }, + "devDependencies": { + "ansi": "~0.3.0", + "autoprefixer-stylus": "~0.5.0", + "benchmark": "~1.0.0", + "browserify": "*", + "chai": "~2.1.0", + "commonmark": "~0.18.1", + "coveralls": "~2.11.2", + "eslint": "0.13.0", + "eslint-plugin-nodeca": "^1.0.0", + "istanbul": "*", + "jade": "~1.9.2", + "markdown-it-abbr": "~ 0.1.0", + "markdown-it-deflist": "~ 0.1.0", + "markdown-it-emoji": "~ 0.1.3", + "markdown-it-footnote": "~ 0.1.0", + "markdown-it-for-inline": "~ 0.1.0", + "markdown-it-ins": "~ 0.1.0", + "markdown-it-mark": "~ 0.1.0", + "markdown-it-sub": "~ 0.1.0", + "markdown-it-sup": "~ 0.1.0", + "markdown-it-testgen": "~ 0.1.3", + "marked": "0.3.3", + "stylus": "~0.50.0", + "mocha": "*", + "uglify-js": "*" + }, + "gitHead": "329a35a9c96a9451f66febfdb00255aa06de29c7", + "bugs": { + "url": "https://github.com/markdown-it/markdown-it/issues" + }, + "_id": "markdown-it@3.1.0", + "_shasum": "20a71e8e67b1297c96ac47d00f7b6e690d6e0c36", + "_from": "markdown-it@>=3.0.3 <4.0.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + }, + "maintainers": [ + { + "name": "vitaly", + "email": "vitaly@rcdesign.ru" + } + ], + "dist": { + "shasum": "20a71e8e67b1297c96ac47d00f7b6e690d6e0c36", + "tarball": "http://registry.npmjs.org/markdown-it/-/markdown-it-3.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-3.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/.npmignore new file mode 100644 index 00000000..f1250e58 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/.npmignore @@ -0,0 +1,4 @@ +support +test +examples +*.sock diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/History.md new file mode 100644 index 00000000..55c4af74 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/History.md @@ -0,0 +1,40 @@ + +0.1.4 / 2013-08-11 +================== + + * update fresh + +0.1.3 / 2013-07-08 +================== + + * Revert "Fix fd leak" + +0.1.2 / 2013-07-03 +================== + + * Fix fd leak + +0.1.0 / 2012-08-25 +================== + + * add options parameter to send() that is passed to fs.createReadStream() [kanongil] + +0.0.4 / 2012-08-16 +================== + + * allow custom "Accept-Ranges" definition + +0.0.3 / 2012-07-16 +================== + + * fix normalization of the root directory. Closes #3 + +0.0.2 / 2012-07-09 +================== + + * add passing of req explicitly for now (YUCK) + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/Makefile new file mode 100644 index 00000000..a9dcfd50 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/Readme.md new file mode 100644 index 00000000..ea7b2341 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/Readme.md @@ -0,0 +1,128 @@ +# send + + Send is Connect's `static()` extracted for generalized use, a streaming static file + server supporting partial responses (Ranges), conditional-GET negotiation, high test coverage, and granular events which may be leveraged to take appropriate actions in your application or framework. + +## Installation + + $ npm install send + +## Examples + + Small: + +```js +var http = require('http'); +var send = require('send'); + +var app = http.createServer(function(req, res){ + send(req, req.url).pipe(res); +}).listen(3000); +``` + + Serving from a root directory with custom error-handling: + +```js +var http = require('http'); +var send = require('send'); +var url = require('url'); + +var app = http.createServer(function(req, res){ + // your custom error-handling logic: + function error(err) { + res.statusCode = err.status || 500; + res.end(err.message); + } + + // your custom directory handling logic: + function redirect() { + res.statusCode = 301; + res.setHeader('Location', req.url + '/'); + res.end('Redirecting to ' + req.url + '/'); + } + + // transfer arbitrary files from within + // /www/example.com/public/* + send(req, url.parse(req.url).pathname) + .root('/www/example.com/public') + .on('error', error) + .on('directory', redirect) + .pipe(res); +}).listen(3000); +``` + +## API + +### Events + + - `error` an error occurred `(err)` + - `directory` a directory was requested + - `file` a file was requested `(path, stat)` + - `stream` file streaming has started `(stream)` + - `end` streaming has completed + +### .root(dir) + + Serve files relative to `path`. Aliased as `.from(dir)`. + +### .index(path) + + By default send supports "index.html" files, to disable this + invoke `.index(false)` or to supply a new index pass a string. + +### .maxage(ms) + + Provide a max-age in milliseconds for http caching, defaults to 0. + +### .hidden(bool) + + Enable or disable transfer of hidden files, defaults to false. + +## Error-handling + + By default when no `error` listeners are present an automatic response will be made, otherwise you have full control over the response, aka you may show a 5xx page etc. + +## Caching + + It does _not_ perform internal caching, you should use a reverse proxy cache such + as Varnish for this, or those fancy things called CDNs. If your application is small enough that it would benefit from single-node memory caching, it's small enough that it does not need caching at all ;). + +## Debugging + + To enable `debug()` instrumentation output export __DEBUG__: + +``` +$ DEBUG=send node app +``` + +## Running tests + +``` +$ npm install +$ make test +``` + +## License + +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/index.js new file mode 100644 index 00000000..f17158d8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./lib/send'); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/lib/send.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/lib/send.js new file mode 100644 index 00000000..a3d94a69 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/lib/send.js @@ -0,0 +1,474 @@ + +/** + * Module dependencies. + */ + +var debug = require('debug')('send') + , parseRange = require('range-parser') + , Stream = require('stream') + , mime = require('mime') + , fresh = require('fresh') + , path = require('path') + , http = require('http') + , fs = require('fs') + , basename = path.basename + , normalize = path.normalize + , join = path.join + , utils = require('./utils'); + +/** + * Expose `send`. + */ + +exports = module.exports = send; + +/** + * Expose mime module. + */ + +exports.mime = mime; + +/** + * Return a `SendStream` for `req` and `path`. + * + * @param {Request} req + * @param {String} path + * @param {Object} options + * @return {SendStream} + * @api public + */ + +function send(req, path, options) { + return new SendStream(req, path, options); +} + +/** + * Initialize a `SendStream` with the given `path`. + * + * Events: + * + * - `error` an error occurred + * - `stream` file streaming has started + * - `end` streaming has completed + * - `directory` a directory was requested + * + * @param {Request} req + * @param {String} path + * @param {Object} options + * @api private + */ + +function SendStream(req, path, options) { + var self = this; + this.req = req; + this.path = path; + this.options = options || {}; + this.maxage(0); + this.hidden(false); + this.index('index.html'); +} + +/** + * Inherits from `Stream.prototype`. + */ + +SendStream.prototype.__proto__ = Stream.prototype; + +/** + * Enable or disable "hidden" (dot) files. + * + * @param {Boolean} path + * @return {SendStream} + * @api public + */ + +SendStream.prototype.hidden = function(val){ + debug('hidden %s', val); + this._hidden = val; + return this; +}; + +/** + * Set index `path`, set to a falsy + * value to disable index support. + * + * @param {String|Boolean} path + * @return {SendStream} + * @api public + */ + +SendStream.prototype.index = function(path){ + debug('index %s', path); + this._index = path; + return this; +}; + +/** + * Set root `path`. + * + * @param {String} path + * @return {SendStream} + * @api public + */ + +SendStream.prototype.root = +SendStream.prototype.from = function(path){ + this._root = normalize(path); + return this; +}; + +/** + * Set max-age to `ms`. + * + * @param {Number} ms + * @return {SendStream} + * @api public + */ + +SendStream.prototype.maxage = function(ms){ + if (Infinity == ms) ms = 60 * 60 * 24 * 365 * 1000; + debug('max-age %d', ms); + this._maxage = ms; + return this; +}; + +/** + * Emit error with `status`. + * + * @param {Number} status + * @api private + */ + +SendStream.prototype.error = function(status, err){ + var res = this.res; + var msg = http.STATUS_CODES[status]; + err = err || new Error(msg); + err.status = status; + if (this.listeners('error').length) return this.emit('error', err); + res.statusCode = err.status; + res.end(msg); +}; + +/** + * Check if the pathname is potentially malicious. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isMalicious = function(){ + return !this._root && ~this.path.indexOf('..'); +}; + +/** + * Check if the pathname ends with "/". + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.hasTrailingSlash = function(){ + return '/' == this.path[this.path.length - 1]; +}; + +/** + * Check if the basename leads with ".". + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.hasLeadingDot = function(){ + return '.' == basename(this.path)[0]; +}; + +/** + * Check if this is a conditional GET request. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isConditionalGET = function(){ + return this.req.headers['if-none-match'] + || this.req.headers['if-modified-since']; +}; + +/** + * Strip content-* header fields. + * + * @api private + */ + +SendStream.prototype.removeContentHeaderFields = function(){ + var res = this.res; + Object.keys(res._headers).forEach(function(field){ + if (0 == field.indexOf('content')) { + res.removeHeader(field); + } + }); +}; + +/** + * Respond with 304 not modified. + * + * @api private + */ + +SendStream.prototype.notModified = function(){ + var res = this.res; + debug('not modified'); + this.removeContentHeaderFields(); + res.statusCode = 304; + res.end(); +}; + +/** + * Check if the request is cacheable, aka + * responded with 2xx or 304 (see RFC 2616 section 14.2{5,6}). + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isCachable = function(){ + var res = this.res; + return (res.statusCode >= 200 && res.statusCode < 300) || 304 == res.statusCode; +}; + +/** + * Handle stat() error. + * + * @param {Error} err + * @api private + */ + +SendStream.prototype.onStatError = function(err){ + var notfound = ['ENOENT', 'ENAMETOOLONG', 'ENOTDIR']; + if (~notfound.indexOf(err.code)) return this.error(404, err); + this.error(500, err); +}; + +/** + * Check if the cache is fresh. + * + * @return {Boolean} + * @api private + */ + +SendStream.prototype.isFresh = function(){ + return fresh(this.req.headers, this.res._headers); +}; + +/** + * Redirect to `path`. + * + * @param {String} path + * @api private + */ + +SendStream.prototype.redirect = function(path){ + if (this.listeners('directory').length) return this.emit('directory'); + var res = this.res; + path += '/'; + res.statusCode = 301; + res.setHeader('Location', path); + res.end('Redirecting to ' + utils.escape(path)); +}; + +/** + * Pipe to `res. + * + * @param {Stream} res + * @return {Stream} res + * @api public + */ + +SendStream.prototype.pipe = function(res){ + var self = this + , args = arguments + , path = this.path + , root = this._root; + + // references + this.res = res; + + // invalid request uri + path = utils.decode(path); + if (-1 == path) return this.error(400); + + // null byte(s) + if (~path.indexOf('\0')) return this.error(400); + + // join / normalize from optional root dir + if (root) path = normalize(join(this._root, path)); + + // ".." is malicious without "root" + if (this.isMalicious()) return this.error(403); + + // malicious path + if (root && 0 != path.indexOf(root)) return this.error(403); + + // hidden file support + if (!this._hidden && this.hasLeadingDot()) return this.error(404); + + // index file support + if (this._index && this.hasTrailingSlash()) path += this._index; + + debug('stat "%s"', path); + fs.stat(path, function(err, stat){ + if (err) return self.onStatError(err); + if (stat.isDirectory()) return self.redirect(self.path); + self.emit('file', path, stat); + self.send(path, stat); + }); + + return res; +}; + +/** + * Transfer `path`. + * + * @param {String} path + * @api public + */ + +SendStream.prototype.send = function(path, stat){ + var options = this.options; + var len = stat.size; + var res = this.res; + var req = this.req; + var ranges = req.headers.range; + var offset = options.start || 0; + + // set header fields + this.setHeader(stat); + + // set content-type + this.type(path); + + // conditional GET support + if (this.isConditionalGET() + && this.isCachable() + && this.isFresh()) { + return this.notModified(); + } + + // adjust len to start/end options + len = Math.max(0, len - offset); + if (options.end !== undefined) { + var bytes = options.end - offset + 1; + if (len > bytes) len = bytes; + } + + // Range support + if (ranges) { + ranges = parseRange(len, ranges); + + // unsatisfiable + if (-1 == ranges) { + res.setHeader('Content-Range', 'bytes */' + stat.size); + return this.error(416); + } + + // valid (syntactically invalid ranges are treated as a regular response) + if (-2 != ranges) { + options.start = offset + ranges[0].start; + options.end = offset + ranges[0].end; + + // Content-Range + res.statusCode = 206; + res.setHeader('Content-Range', 'bytes ' + + ranges[0].start + + '-' + + ranges[0].end + + '/' + + len); + len = options.end - options.start + 1; + } + } + + // content-length + res.setHeader('Content-Length', len); + + // HEAD support + if ('HEAD' == req.method) return res.end(); + + this.stream(path, options); +}; + +/** + * Stream `path` to the response. + * + * @param {String} path + * @param {Object} options + * @api private + */ + +SendStream.prototype.stream = function(path, options){ + // TODO: this is all lame, refactor meeee + var self = this; + var res = this.res; + var req = this.req; + + // pipe + var stream = fs.createReadStream(path, options); + this.emit('stream', stream); + stream.pipe(res); + + // socket closed, done with the fd + req.on('close', stream.destroy.bind(stream)); + + // error handling code-smell + stream.on('error', function(err){ + // no hope in responding + if (res._header) { + console.error(err.stack); + req.destroy(); + return; + } + + // 500 + err.status = 500; + self.emit('error', err); + }); + + // end + stream.on('end', function(){ + self.emit('end'); + }); +}; + +/** + * Set content-type based on `path` + * if it hasn't been explicitly set. + * + * @param {String} path + * @api private + */ + +SendStream.prototype.type = function(path){ + var res = this.res; + if (res.getHeader('Content-Type')) return; + var type = mime.lookup(path); + var charset = mime.charsets.lookup(type); + debug('content-type %s', type); + res.setHeader('Content-Type', type + (charset ? '; charset=' + charset : '')); +}; + +/** + * Set reaponse header fields, most + * fields may be pre-defined. + * + * @param {Object} stat + * @api private + */ + +SendStream.prototype.setHeader = function(stat){ + var res = this.res; + if (!res.getHeader('Accept-Ranges')) res.setHeader('Accept-Ranges', 'bytes'); + if (!res.getHeader('ETag')) res.setHeader('ETag', utils.etag(stat)); + if (!res.getHeader('Date')) res.setHeader('Date', new Date().toUTCString()); + if (!res.getHeader('Cache-Control')) res.setHeader('Cache-Control', 'public, max-age=' + (this._maxage / 1000)); + if (!res.getHeader('Last-Modified')) res.setHeader('Last-Modified', stat.mtime.toUTCString()); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/lib/utils.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/lib/utils.js new file mode 100644 index 00000000..950e5a2c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/lib/utils.js @@ -0,0 +1,47 @@ + +/** + * Return an ETag in the form of `"-"` + * from the given `stat`. + * + * @param {Object} stat + * @return {String} + * @api private + */ + +exports.etag = function(stat) { + return '"' + stat.size + '-' + Number(stat.mtime) + '"'; +}; + +/** + * decodeURIComponent. + * + * Allows V8 to only deoptimize this fn instead of all + * of send(). + * + * @param {String} path + * @api private + */ + +exports.decode = function(path){ + try { + return decodeURIComponent(path); + } catch (err) { + return -1; + } +}; + +/** + * Escape the given string of `html`. + * + * @param {String} html + * @return {String} + * @api private + */ + +exports.escape = function(html){ + return String(html) + .replace(/&(?!\w+;)/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); +}; \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/.jshintrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/.jshintrc new file mode 100644 index 00000000..299877f2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/.jshintrc @@ -0,0 +1,3 @@ +{ + "laxbreak": true +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/.npmignore new file mode 100644 index 00000000..7e6163db --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/.npmignore @@ -0,0 +1,6 @@ +support +test +examples +example +*.sock +dist diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/History.md new file mode 100644 index 00000000..854c9711 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/History.md @@ -0,0 +1,195 @@ + +2.2.0 / 2015-05-09 +================== + + * package: update "ms" to v0.7.1 (#202, @dougwilson) + * README: add logging to file example (#193, @DanielOchoa) + * README: fixed a typo (#191, @amir-s) + * browser: expose `storage` (#190, @stephenmathieson) + * Makefile: add a `distclean` target (#189, @stephenmathieson) + +2.1.3 / 2015-03-13 +================== + + * Updated stdout/stderr example (#186) + * Updated example/stdout.js to match debug current behaviour + * Renamed example/stderr.js to stdout.js + * Update Readme.md (#184) + * replace high intensity foreground color for bold (#182, #183) + +2.1.2 / 2015-03-01 +================== + + * dist: recompile + * update "ms" to v0.7.0 + * package: update "browserify" to v9.0.3 + * component: fix "ms.js" repo location + * changed bower package name + * updated documentation about using debug in a browser + * fix: security error on safari (#167, #168, @yields) + +2.1.1 / 2014-12-29 +================== + + * browser: use `typeof` to check for `console` existence + * browser: check for `console.log` truthiness (fix IE 8/9) + * browser: add support for Chrome apps + * Readme: added Windows usage remarks + * Add `bower.json` to properly support bower install + +2.1.0 / 2014-10-15 +================== + + * node: implement `DEBUG_FD` env variable support + * package: update "browserify" to v6.1.0 + * package: add "license" field to package.json (#135, @panuhorsmalahti) + +2.0.0 / 2014-09-01 +================== + + * package: update "browserify" to v5.11.0 + * node: use stderr rather than stdout for logging (#29, @stephenmathieson) + +1.0.4 / 2014-07-15 +================== + + * dist: recompile + * example: remove `console.info()` log usage + * example: add "Content-Type" UTF-8 header to browser example + * browser: place %c marker after the space character + * browser: reset the "content" color via `color: inherit` + * browser: add colors support for Firefox >= v31 + * debug: prefer an instance `log()` function over the global one (#119) + * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) + +1.0.3 / 2014-07-09 +================== + + * Add support for multiple wildcards in namespaces (#122, @seegno) + * browser: fix lint + +1.0.2 / 2014-06-10 +================== + + * browser: update color palette (#113, @gscottolson) + * common: make console logging function configurable (#108, @timoxley) + * node: fix %o colors on old node <= 0.8.x + * Makefile: find node path using shell/which (#109, @timoxley) + +1.0.1 / 2014-06-06 +================== + + * browser: use `removeItem()` to clear localStorage + * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) + * package: add "contributors" section + * node: fix comment typo + * README: list authors + +1.0.0 / 2014-06-04 +================== + + * make ms diff be global, not be scope + * debug: ignore empty strings in enable() + * node: make DEBUG_COLORS able to disable coloring + * *: export the `colors` array + * npmignore: don't publish the `dist` dir + * Makefile: refactor to use browserify + * package: add "browserify" as a dev dependency + * Readme: add Web Inspector Colors section + * node: reset terminal color for the debug content + * node: map "%o" to `util.inspect()` + * browser: map "%j" to `JSON.stringify()` + * debug: add custom "formatters" + * debug: use "ms" module for humanizing the diff + * Readme: add "bash" syntax highlighting + * browser: add Firebug color support + * browser: add colors for WebKit browsers + * node: apply log to `console` + * rewrite: abstract common logic for Node & browsers + * add .jshintrc file + +0.8.1 / 2014-04-14 +================== + + * package: re-add the "component" section + +0.8.0 / 2014-03-30 +================== + + * add `enable()` method for nodejs. Closes #27 + * change from stderr to stdout + * remove unnecessary index.js file + +0.7.4 / 2013-11-13 +================== + + * remove "browserify" key from package.json (fixes something in browserify) + +0.7.3 / 2013-10-30 +================== + + * fix: catch localStorage security error when cookies are blocked (Chrome) + * add debug(err) support. Closes #46 + * add .browser prop to package.json. Closes #42 + +0.7.2 / 2013-02-06 +================== + + * fix package.json + * fix: Mobile Safari (private mode) is broken with debug + * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript + +0.7.1 / 2013-02-05 +================== + + * add repository URL to package.json + * add DEBUG_COLORED to force colored output + * add browserify support + * fix component. Closes #24 + +0.7.0 / 2012-05-04 +================== + + * Added .component to package.json + * Added debug.component.js build + +0.6.0 / 2012-03-16 +================== + + * Added support for "-" prefix in DEBUG [Vinay Pulim] + * Added `.enabled` flag to the node version [TooTallNate] + +0.5.0 / 2012-02-02 +================== + + * Added: humanize diffs. Closes #8 + * Added `debug.disable()` to the CS variant + * Removed padding. Closes #10 + * Fixed: persist client-side variant again. Closes #9 + +0.4.0 / 2012-02-01 +================== + + * Added browser variant support for older browsers [TooTallNate] + * Added `debug.enable('project:*')` to browser variant [TooTallNate] + * Added padding to diff (moved it to the right) + +0.3.0 / 2012-01-26 +================== + + * Added millisecond diff when isatty, otherwise UTC string + +0.2.0 / 2012-01-22 +================== + + * Added wildcard support + +0.1.0 / 2011-12-02 +================== + + * Added: remove colors unless stderr isatty [TooTallNate] + +0.0.1 / 2010-01-03 +================== + + * Initial release diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/Makefile new file mode 100644 index 00000000..5cf4a596 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/Makefile @@ -0,0 +1,36 @@ + +# get Makefile directory name: http://stackoverflow.com/a/5982798/376773 +THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)) +THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd) + +# BIN directory +BIN := $(THIS_DIR)/node_modules/.bin + +# applications +NODE ?= $(shell which node) +NPM ?= $(NODE) $(shell which npm) +BROWSERIFY ?= $(NODE) $(BIN)/browserify + +all: dist/debug.js + +install: node_modules + +clean: + @rm -rf dist + +dist: + @mkdir -p $@ + +dist/debug.js: node_modules browser.js debug.js dist + @$(BROWSERIFY) \ + --standalone debug \ + . > $@ + +distclean: clean + @rm -rf node_modules + +node_modules: package.json + @NODE_ENV= $(NPM) install + @touch node_modules + +.PHONY: all install clean distclean diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/Readme.md new file mode 100644 index 00000000..b4f45e3c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/Readme.md @@ -0,0 +1,188 @@ +# debug + + tiny node.js debugging utility modelled after node core's debugging technique. + +## Installation + +```bash +$ npm install debug +``` + +## Usage + + With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility. + +Example _app.js_: + +```js +var debug = require('debug')('http') + , http = require('http') + , name = 'My App'; + +// fake app + +debug('booting %s', name); + +http.createServer(function(req, res){ + debug(req.method + ' ' + req.url); + res.end('hello\n'); +}).listen(3000, function(){ + debug('listening'); +}); + +// fake worker of some kind + +require('./worker'); +``` + +Example _worker.js_: + +```js +var debug = require('debug')('worker'); + +setInterval(function(){ + debug('doing some work'); +}, 1000); +``` + + The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples: + + ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png) + + ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png) + +#### Windows note + + On Windows the environment variable is set using the `set` command. + + ```cmd + set DEBUG=*,-not_this + ``` + +Then, run the program to be debugged as usual. + +## Millisecond diff + + When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls. + + ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png) + + When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below: + + ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png) + +## Conventions + + If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". + +## Wildcards + + The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`. + + You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:". + +## Browser support + + Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include: + +```js +window.myDebug = require("debug"); +``` + + ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console: + +```js +myDebug.enable("worker:*") +``` + + Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console. + +```js +a = debug('worker:a'); +b = debug('worker:b'); + +setInterval(function(){ + a('doing some work'); +}, 1000); + +setInterval(function(){ + b('doing some work'); +}, 1200); +``` + +#### Web Inspector Colors + + Colors are also enabled on "Web Inspectors" that understand the `%c` formatting + option. These are WebKit web inspectors, Firefox ([since version + 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/)) + and the Firebug plugin for Firefox (any version). + + Colored output looks something like: + + ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png) + +### stderr vs stdout + +You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally: + +Example _stdout.js_: + +```js +var debug = require('debug'); +var error = debug('app:error'); + +// by default stderr is used +error('goes to stderr!'); + +var log = debug('app:log'); +// set this namespace to log via console.log +log.log = console.log.bind(console); // don't forget to bind to console! +log('goes to stdout'); +error('still goes to stderr!'); + +// set all output to go via console.info +// overrides all per-namespace log settings +debug.log = console.info.bind(console); +error('now goes to stdout via console.info'); +log('still goes to stdout, but via console.info now'); +``` + +### Save debug output to a file + +You can save all debug statements to a file by piping them. + +Example: + +```bash +$ DEBUG_FD=3 node your-app.js 3> whatever.log +``` + +## Authors + + - TJ Holowaychuk + - Nathan Rajlich + +## License + +(The MIT License) + +Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/bower.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/bower.json new file mode 100644 index 00000000..6af573ff --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/bower.json @@ -0,0 +1,28 @@ +{ + "name": "visionmedia-debug", + "main": "dist/debug.js", + "version": "2.2.0", + "homepage": "https://github.com/visionmedia/debug", + "authors": [ + "TJ Holowaychuk " + ], + "description": "visionmedia-debug", + "moduleType": [ + "amd", + "es6", + "globals", + "node" + ], + "keywords": [ + "visionmedia", + "debug" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/browser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/browser.js new file mode 100644 index 00000000..7c764522 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/browser.js @@ -0,0 +1,168 @@ + +/** + * This is the web browser implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = 'undefined' != typeof chrome + && 'undefined' != typeof chrome.storage + ? chrome.storage.local + : localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + 'lightseagreen', + 'forestgreen', + 'goldenrod', + 'dodgerblue', + 'darkorchid', + 'crimson' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +function useColors() { + // is webkit? http://stackoverflow.com/a/16459606/376773 + return ('WebkitAppearance' in document.documentElement.style) || + // is firebug? http://stackoverflow.com/a/398120/376773 + (window.console && (console.firebug || (console.exception && console.table))) || + // is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31); +} + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +exports.formatters.j = function(v) { + return JSON.stringify(v); +}; + + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + + args[0] = (useColors ? '%c' : '') + + this.namespace + + (useColors ? ' %c' : ' ') + + args[0] + + (useColors ? '%c ' : ' ') + + '+' + exports.humanize(this.diff); + + if (!useColors) return args; + + var c = 'color: ' + this.color; + args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); + + // the final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + var index = 0; + var lastC = 0; + args[0].replace(/%[a-z%]/g, function(match) { + if ('%%' === match) return; + index++; + if ('%c' === match) { + // we only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); + return args; +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ + +function log() { + // this hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return 'object' === typeof console + && console.log + && Function.prototype.apply.call(console.log, console, arguments); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + try { + if (null == namespaces) { + exports.storage.removeItem('debug'); + } else { + exports.storage.debug = namespaces; + } + } catch(e) {} +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + var r; + try { + r = exports.storage.debug; + } catch(e) {} + return r; +} + +/** + * Enable namespaces listed in `localStorage.debug` initially. + */ + +exports.enable(load()); + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage(){ + try { + return window.localStorage; + } catch (e) {} +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/component.json new file mode 100644 index 00000000..ca106372 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/component.json @@ -0,0 +1,19 @@ +{ + "name": "debug", + "repo": "visionmedia/debug", + "description": "small debugging utility", + "version": "2.2.0", + "keywords": [ + "debug", + "log", + "debugger" + ], + "main": "browser.js", + "scripts": [ + "browser.js", + "debug.js" + ], + "dependencies": { + "rauchg/ms.js": "0.7.1" + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/debug.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/debug.js new file mode 100644 index 00000000..7571a860 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/debug.js @@ -0,0 +1,197 @@ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = debug; +exports.coerce = coerce; +exports.disable = disable; +exports.enable = enable; +exports.enabled = enabled; +exports.humanize = require('ms'); + +/** + * The currently active debug mode names, and names to skip. + */ + +exports.names = []; +exports.skips = []; + +/** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lowercased letter, i.e. "n". + */ + +exports.formatters = {}; + +/** + * Previously assigned color. + */ + +var prevColor = 0; + +/** + * Previous log timestamp. + */ + +var prevTime; + +/** + * Select a color. + * + * @return {Number} + * @api private + */ + +function selectColor() { + return exports.colors[prevColor++ % exports.colors.length]; +} + +/** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + +function debug(namespace) { + + // define the `disabled` version + function disabled() { + } + disabled.enabled = false; + + // define the `enabled` version + function enabled() { + + var self = enabled; + + // set `diff` timestamp + var curr = +new Date(); + var ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + // add the `color` if not set + if (null == self.useColors) self.useColors = exports.useColors(); + if (null == self.color && self.useColors) self.color = selectColor(); + + var args = Array.prototype.slice.call(arguments); + + args[0] = exports.coerce(args[0]); + + if ('string' !== typeof args[0]) { + // anything else let's inspect with %o + args = ['%o'].concat(args); + } + + // apply any `formatters` transformations + var index = 0; + args[0] = args[0].replace(/%([a-z%])/g, function(match, format) { + // if we encounter an escaped % then don't increase the array index + if (match === '%%') return match; + index++; + var formatter = exports.formatters[format]; + if ('function' === typeof formatter) { + var val = args[index]; + match = formatter.call(self, val); + + // now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + if ('function' === typeof exports.formatArgs) { + args = exports.formatArgs.apply(self, args); + } + var logFn = enabled.log || exports.log || console.log.bind(console); + logFn.apply(self, args); + } + enabled.enabled = true; + + var fn = exports.enabled(namespace) ? enabled : disabled; + + fn.namespace = namespace; + + return fn; +} + +/** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + +function enable(namespaces) { + exports.save(namespaces); + + var split = (namespaces || '').split(/[\s,]+/); + var len = split.length; + + for (var i = 0; i < len; i++) { + if (!split[i]) continue; // ignore empty strings + namespaces = split[i].replace(/\*/g, '.*?'); + if (namespaces[0] === '-') { + exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + exports.names.push(new RegExp('^' + namespaces + '$')); + } + } +} + +/** + * Disable debug output. + * + * @api public + */ + +function disable() { + exports.enable(''); +} + +/** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + +function enabled(name) { + var i, len; + for (i = 0, len = exports.skips.length; i < len; i++) { + if (exports.skips[i].test(name)) { + return false; + } + } + for (i = 0, len = exports.names.length; i < len; i++) { + if (exports.names[i].test(name)) { + return true; + } + } + return false; +} + +/** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + +function coerce(val) { + if (val instanceof Error) return val.stack || val.message; + return val; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node.js new file mode 100644 index 00000000..1d392a81 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node.js @@ -0,0 +1,209 @@ + +/** + * Module dependencies. + */ + +var tty = require('tty'); +var util = require('util'); + +/** + * This is the Node.js implementation of `debug()`. + * + * Expose `debug()` as the module. + */ + +exports = module.exports = require('./debug'); +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +/** + * The file descriptor to write the `debug()` calls to. + * Set the `DEBUG_FD` env variable to override with another value. i.e.: + * + * $ DEBUG_FD=3 node script.js 3>debug.log + */ + +var fd = parseInt(process.env.DEBUG_FD, 10) || 2; +var stream = 1 === fd ? process.stdout : + 2 === fd ? process.stderr : + createWritableStdioStream(fd); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase(); + if (0 === debugColors.length) { + return tty.isatty(fd); + } else { + return '0' !== debugColors + && 'no' !== debugColors + && 'false' !== debugColors + && 'disabled' !== debugColors; + } +} + +/** + * Map %o to `util.inspect()`, since Node doesn't do that out of the box. + */ + +var inspect = (4 === util.inspect.length ? + // node <= 0.8.x + function (v, colors) { + return util.inspect(v, void 0, void 0, colors); + } : + // node > 0.8.x + function (v, colors) { + return util.inspect(v, { colors: colors }); + } +); + +exports.formatters.o = function(v) { + return inspect(v, this.useColors) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs() { + var args = arguments; + var useColors = this.useColors; + var name = this.namespace; + + if (useColors) { + var c = this.color; + + args[0] = ' \u001b[3' + c + ';1m' + name + ' ' + + '\u001b[0m' + + args[0] + '\u001b[3' + c + 'm' + + ' +' + exports.humanize(this.diff) + '\u001b[0m'; + } else { + args[0] = new Date().toUTCString() + + ' ' + name + ' ' + args[0]; + } + return args; +} + +/** + * Invokes `console.error()` with the specified arguments. + */ + +function log() { + return stream.write(util.format.apply(this, arguments) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ + +function save(namespaces) { + if (null == namespaces) { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } else { + process.env.DEBUG = namespaces; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Copied from `node/src/node.js`. + * + * XXX: It's lame that node doesn't expose this API out-of-the-box. It also + * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame. + */ + +function createWritableStdioStream (fd) { + var stream; + var tty_wrap = process.binding('tty_wrap'); + + // Note stream._type is used for test-module-load-list.js + + switch (tty_wrap.guessHandleType(fd)) { + case 'TTY': + stream = new tty.WriteStream(fd); + stream._type = 'tty'; + + // Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + case 'FILE': + var fs = require('fs'); + stream = new fs.SyncWriteStream(fd, { autoClose: false }); + stream._type = 'fs'; + break; + + case 'PIPE': + case 'TCP': + var net = require('net'); + stream = new net.Socket({ + fd: fd, + readable: false, + writable: true + }); + + // FIXME Should probably have an option in net.Socket to create a + // stream from an existing fd which is writable only. But for now + // we'll just add this hack and set the `readable` member to false. + // Test: ./node test/fixtures/echo.js < /etc/passwd + stream.readable = false; + stream.read = null; + stream._type = 'pipe'; + + // FIXME Hack to have stream not keep the event loop alive. + // See https://github.com/joyent/node/issues/1726 + if (stream._handle && stream._handle.unref) { + stream._handle.unref(); + } + break; + + default: + // Probably an error on in uv_guess_handle() + throw new Error('Implement me. Unknown stream file type!'); + } + + // For supporting legacy API we put the FD here. + stream.fd = fd; + + stream._isStdio = true; + + return stream; +} + +/** + * Enable namespaces listed in `process.env.DEBUG` initially. + */ + +exports.enable(load()); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/.npmignore new file mode 100644 index 00000000..d1aa0ce4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/.npmignore @@ -0,0 +1,5 @@ +node_modules +test +History.md +Makefile +component.json diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/History.md new file mode 100644 index 00000000..32fdfc17 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/History.md @@ -0,0 +1,66 @@ + +0.7.1 / 2015-04-20 +================== + + * prevent extraordinary long inputs (@evilpacket) + * Fixed broken readme link + +0.7.0 / 2014-11-24 +================== + + * add time abbreviations, updated tests and readme for the new units + * fix example in the readme. + * add LICENSE file + +0.6.2 / 2013-12-05 +================== + + * Adding repository section to package.json to suppress warning from NPM. + +0.6.1 / 2013-05-10 +================== + + * fix singularization [visionmedia] + +0.6.0 / 2013-03-15 +================== + + * fix minutes + +0.5.1 / 2013-02-24 +================== + + * add component namespace + +0.5.0 / 2012-11-09 +================== + + * add short formatting as default and .long option + * add .license property to component.json + * add version to component.json + +0.4.0 / 2012-10-22 +================== + + * add rounding to fix crazy decimals + +0.3.0 / 2012-09-07 +================== + + * fix `ms()` [visionmedia] + +0.2.0 / 2012-09-03 +================== + + * add component.json [visionmedia] + * add days support [visionmedia] + * add hours support [visionmedia] + * add minutes support [visionmedia] + * add seconds support [visionmedia] + * add ms string support [visionmedia] + * refactor tests to facilitate ms(number) [visionmedia] + +0.1.0 / 2012-03-07 +================== + + * Initial release diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/LICENSE new file mode 100644 index 00000000..6c07561b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2014 Guillermo Rauch + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/README.md new file mode 100644 index 00000000..9b4fd035 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/README.md @@ -0,0 +1,35 @@ +# ms.js: miliseconds conversion utility + +```js +ms('2 days') // 172800000 +ms('1d') // 86400000 +ms('10h') // 36000000 +ms('2.5 hrs') // 9000000 +ms('2h') // 7200000 +ms('1m') // 60000 +ms('5s') // 5000 +ms('100') // 100 +``` + +```js +ms(60000) // "1m" +ms(2 * 60000) // "2m" +ms(ms('10 hours')) // "10h" +``` + +```js +ms(60000, { long: true }) // "1 minute" +ms(2 * 60000, { long: true }) // "2 minutes" +ms(ms('10 hours'), { long: true }) // "10 hours" +``` + +- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download). +- If a number is supplied to `ms`, a string with a unit is returned. +- If a string that contains the number is supplied, it returns it as +a number (e.g: it returns `100` for `'100'`). +- If you pass a string with a number and a valid unit, the number of +equivalent ms is returned. + +## License + +MIT diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/index.js new file mode 100644 index 00000000..4f927716 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/index.js @@ -0,0 +1,125 @@ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} options + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options){ + options = options || {}; + if ('string' == typeof val) return parse(val); + return options.long + ? long(val) + : short(val); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = '' + str; + if (str.length > 10000) return; + var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str); + if (!match) return; + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function short(ms) { + if (ms >= d) return Math.round(ms / d) + 'd'; + if (ms >= h) return Math.round(ms / h) + 'h'; + if (ms >= m) return Math.round(ms / m) + 'm'; + if (ms >= s) return Math.round(ms / s) + 's'; + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function long(ms) { + return plural(ms, d, 'day') + || plural(ms, h, 'hour') + || plural(ms, m, 'minute') + || plural(ms, s, 'second') + || ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, n, name) { + if (ms < n) return; + if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name; + return Math.ceil(ms / n) + ' ' + name + 's'; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/package.json new file mode 100644 index 00000000..253335e6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/node_modules/ms/package.json @@ -0,0 +1,48 @@ +{ + "name": "ms", + "version": "0.7.1", + "description": "Tiny ms conversion utility", + "repository": { + "type": "git", + "url": "git://github.com/guille/ms.js.git" + }, + "main": "./index", + "devDependencies": { + "mocha": "*", + "expect.js": "*", + "serve": "*" + }, + "component": { + "scripts": { + "ms/index.js": "index.js" + } + }, + "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", + "bugs": { + "url": "https://github.com/guille/ms.js/issues" + }, + "homepage": "https://github.com/guille/ms.js", + "_id": "ms@0.7.1", + "scripts": {}, + "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "_from": "ms@0.7.1", + "_npmVersion": "2.7.5", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + "maintainers": [ + { + "name": "rauchg", + "email": "rauchg@gmail.com" + } + ], + "dist": { + "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", + "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/package.json new file mode 100644 index 00000000..7e6d9fc5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/debug/package.json @@ -0,0 +1,73 @@ +{ + "name": "debug", + "version": "2.2.0", + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/debug.git" + }, + "description": "small debugging utility", + "keywords": [ + "debug", + "log", + "debugger" + ], + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "contributors": [ + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "http://n8.io" + } + ], + "license": "MIT", + "dependencies": { + "ms": "0.7.1" + }, + "devDependencies": { + "browserify": "9.0.3", + "mocha": "*" + }, + "main": "./node.js", + "browser": "./browser.js", + "component": { + "scripts": { + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" + } + }, + "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", + "bugs": { + "url": "https://github.com/visionmedia/debug/issues" + }, + "homepage": "https://github.com/visionmedia/debug", + "_id": "debug@2.2.0", + "scripts": {}, + "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "_from": "debug@*", + "_npmVersion": "2.7.4", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", + "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/.npmignore new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/.npmignore @@ -0,0 +1 @@ +test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/History.md new file mode 100644 index 00000000..60a2903f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/History.md @@ -0,0 +1,5 @@ + +0.2.0 / 2013-08-11 +================== + + * fix: return false for no-cache diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/Makefile new file mode 100644 index 00000000..8e8640f2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/Makefile @@ -0,0 +1,7 @@ + +test: + @./node_modules/.bin/mocha \ + --reporter spec \ + --require should + +.PHONY: test \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/Readme.md new file mode 100644 index 00000000..61366c57 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/Readme.md @@ -0,0 +1,57 @@ + +# node-fresh + + HTTP response freshness testing + +## fresh(req, res) + + Check freshness of `req` and `res` headers. + + When the cache is "fresh" __true__ is returned, + otherwise __false__ is returned to indicate that + the cache is now stale. + +## Example: + +```js +var req = { 'if-none-match': 'tobi' }; +var res = { 'etag': 'luna' }; +fresh(req, res); +// => false + +var req = { 'if-none-match': 'tobi' }; +var res = { 'etag': 'tobi' }; +fresh(req, res); +// => true +``` + +## Installation + +``` +$ npm install fresh +``` + +## License + +(The MIT License) + +Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> + +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. \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/index.js new file mode 100644 index 00000000..9c3f47d1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/index.js @@ -0,0 +1,53 @@ + +/** + * Expose `fresh()`. + */ + +module.exports = fresh; + +/** + * Check freshness of `req` and `res` headers. + * + * When the cache is "fresh" __true__ is returned, + * otherwise __false__ is returned to indicate that + * the cache is now stale. + * + * @param {Object} req + * @param {Object} res + * @return {Boolean} + * @api public + */ + +function fresh(req, res) { + // defaults + var etagMatches = true; + var notModified = true; + + // fields + var modifiedSince = req['if-modified-since']; + var noneMatch = req['if-none-match']; + var lastModified = res['last-modified']; + var etag = res['etag']; + var cc = req['cache-control']; + + // unconditional request + if (!modifiedSince && !noneMatch) return false; + + // check for no-cache cache request directive + if (cc && cc.indexOf('no-cache') !== -1) return false; + + // parse if-none-match + if (noneMatch) noneMatch = noneMatch.split(/ *, */); + + // if-none-match + if (noneMatch) etagMatches = ~noneMatch.indexOf(etag) || '*' == noneMatch[0]; + + // if-modified-since + if (modifiedSince) { + modifiedSince = new Date(modifiedSince); + lastModified = new Date(lastModified); + notModified = lastModified <= modifiedSince; + } + + return !! (etagMatches && notModified); +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/package.json new file mode 100644 index 00000000..0fcb7e65 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/fresh/package.json @@ -0,0 +1,45 @@ +{ + "name": "fresh", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca", + "url": "http://tjholowaychuk.com" + }, + "description": "HTTP response freshness testing", + "version": "0.2.0", + "main": "index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-fresh.git" + }, + "dependencies": {}, + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "bugs": { + "url": "https://github.com/visionmedia/node-fresh/issues" + }, + "_id": "fresh@0.2.0", + "dist": { + "shasum": "bfd9402cf3df12c4a4c310c79f99a3dde13d34a7", + "tarball": "http://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz" + }, + "_from": "fresh@0.2.0", + "_npmVersion": "1.3.4", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "directories": {}, + "_shasum": "bfd9402cf3df12c4a4c310c79f99a3dde13d34a7", + "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/visionmedia/node-fresh#readme" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/LICENSE new file mode 100644 index 00000000..451fc455 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010 Benjamin Thomas, Robert Kieffer + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/README.md new file mode 100644 index 00000000..6ca19bd1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/README.md @@ -0,0 +1,66 @@ +# mime + +Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. + +## Install + +Install with [npm](http://github.com/isaacs/npm): + + npm install mime + +## API - Queries + +### mime.lookup(path) +Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.'). E.g. + + var mime = require('mime'); + + mime.lookup('/path/to/file.txt'); // => 'text/plain' + mime.lookup('file.txt'); // => 'text/plain' + mime.lookup('.TXT'); // => 'text/plain' + mime.lookup('htm'); // => 'text/html' + +### mime.default_type +Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.) + +### mime.extension(type) +Get the default extension for `type` + + mime.extension('text/html'); // => 'html' + mime.extension('application/octet-stream'); // => 'bin' + +### mime.charsets.lookup() + +Map mime-type to charset + + mime.charsets.lookup('text/plain'); // => 'UTF-8' + +(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.) + +## API - Defining Custom Types + +The following APIs allow you to add your own type mappings within your project. If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types). + +### mime.define() + +Add custom mime/extension mappings + + mime.define({ + 'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'], + 'application/x-my-type': ['x-mt', 'x-mtt'], + // etc ... + }); + + mime.lookup('x-sft'); // => 'text/x-some-format' + +The first entry in the extensions array is returned by `mime.extension()`. E.g. + + mime.extension('text/x-some-format'); // => 'x-sf' + +### mime.load(filepath) + +Load mappings from an Apache ".types" format file + + mime.load('./my_project.types'); + +The .types file format is simple - See the `types` dir for examples. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/mime.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/mime.js new file mode 100644 index 00000000..48be0c5e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/mime.js @@ -0,0 +1,114 @@ +var path = require('path'); +var fs = require('fs'); + +function Mime() { + // Map of extension -> mime type + this.types = Object.create(null); + + // Map of mime type -> extension + this.extensions = Object.create(null); +} + +/** + * Define mimetype -> extension mappings. Each key is a mime-type that maps + * to an array of extensions associated with the type. The first extension is + * used as the default extension for the type. + * + * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); + * + * @param map (Object) type definitions + */ +Mime.prototype.define = function (map) { + for (var type in map) { + var exts = map[type]; + + for (var i = 0; i < exts.length; i++) { + if (process.env.DEBUG_MIME && this.types[exts]) { + console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' + + this.types[exts] + ' to ' + type); + } + + this.types[exts[i]] = type; + } + + // Default extension is the first one we encounter + if (!this.extensions[type]) { + this.extensions[type] = exts[0]; + } + } +}; + +/** + * Load an Apache2-style ".types" file + * + * This may be called multiple times (it's expected). Where files declare + * overlapping types/extensions, the last file wins. + * + * @param file (String) path of file to load. + */ +Mime.prototype.load = function(file) { + + this._loading = file; + // Read file and split into lines + var map = {}, + content = fs.readFileSync(file, 'ascii'), + lines = content.split(/[\r\n]+/); + + lines.forEach(function(line) { + // Clean up whitespace/comments, and split into fields + var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/); + map[fields.shift()] = fields; + }); + + this.define(map); + + this._loading = null; +}; + +/** + * Lookup a mime type based on extension + */ +Mime.prototype.lookup = function(path, fallback) { + var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase(); + + return this.types[ext] || fallback || this.default_type; +}; + +/** + * Return file extension associated with a mime type + */ +Mime.prototype.extension = function(mimeType) { + var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); + return this.extensions[type]; +}; + +// Default instance +var mime = new Mime(); + +// Load local copy of +// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +mime.load(path.join(__dirname, 'types/mime.types')); + +// Load additional types from node.js community +mime.load(path.join(__dirname, 'types/node.types')); + +// Default type +mime.default_type = mime.lookup('bin'); + +// +// Additional API specific to the default instance +// + +mime.Mime = Mime; + +/** + * Lookup a charset based on mime type. + */ +mime.charsets = { + lookup: function(mimeType, fallback) { + // Assume text types are utf8 + return (/^text\//).test(mimeType) ? 'UTF-8' : fallback; + } +}; + +module.exports = mime; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/package.json new file mode 100644 index 00000000..328900db --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/package.json @@ -0,0 +1,57 @@ +{ + "author": { + "name": "Robert Kieffer", + "email": "robert@broofa.com", + "url": "http://github.com/broofa" + }, + "contributors": [ + { + "name": "Benjamin Thomas", + "email": "benjamin@benjaminthomas.org", + "url": "http://github.com/bentomas" + } + ], + "dependencies": {}, + "description": "A comprehensive library for mime-type mapping", + "devDependencies": {}, + "keywords": [ + "util", + "mime" + ], + "main": "mime.js", + "name": "mime", + "repository": { + "url": "git+https://github.com/broofa/node-mime.git", + "type": "git" + }, + "version": "1.2.11", + "bugs": { + "url": "https://github.com/broofa/node-mime/issues" + }, + "_id": "mime@1.2.11", + "dist": { + "shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", + "tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz" + }, + "_from": "mime@>=1.2.9 <1.3.0", + "_npmVersion": "1.3.6", + "_npmUser": { + "name": "broofa", + "email": "robert@broofa.com" + }, + "maintainers": [ + { + "name": "broofa", + "email": "robert@broofa.com" + }, + { + "name": "bentomas", + "email": "benjamin@benjaminthomas.org" + } + ], + "directories": {}, + "_shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", + "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/broofa/node-mime#readme" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/test.js new file mode 100644 index 00000000..2cda1c7a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/test.js @@ -0,0 +1,84 @@ +/** + * Usage: node test.js + */ + +var mime = require('./mime'); +var assert = require('assert'); +var path = require('path'); + +function eq(a, b) { + console.log('Test: ' + a + ' === ' + b); + assert.strictEqual.apply(null, arguments); +} + +console.log(Object.keys(mime.extensions).length + ' types'); +console.log(Object.keys(mime.types).length + ' extensions\n'); + +// +// Test mime lookups +// + +eq('text/plain', mime.lookup('text.txt')); // normal file +eq('text/plain', mime.lookup('TEXT.TXT')); // uppercase +eq('text/plain', mime.lookup('dir/text.txt')); // dir + file +eq('text/plain', mime.lookup('.text.txt')); // hidden file +eq('text/plain', mime.lookup('.txt')); // nameless +eq('text/plain', mime.lookup('txt')); // extension-only +eq('text/plain', mime.lookup('/txt')); // extension-less () +eq('text/plain', mime.lookup('\\txt')); // Windows, extension-less +eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized +eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default + +// +// Test extensions +// + +eq('txt', mime.extension(mime.types.text)); +eq('html', mime.extension(mime.types.htm)); +eq('bin', mime.extension('application/octet-stream')); +eq('bin', mime.extension('application/octet-stream ')); +eq('html', mime.extension(' text/html; charset=UTF-8')); +eq('html', mime.extension('text/html; charset=UTF-8 ')); +eq('html', mime.extension('text/html; charset=UTF-8')); +eq('html', mime.extension('text/html ; charset=UTF-8')); +eq('html', mime.extension('text/html;charset=UTF-8')); +eq('html', mime.extension('text/Html;charset=UTF-8')); +eq(undefined, mime.extension('unrecognized')); + +// +// Test node.types lookups +// + +eq('application/font-woff', mime.lookup('file.woff')); +eq('application/octet-stream', mime.lookup('file.buffer')); +eq('audio/mp4', mime.lookup('file.m4a')); +eq('font/opentype', mime.lookup('file.otf')); + +// +// Test charsets +// + +eq('UTF-8', mime.charsets.lookup('text/plain')); +eq(undefined, mime.charsets.lookup(mime.types.js)); +eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback')); + +// +// Test for overlaps between mime.types and node.types +// + +var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime(); +apacheTypes.load(path.join(__dirname, 'types/mime.types')); +nodeTypes.load(path.join(__dirname, 'types/node.types')); + +var keys = [].concat(Object.keys(apacheTypes.types)) + .concat(Object.keys(nodeTypes.types)); +keys.sort(); +for (var i = 1; i < keys.length; i++) { + if (keys[i] == keys[i-1]) { + console.warn('Warning: ' + + 'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] + + ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]); + } +} + +console.log('\nOK'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/types/mime.types b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/types/mime.types new file mode 100644 index 00000000..da8cd691 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/types/mime.types @@ -0,0 +1,1588 @@ +# This file maps Internet media types to unique file extension(s). +# Although created for httpd, this file is used by many software systems +# and has been placed in the public domain for unlimited redisribution. +# +# The table below contains both registered and (common) unregistered types. +# A type that has no unique extension can be ignored -- they are listed +# here to guide configurations toward known types and to make it easier to +# identify "new" types. File extensions are also commonly used to indicate +# content languages and encodings, so choose them carefully. +# +# Internet media types should be registered as described in RFC 4288. +# The registry is at . +# +# MIME type (lowercased) Extensions +# ============================================ ========== +# application/1d-interleaved-parityfec +# application/3gpp-ims+xml +# application/activemessage +application/andrew-inset ez +# application/applefile +application/applixware aw +application/atom+xml atom +application/atomcat+xml atomcat +# application/atomicmail +application/atomsvc+xml atomsvc +# application/auth-policy+xml +# application/batch-smtp +# application/beep+xml +# application/calendar+xml +# application/cals-1840 +# application/ccmp+xml +application/ccxml+xml ccxml +application/cdmi-capability cdmia +application/cdmi-container cdmic +application/cdmi-domain cdmid +application/cdmi-object cdmio +application/cdmi-queue cdmiq +# application/cea-2018+xml +# application/cellml+xml +# application/cfw +# application/cnrp+xml +# application/commonground +# application/conference-info+xml +# application/cpl+xml +# application/csta+xml +# application/cstadata+xml +application/cu-seeme cu +# application/cybercash +application/davmount+xml davmount +# application/dca-rft +# application/dec-dx +# application/dialog-info+xml +# application/dicom +# application/dns +application/docbook+xml dbk +# application/dskpp+xml +application/dssc+der dssc +application/dssc+xml xdssc +# application/dvcs +application/ecmascript ecma +# application/edi-consent +# application/edi-x12 +# application/edifact +application/emma+xml emma +# application/epp+xml +application/epub+zip epub +# application/eshop +# application/example +application/exi exi +# application/fastinfoset +# application/fastsoap +# application/fits +application/font-tdpfr pfr +# application/framework-attributes+xml +application/gml+xml gml +application/gpx+xml gpx +application/gxf gxf +# application/h224 +# application/held+xml +# application/http +application/hyperstudio stk +# application/ibe-key-request+xml +# application/ibe-pkg-reply+xml +# application/ibe-pp-data +# application/iges +# application/im-iscomposing+xml +# application/index +# application/index.cmd +# application/index.obj +# application/index.response +# application/index.vnd +application/inkml+xml ink inkml +# application/iotp +application/ipfix ipfix +# application/ipp +# application/isup +application/java-archive jar +application/java-serialized-object ser +application/java-vm class +application/javascript js +application/json json +application/jsonml+json jsonml +# application/kpml-request+xml +# application/kpml-response+xml +application/lost+xml lostxml +application/mac-binhex40 hqx +application/mac-compactpro cpt +# application/macwriteii +application/mads+xml mads +application/marc mrc +application/marcxml+xml mrcx +application/mathematica ma nb mb +# application/mathml-content+xml +# application/mathml-presentation+xml +application/mathml+xml mathml +# application/mbms-associated-procedure-description+xml +# application/mbms-deregister+xml +# application/mbms-envelope+xml +# application/mbms-msk+xml +# application/mbms-msk-response+xml +# application/mbms-protection-description+xml +# application/mbms-reception-report+xml +# application/mbms-register+xml +# application/mbms-register-response+xml +# application/mbms-user-service-description+xml +application/mbox mbox +# application/media_control+xml +application/mediaservercontrol+xml mscml +application/metalink+xml metalink +application/metalink4+xml meta4 +application/mets+xml mets +# application/mikey +application/mods+xml mods +# application/moss-keys +# application/moss-signature +# application/mosskey-data +# application/mosskey-request +application/mp21 m21 mp21 +application/mp4 mp4s +# application/mpeg4-generic +# application/mpeg4-iod +# application/mpeg4-iod-xmt +# application/msc-ivr+xml +# application/msc-mixer+xml +application/msword doc dot +application/mxf mxf +# application/nasdata +# application/news-checkgroups +# application/news-groupinfo +# application/news-transmission +# application/nss +# application/ocsp-request +# application/ocsp-response +application/octet-stream bin dms lrf mar so dist distz pkg bpk dump elc deploy +application/oda oda +application/oebps-package+xml opf +application/ogg ogx +application/omdoc+xml omdoc +application/onenote onetoc onetoc2 onetmp onepkg +application/oxps oxps +# application/parityfec +application/patch-ops-error+xml xer +application/pdf pdf +application/pgp-encrypted pgp +# application/pgp-keys +application/pgp-signature asc sig +application/pics-rules prf +# application/pidf+xml +# application/pidf-diff+xml +application/pkcs10 p10 +application/pkcs7-mime p7m p7c +application/pkcs7-signature p7s +application/pkcs8 p8 +application/pkix-attr-cert ac +application/pkix-cert cer +application/pkix-crl crl +application/pkix-pkipath pkipath +application/pkixcmp pki +application/pls+xml pls +# application/poc-settings+xml +application/postscript ai eps ps +# application/prs.alvestrand.titrax-sheet +application/prs.cww cww +# application/prs.nprend +# application/prs.plucker +# application/prs.rdf-xml-crypt +# application/prs.xsf+xml +application/pskc+xml pskcxml +# application/qsig +application/rdf+xml rdf +application/reginfo+xml rif +application/relax-ng-compact-syntax rnc +# application/remote-printing +application/resource-lists+xml rl +application/resource-lists-diff+xml rld +# application/riscos +# application/rlmi+xml +application/rls-services+xml rs +application/rpki-ghostbusters gbr +application/rpki-manifest mft +application/rpki-roa roa +# application/rpki-updown +application/rsd+xml rsd +application/rss+xml rss +application/rtf rtf +# application/rtx +# application/samlassertion+xml +# application/samlmetadata+xml +application/sbml+xml sbml +application/scvp-cv-request scq +application/scvp-cv-response scs +application/scvp-vp-request spq +application/scvp-vp-response spp +application/sdp sdp +# application/set-payment +application/set-payment-initiation setpay +# application/set-registration +application/set-registration-initiation setreg +# application/sgml +# application/sgml-open-catalog +application/shf+xml shf +# application/sieve +# application/simple-filter+xml +# application/simple-message-summary +# application/simplesymbolcontainer +# application/slate +# application/smil +application/smil+xml smi smil +# application/soap+fastinfoset +# application/soap+xml +application/sparql-query rq +application/sparql-results+xml srx +# application/spirits-event+xml +application/srgs gram +application/srgs+xml grxml +application/sru+xml sru +application/ssdl+xml ssdl +application/ssml+xml ssml +# application/tamp-apex-update +# application/tamp-apex-update-confirm +# application/tamp-community-update +# application/tamp-community-update-confirm +# application/tamp-error +# application/tamp-sequence-adjust +# application/tamp-sequence-adjust-confirm +# application/tamp-status-query +# application/tamp-status-response +# application/tamp-update +# application/tamp-update-confirm +application/tei+xml tei teicorpus +application/thraud+xml tfi +# application/timestamp-query +# application/timestamp-reply +application/timestamped-data tsd +# application/tve-trigger +# application/ulpfec +# application/vcard+xml +# application/vemmi +# application/vividence.scriptfile +# application/vnd.3gpp.bsf+xml +application/vnd.3gpp.pic-bw-large plb +application/vnd.3gpp.pic-bw-small psb +application/vnd.3gpp.pic-bw-var pvb +# application/vnd.3gpp.sms +# application/vnd.3gpp2.bcmcsinfo+xml +# application/vnd.3gpp2.sms +application/vnd.3gpp2.tcap tcap +application/vnd.3m.post-it-notes pwn +application/vnd.accpac.simply.aso aso +application/vnd.accpac.simply.imp imp +application/vnd.acucobol acu +application/vnd.acucorp atc acutc +application/vnd.adobe.air-application-installer-package+zip air +application/vnd.adobe.formscentral.fcdt fcdt +application/vnd.adobe.fxp fxp fxpl +# application/vnd.adobe.partial-upload +application/vnd.adobe.xdp+xml xdp +application/vnd.adobe.xfdf xfdf +# application/vnd.aether.imp +# application/vnd.ah-barcode +application/vnd.ahead.space ahead +application/vnd.airzip.filesecure.azf azf +application/vnd.airzip.filesecure.azs azs +application/vnd.amazon.ebook azw +application/vnd.americandynamics.acc acc +application/vnd.amiga.ami ami +# application/vnd.amundsen.maze+xml +application/vnd.android.package-archive apk +application/vnd.anser-web-certificate-issue-initiation cii +application/vnd.anser-web-funds-transfer-initiation fti +application/vnd.antix.game-component atx +application/vnd.apple.installer+xml mpkg +application/vnd.apple.mpegurl m3u8 +# application/vnd.arastra.swi +application/vnd.aristanetworks.swi swi +application/vnd.astraea-software.iota iota +application/vnd.audiograph aep +# application/vnd.autopackage +# application/vnd.avistar+xml +application/vnd.blueice.multipass mpm +# application/vnd.bluetooth.ep.oob +application/vnd.bmi bmi +application/vnd.businessobjects rep +# application/vnd.cab-jscript +# application/vnd.canon-cpdl +# application/vnd.canon-lips +# application/vnd.cendio.thinlinc.clientconf +application/vnd.chemdraw+xml cdxml +application/vnd.chipnuts.karaoke-mmd mmd +application/vnd.cinderella cdy +# application/vnd.cirpack.isdn-ext +application/vnd.claymore cla +application/vnd.cloanto.rp9 rp9 +application/vnd.clonk.c4group c4g c4d c4f c4p c4u +application/vnd.cluetrust.cartomobile-config c11amc +application/vnd.cluetrust.cartomobile-config-pkg c11amz +# application/vnd.collection+json +# application/vnd.commerce-battelle +application/vnd.commonspace csp +application/vnd.contact.cmsg cdbcmsg +application/vnd.cosmocaller cmc +application/vnd.crick.clicker clkx +application/vnd.crick.clicker.keyboard clkk +application/vnd.crick.clicker.palette clkp +application/vnd.crick.clicker.template clkt +application/vnd.crick.clicker.wordbank clkw +application/vnd.criticaltools.wbs+xml wbs +application/vnd.ctc-posml pml +# application/vnd.ctct.ws+xml +# application/vnd.cups-pdf +# application/vnd.cups-postscript +application/vnd.cups-ppd ppd +# application/vnd.cups-raster +# application/vnd.cups-raw +# application/vnd.curl +application/vnd.curl.car car +application/vnd.curl.pcurl pcurl +# application/vnd.cybank +application/vnd.dart dart +application/vnd.data-vision.rdz rdz +application/vnd.dece.data uvf uvvf uvd uvvd +application/vnd.dece.ttml+xml uvt uvvt +application/vnd.dece.unspecified uvx uvvx +application/vnd.dece.zip uvz uvvz +application/vnd.denovo.fcselayout-link fe_launch +# application/vnd.dir-bi.plate-dl-nosuffix +application/vnd.dna dna +application/vnd.dolby.mlp mlp +# application/vnd.dolby.mobile.1 +# application/vnd.dolby.mobile.2 +application/vnd.dpgraph dpg +application/vnd.dreamfactory dfac +application/vnd.ds-keypoint kpxx +application/vnd.dvb.ait ait +# application/vnd.dvb.dvbj +# application/vnd.dvb.esgcontainer +# application/vnd.dvb.ipdcdftnotifaccess +# application/vnd.dvb.ipdcesgaccess +# application/vnd.dvb.ipdcesgaccess2 +# application/vnd.dvb.ipdcesgpdd +# application/vnd.dvb.ipdcroaming +# application/vnd.dvb.iptv.alfec-base +# application/vnd.dvb.iptv.alfec-enhancement +# application/vnd.dvb.notif-aggregate-root+xml +# application/vnd.dvb.notif-container+xml +# application/vnd.dvb.notif-generic+xml +# application/vnd.dvb.notif-ia-msglist+xml +# application/vnd.dvb.notif-ia-registration-request+xml +# application/vnd.dvb.notif-ia-registration-response+xml +# application/vnd.dvb.notif-init+xml +# application/vnd.dvb.pfr +application/vnd.dvb.service svc +# application/vnd.dxr +application/vnd.dynageo geo +# application/vnd.easykaraoke.cdgdownload +# application/vnd.ecdis-update +application/vnd.ecowin.chart mag +# application/vnd.ecowin.filerequest +# application/vnd.ecowin.fileupdate +# application/vnd.ecowin.series +# application/vnd.ecowin.seriesrequest +# application/vnd.ecowin.seriesupdate +# application/vnd.emclient.accessrequest+xml +application/vnd.enliven nml +# application/vnd.eprints.data+xml +application/vnd.epson.esf esf +application/vnd.epson.msf msf +application/vnd.epson.quickanime qam +application/vnd.epson.salt slt +application/vnd.epson.ssf ssf +# application/vnd.ericsson.quickcall +application/vnd.eszigno3+xml es3 et3 +# application/vnd.etsi.aoc+xml +# application/vnd.etsi.cug+xml +# application/vnd.etsi.iptvcommand+xml +# application/vnd.etsi.iptvdiscovery+xml +# application/vnd.etsi.iptvprofile+xml +# application/vnd.etsi.iptvsad-bc+xml +# application/vnd.etsi.iptvsad-cod+xml +# application/vnd.etsi.iptvsad-npvr+xml +# application/vnd.etsi.iptvservice+xml +# application/vnd.etsi.iptvsync+xml +# application/vnd.etsi.iptvueprofile+xml +# application/vnd.etsi.mcid+xml +# application/vnd.etsi.overload-control-policy-dataset+xml +# application/vnd.etsi.sci+xml +# application/vnd.etsi.simservs+xml +# application/vnd.etsi.tsl+xml +# application/vnd.etsi.tsl.der +# application/vnd.eudora.data +application/vnd.ezpix-album ez2 +application/vnd.ezpix-package ez3 +# application/vnd.f-secure.mobile +application/vnd.fdf fdf +application/vnd.fdsn.mseed mseed +application/vnd.fdsn.seed seed dataless +# application/vnd.ffsns +# application/vnd.fints +application/vnd.flographit gph +application/vnd.fluxtime.clip ftc +# application/vnd.font-fontforge-sfd +application/vnd.framemaker fm frame maker book +application/vnd.frogans.fnc fnc +application/vnd.frogans.ltf ltf +application/vnd.fsc.weblaunch fsc +application/vnd.fujitsu.oasys oas +application/vnd.fujitsu.oasys2 oa2 +application/vnd.fujitsu.oasys3 oa3 +application/vnd.fujitsu.oasysgp fg5 +application/vnd.fujitsu.oasysprs bh2 +# application/vnd.fujixerox.art-ex +# application/vnd.fujixerox.art4 +# application/vnd.fujixerox.hbpl +application/vnd.fujixerox.ddd ddd +application/vnd.fujixerox.docuworks xdw +application/vnd.fujixerox.docuworks.binder xbd +# application/vnd.fut-misnet +application/vnd.fuzzysheet fzs +application/vnd.genomatix.tuxedo txd +# application/vnd.geocube+xml +application/vnd.geogebra.file ggb +application/vnd.geogebra.tool ggt +application/vnd.geometry-explorer gex gre +application/vnd.geonext gxt +application/vnd.geoplan g2w +application/vnd.geospace g3w +# application/vnd.globalplatform.card-content-mgt +# application/vnd.globalplatform.card-content-mgt-response +application/vnd.gmx gmx +application/vnd.google-earth.kml+xml kml +application/vnd.google-earth.kmz kmz +application/vnd.grafeq gqf gqs +# application/vnd.gridmp +application/vnd.groove-account gac +application/vnd.groove-help ghf +application/vnd.groove-identity-message gim +application/vnd.groove-injector grv +application/vnd.groove-tool-message gtm +application/vnd.groove-tool-template tpl +application/vnd.groove-vcard vcg +# application/vnd.hal+json +application/vnd.hal+xml hal +application/vnd.handheld-entertainment+xml zmm +application/vnd.hbci hbci +# application/vnd.hcl-bireports +application/vnd.hhe.lesson-player les +application/vnd.hp-hpgl hpgl +application/vnd.hp-hpid hpid +application/vnd.hp-hps hps +application/vnd.hp-jlyt jlt +application/vnd.hp-pcl pcl +application/vnd.hp-pclxl pclxl +# application/vnd.httphone +application/vnd.hydrostatix.sof-data sfd-hdstx +# application/vnd.hzn-3d-crossword +# application/vnd.ibm.afplinedata +# application/vnd.ibm.electronic-media +application/vnd.ibm.minipay mpy +application/vnd.ibm.modcap afp listafp list3820 +application/vnd.ibm.rights-management irm +application/vnd.ibm.secure-container sc +application/vnd.iccprofile icc icm +application/vnd.igloader igl +application/vnd.immervision-ivp ivp +application/vnd.immervision-ivu ivu +# application/vnd.informedcontrol.rms+xml +# application/vnd.informix-visionary +# application/vnd.infotech.project +# application/vnd.infotech.project+xml +# application/vnd.innopath.wamp.notification +application/vnd.insors.igm igm +application/vnd.intercon.formnet xpw xpx +application/vnd.intergeo i2g +# application/vnd.intertrust.digibox +# application/vnd.intertrust.nncp +application/vnd.intu.qbo qbo +application/vnd.intu.qfx qfx +# application/vnd.iptc.g2.conceptitem+xml +# application/vnd.iptc.g2.knowledgeitem+xml +# application/vnd.iptc.g2.newsitem+xml +# application/vnd.iptc.g2.newsmessage+xml +# application/vnd.iptc.g2.packageitem+xml +# application/vnd.iptc.g2.planningitem+xml +application/vnd.ipunplugged.rcprofile rcprofile +application/vnd.irepository.package+xml irp +application/vnd.is-xpr xpr +application/vnd.isac.fcs fcs +application/vnd.jam jam +# application/vnd.japannet-directory-service +# application/vnd.japannet-jpnstore-wakeup +# application/vnd.japannet-payment-wakeup +# application/vnd.japannet-registration +# application/vnd.japannet-registration-wakeup +# application/vnd.japannet-setstore-wakeup +# application/vnd.japannet-verification +# application/vnd.japannet-verification-wakeup +application/vnd.jcp.javame.midlet-rms rms +application/vnd.jisp jisp +application/vnd.joost.joda-archive joda +application/vnd.kahootz ktz ktr +application/vnd.kde.karbon karbon +application/vnd.kde.kchart chrt +application/vnd.kde.kformula kfo +application/vnd.kde.kivio flw +application/vnd.kde.kontour kon +application/vnd.kde.kpresenter kpr kpt +application/vnd.kde.kspread ksp +application/vnd.kde.kword kwd kwt +application/vnd.kenameaapp htke +application/vnd.kidspiration kia +application/vnd.kinar kne knp +application/vnd.koan skp skd skt skm +application/vnd.kodak-descriptor sse +application/vnd.las.las+xml lasxml +# application/vnd.liberty-request+xml +application/vnd.llamagraphics.life-balance.desktop lbd +application/vnd.llamagraphics.life-balance.exchange+xml lbe +application/vnd.lotus-1-2-3 123 +application/vnd.lotus-approach apr +application/vnd.lotus-freelance pre +application/vnd.lotus-notes nsf +application/vnd.lotus-organizer org +application/vnd.lotus-screencam scm +application/vnd.lotus-wordpro lwp +application/vnd.macports.portpkg portpkg +# application/vnd.marlin.drm.actiontoken+xml +# application/vnd.marlin.drm.conftoken+xml +# application/vnd.marlin.drm.license+xml +# application/vnd.marlin.drm.mdcf +application/vnd.mcd mcd +application/vnd.medcalcdata mc1 +application/vnd.mediastation.cdkey cdkey +# application/vnd.meridian-slingshot +application/vnd.mfer mwf +application/vnd.mfmp mfm +application/vnd.micrografx.flo flo +application/vnd.micrografx.igx igx +application/vnd.mif mif +# application/vnd.minisoft-hp3000-save +# application/vnd.mitsubishi.misty-guard.trustweb +application/vnd.mobius.daf daf +application/vnd.mobius.dis dis +application/vnd.mobius.mbk mbk +application/vnd.mobius.mqy mqy +application/vnd.mobius.msl msl +application/vnd.mobius.plc plc +application/vnd.mobius.txf txf +application/vnd.mophun.application mpn +application/vnd.mophun.certificate mpc +# application/vnd.motorola.flexsuite +# application/vnd.motorola.flexsuite.adsi +# application/vnd.motorola.flexsuite.fis +# application/vnd.motorola.flexsuite.gotap +# application/vnd.motorola.flexsuite.kmr +# application/vnd.motorola.flexsuite.ttc +# application/vnd.motorola.flexsuite.wem +# application/vnd.motorola.iprm +application/vnd.mozilla.xul+xml xul +application/vnd.ms-artgalry cil +# application/vnd.ms-asf +application/vnd.ms-cab-compressed cab +# application/vnd.ms-color.iccprofile +application/vnd.ms-excel xls xlm xla xlc xlt xlw +application/vnd.ms-excel.addin.macroenabled.12 xlam +application/vnd.ms-excel.sheet.binary.macroenabled.12 xlsb +application/vnd.ms-excel.sheet.macroenabled.12 xlsm +application/vnd.ms-excel.template.macroenabled.12 xltm +application/vnd.ms-fontobject eot +application/vnd.ms-htmlhelp chm +application/vnd.ms-ims ims +application/vnd.ms-lrm lrm +# application/vnd.ms-office.activex+xml +application/vnd.ms-officetheme thmx +# application/vnd.ms-opentype +# application/vnd.ms-package.obfuscated-opentype +application/vnd.ms-pki.seccat cat +application/vnd.ms-pki.stl stl +# application/vnd.ms-playready.initiator+xml +application/vnd.ms-powerpoint ppt pps pot +application/vnd.ms-powerpoint.addin.macroenabled.12 ppam +application/vnd.ms-powerpoint.presentation.macroenabled.12 pptm +application/vnd.ms-powerpoint.slide.macroenabled.12 sldm +application/vnd.ms-powerpoint.slideshow.macroenabled.12 ppsm +application/vnd.ms-powerpoint.template.macroenabled.12 potm +# application/vnd.ms-printing.printticket+xml +application/vnd.ms-project mpp mpt +# application/vnd.ms-tnef +# application/vnd.ms-wmdrm.lic-chlg-req +# application/vnd.ms-wmdrm.lic-resp +# application/vnd.ms-wmdrm.meter-chlg-req +# application/vnd.ms-wmdrm.meter-resp +application/vnd.ms-word.document.macroenabled.12 docm +application/vnd.ms-word.template.macroenabled.12 dotm +application/vnd.ms-works wps wks wcm wdb +application/vnd.ms-wpl wpl +application/vnd.ms-xpsdocument xps +application/vnd.mseq mseq +# application/vnd.msign +# application/vnd.multiad.creator +# application/vnd.multiad.creator.cif +# application/vnd.music-niff +application/vnd.musician mus +application/vnd.muvee.style msty +application/vnd.mynfc taglet +# application/vnd.ncd.control +# application/vnd.ncd.reference +# application/vnd.nervana +# application/vnd.netfpx +application/vnd.neurolanguage.nlu nlu +application/vnd.nitf ntf nitf +application/vnd.noblenet-directory nnd +application/vnd.noblenet-sealer nns +application/vnd.noblenet-web nnw +# application/vnd.nokia.catalogs +# application/vnd.nokia.conml+wbxml +# application/vnd.nokia.conml+xml +# application/vnd.nokia.isds-radio-presets +# application/vnd.nokia.iptv.config+xml +# application/vnd.nokia.landmark+wbxml +# application/vnd.nokia.landmark+xml +# application/vnd.nokia.landmarkcollection+xml +# application/vnd.nokia.n-gage.ac+xml +application/vnd.nokia.n-gage.data ngdat +application/vnd.nokia.n-gage.symbian.install n-gage +# application/vnd.nokia.ncd +# application/vnd.nokia.pcd+wbxml +# application/vnd.nokia.pcd+xml +application/vnd.nokia.radio-preset rpst +application/vnd.nokia.radio-presets rpss +application/vnd.novadigm.edm edm +application/vnd.novadigm.edx edx +application/vnd.novadigm.ext ext +# application/vnd.ntt-local.file-transfer +# application/vnd.ntt-local.sip-ta_remote +# application/vnd.ntt-local.sip-ta_tcp_stream +application/vnd.oasis.opendocument.chart odc +application/vnd.oasis.opendocument.chart-template otc +application/vnd.oasis.opendocument.database odb +application/vnd.oasis.opendocument.formula odf +application/vnd.oasis.opendocument.formula-template odft +application/vnd.oasis.opendocument.graphics odg +application/vnd.oasis.opendocument.graphics-template otg +application/vnd.oasis.opendocument.image odi +application/vnd.oasis.opendocument.image-template oti +application/vnd.oasis.opendocument.presentation odp +application/vnd.oasis.opendocument.presentation-template otp +application/vnd.oasis.opendocument.spreadsheet ods +application/vnd.oasis.opendocument.spreadsheet-template ots +application/vnd.oasis.opendocument.text odt +application/vnd.oasis.opendocument.text-master odm +application/vnd.oasis.opendocument.text-template ott +application/vnd.oasis.opendocument.text-web oth +# application/vnd.obn +# application/vnd.oftn.l10n+json +# application/vnd.oipf.contentaccessdownload+xml +# application/vnd.oipf.contentaccessstreaming+xml +# application/vnd.oipf.cspg-hexbinary +# application/vnd.oipf.dae.svg+xml +# application/vnd.oipf.dae.xhtml+xml +# application/vnd.oipf.mippvcontrolmessage+xml +# application/vnd.oipf.pae.gem +# application/vnd.oipf.spdiscovery+xml +# application/vnd.oipf.spdlist+xml +# application/vnd.oipf.ueprofile+xml +# application/vnd.oipf.userprofile+xml +application/vnd.olpc-sugar xo +# application/vnd.oma-scws-config +# application/vnd.oma-scws-http-request +# application/vnd.oma-scws-http-response +# application/vnd.oma.bcast.associated-procedure-parameter+xml +# application/vnd.oma.bcast.drm-trigger+xml +# application/vnd.oma.bcast.imd+xml +# application/vnd.oma.bcast.ltkm +# application/vnd.oma.bcast.notification+xml +# application/vnd.oma.bcast.provisioningtrigger +# application/vnd.oma.bcast.sgboot +# application/vnd.oma.bcast.sgdd+xml +# application/vnd.oma.bcast.sgdu +# application/vnd.oma.bcast.simple-symbol-container +# application/vnd.oma.bcast.smartcard-trigger+xml +# application/vnd.oma.bcast.sprov+xml +# application/vnd.oma.bcast.stkm +# application/vnd.oma.cab-address-book+xml +# application/vnd.oma.cab-feature-handler+xml +# application/vnd.oma.cab-pcc+xml +# application/vnd.oma.cab-user-prefs+xml +# application/vnd.oma.dcd +# application/vnd.oma.dcdc +application/vnd.oma.dd2+xml dd2 +# application/vnd.oma.drm.risd+xml +# application/vnd.oma.group-usage-list+xml +# application/vnd.oma.pal+xml +# application/vnd.oma.poc.detailed-progress-report+xml +# application/vnd.oma.poc.final-report+xml +# application/vnd.oma.poc.groups+xml +# application/vnd.oma.poc.invocation-descriptor+xml +# application/vnd.oma.poc.optimized-progress-report+xml +# application/vnd.oma.push +# application/vnd.oma.scidm.messages+xml +# application/vnd.oma.xcap-directory+xml +# application/vnd.omads-email+xml +# application/vnd.omads-file+xml +# application/vnd.omads-folder+xml +# application/vnd.omaloc-supl-init +application/vnd.openofficeorg.extension oxt +# application/vnd.openxmlformats-officedocument.custom-properties+xml +# application/vnd.openxmlformats-officedocument.customxmlproperties+xml +# application/vnd.openxmlformats-officedocument.drawing+xml +# application/vnd.openxmlformats-officedocument.drawingml.chart+xml +# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml +# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml +# application/vnd.openxmlformats-officedocument.extended-properties+xml +# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml +# application/vnd.openxmlformats-officedocument.presentationml.comments+xml +# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml +# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml +application/vnd.openxmlformats-officedocument.presentationml.presentation pptx +# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml +application/vnd.openxmlformats-officedocument.presentationml.slide sldx +# application/vnd.openxmlformats-officedocument.presentationml.slide+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml +# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml +application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx +# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml +# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml +# application/vnd.openxmlformats-officedocument.presentationml.tags+xml +application/vnd.openxmlformats-officedocument.presentationml.template potx +# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml +# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml +application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx +# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml +# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml +# application/vnd.openxmlformats-officedocument.theme+xml +# application/vnd.openxmlformats-officedocument.themeoverride+xml +# application/vnd.openxmlformats-officedocument.vmldrawing +# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.document docx +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml +application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx +# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml +# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml +# application/vnd.openxmlformats-package.core-properties+xml +# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml +# application/vnd.openxmlformats-package.relationships+xml +# application/vnd.quobject-quoxdocument +# application/vnd.osa.netdeploy +application/vnd.osgeo.mapguide.package mgp +# application/vnd.osgi.bundle +application/vnd.osgi.dp dp +application/vnd.osgi.subsystem esa +# application/vnd.otps.ct-kip+xml +application/vnd.palm pdb pqa oprc +# application/vnd.paos.xml +application/vnd.pawaafile paw +application/vnd.pg.format str +application/vnd.pg.osasli ei6 +# application/vnd.piaccess.application-licence +application/vnd.picsel efif +application/vnd.pmi.widget wg +# application/vnd.poc.group-advertisement+xml +application/vnd.pocketlearn plf +application/vnd.powerbuilder6 pbd +# application/vnd.powerbuilder6-s +# application/vnd.powerbuilder7 +# application/vnd.powerbuilder7-s +# application/vnd.powerbuilder75 +# application/vnd.powerbuilder75-s +# application/vnd.preminet +application/vnd.previewsystems.box box +application/vnd.proteus.magazine mgz +application/vnd.publishare-delta-tree qps +application/vnd.pvi.ptid1 ptid +# application/vnd.pwg-multiplexed +# application/vnd.pwg-xhtml-print+xml +# application/vnd.qualcomm.brew-app-res +application/vnd.quark.quarkxpress qxd qxt qwd qwt qxl qxb +# application/vnd.radisys.moml+xml +# application/vnd.radisys.msml+xml +# application/vnd.radisys.msml-audit+xml +# application/vnd.radisys.msml-audit-conf+xml +# application/vnd.radisys.msml-audit-conn+xml +# application/vnd.radisys.msml-audit-dialog+xml +# application/vnd.radisys.msml-audit-stream+xml +# application/vnd.radisys.msml-conf+xml +# application/vnd.radisys.msml-dialog+xml +# application/vnd.radisys.msml-dialog-base+xml +# application/vnd.radisys.msml-dialog-fax-detect+xml +# application/vnd.radisys.msml-dialog-fax-sendrecv+xml +# application/vnd.radisys.msml-dialog-group+xml +# application/vnd.radisys.msml-dialog-speech+xml +# application/vnd.radisys.msml-dialog-transform+xml +# application/vnd.rainstor.data +# application/vnd.rapid +application/vnd.realvnc.bed bed +application/vnd.recordare.musicxml mxl +application/vnd.recordare.musicxml+xml musicxml +# application/vnd.renlearn.rlprint +application/vnd.rig.cryptonote cryptonote +application/vnd.rim.cod cod +application/vnd.rn-realmedia rm +application/vnd.rn-realmedia-vbr rmvb +application/vnd.route66.link66+xml link66 +# application/vnd.rs-274x +# application/vnd.ruckus.download +# application/vnd.s3sms +application/vnd.sailingtracker.track st +# application/vnd.sbm.cid +# application/vnd.sbm.mid2 +# application/vnd.scribus +# application/vnd.sealed.3df +# application/vnd.sealed.csf +# application/vnd.sealed.doc +# application/vnd.sealed.eml +# application/vnd.sealed.mht +# application/vnd.sealed.net +# application/vnd.sealed.ppt +# application/vnd.sealed.tiff +# application/vnd.sealed.xls +# application/vnd.sealedmedia.softseal.html +# application/vnd.sealedmedia.softseal.pdf +application/vnd.seemail see +application/vnd.sema sema +application/vnd.semd semd +application/vnd.semf semf +application/vnd.shana.informed.formdata ifm +application/vnd.shana.informed.formtemplate itp +application/vnd.shana.informed.interchange iif +application/vnd.shana.informed.package ipk +application/vnd.simtech-mindmapper twd twds +application/vnd.smaf mmf +# application/vnd.smart.notebook +application/vnd.smart.teacher teacher +# application/vnd.software602.filler.form+xml +# application/vnd.software602.filler.form-xml-zip +application/vnd.solent.sdkm+xml sdkm sdkd +application/vnd.spotfire.dxp dxp +application/vnd.spotfire.sfs sfs +# application/vnd.sss-cod +# application/vnd.sss-dtf +# application/vnd.sss-ntf +application/vnd.stardivision.calc sdc +application/vnd.stardivision.draw sda +application/vnd.stardivision.impress sdd +application/vnd.stardivision.math smf +application/vnd.stardivision.writer sdw vor +application/vnd.stardivision.writer-global sgl +application/vnd.stepmania.package smzip +application/vnd.stepmania.stepchart sm +# application/vnd.street-stream +application/vnd.sun.xml.calc sxc +application/vnd.sun.xml.calc.template stc +application/vnd.sun.xml.draw sxd +application/vnd.sun.xml.draw.template std +application/vnd.sun.xml.impress sxi +application/vnd.sun.xml.impress.template sti +application/vnd.sun.xml.math sxm +application/vnd.sun.xml.writer sxw +application/vnd.sun.xml.writer.global sxg +application/vnd.sun.xml.writer.template stw +# application/vnd.sun.wadl+xml +application/vnd.sus-calendar sus susp +application/vnd.svd svd +# application/vnd.swiftview-ics +application/vnd.symbian.install sis sisx +application/vnd.syncml+xml xsm +application/vnd.syncml.dm+wbxml bdm +application/vnd.syncml.dm+xml xdm +# application/vnd.syncml.dm.notification +# application/vnd.syncml.ds.notification +application/vnd.tao.intent-module-archive tao +application/vnd.tcpdump.pcap pcap cap dmp +application/vnd.tmobile-livetv tmo +application/vnd.trid.tpt tpt +application/vnd.triscape.mxs mxs +application/vnd.trueapp tra +# application/vnd.truedoc +# application/vnd.ubisoft.webplayer +application/vnd.ufdl ufd ufdl +application/vnd.uiq.theme utz +application/vnd.umajin umj +application/vnd.unity unityweb +application/vnd.uoml+xml uoml +# application/vnd.uplanet.alert +# application/vnd.uplanet.alert-wbxml +# application/vnd.uplanet.bearer-choice +# application/vnd.uplanet.bearer-choice-wbxml +# application/vnd.uplanet.cacheop +# application/vnd.uplanet.cacheop-wbxml +# application/vnd.uplanet.channel +# application/vnd.uplanet.channel-wbxml +# application/vnd.uplanet.list +# application/vnd.uplanet.list-wbxml +# application/vnd.uplanet.listcmd +# application/vnd.uplanet.listcmd-wbxml +# application/vnd.uplanet.signal +application/vnd.vcx vcx +# application/vnd.vd-study +# application/vnd.vectorworks +# application/vnd.verimatrix.vcas +# application/vnd.vidsoft.vidconference +application/vnd.visio vsd vst vss vsw +application/vnd.visionary vis +# application/vnd.vividence.scriptfile +application/vnd.vsf vsf +# application/vnd.wap.sic +# application/vnd.wap.slc +application/vnd.wap.wbxml wbxml +application/vnd.wap.wmlc wmlc +application/vnd.wap.wmlscriptc wmlsc +application/vnd.webturbo wtb +# application/vnd.wfa.wsc +# application/vnd.wmc +# application/vnd.wmf.bootstrap +# application/vnd.wolfram.mathematica +# application/vnd.wolfram.mathematica.package +application/vnd.wolfram.player nbp +application/vnd.wordperfect wpd +application/vnd.wqd wqd +# application/vnd.wrq-hp3000-labelled +application/vnd.wt.stf stf +# application/vnd.wv.csp+wbxml +# application/vnd.wv.csp+xml +# application/vnd.wv.ssp+xml +application/vnd.xara xar +application/vnd.xfdl xfdl +# application/vnd.xfdl.webform +# application/vnd.xmi+xml +# application/vnd.xmpie.cpkg +# application/vnd.xmpie.dpkg +# application/vnd.xmpie.plan +# application/vnd.xmpie.ppkg +# application/vnd.xmpie.xlim +application/vnd.yamaha.hv-dic hvd +application/vnd.yamaha.hv-script hvs +application/vnd.yamaha.hv-voice hvp +application/vnd.yamaha.openscoreformat osf +application/vnd.yamaha.openscoreformat.osfpvg+xml osfpvg +# application/vnd.yamaha.remote-setup +application/vnd.yamaha.smaf-audio saf +application/vnd.yamaha.smaf-phrase spf +# application/vnd.yamaha.through-ngn +# application/vnd.yamaha.tunnel-udpencap +application/vnd.yellowriver-custom-menu cmp +application/vnd.zul zir zirz +application/vnd.zzazz.deck+xml zaz +application/voicexml+xml vxml +# application/vq-rtcpxr +# application/watcherinfo+xml +# application/whoispp-query +# application/whoispp-response +application/widget wgt +application/winhlp hlp +# application/wita +# application/wordperfect5.1 +application/wsdl+xml wsdl +application/wspolicy+xml wspolicy +application/x-7z-compressed 7z +application/x-abiword abw +application/x-ace-compressed ace +# application/x-amf +application/x-apple-diskimage dmg +application/x-authorware-bin aab x32 u32 vox +application/x-authorware-map aam +application/x-authorware-seg aas +application/x-bcpio bcpio +application/x-bittorrent torrent +application/x-blorb blb blorb +application/x-bzip bz +application/x-bzip2 bz2 boz +application/x-cbr cbr cba cbt cbz cb7 +application/x-cdlink vcd +application/x-cfs-compressed cfs +application/x-chat chat +application/x-chess-pgn pgn +application/x-conference nsc +# application/x-compress +application/x-cpio cpio +application/x-csh csh +application/x-debian-package deb udeb +application/x-dgc-compressed dgc +application/x-director dir dcr dxr cst cct cxt w3d fgd swa +application/x-doom wad +application/x-dtbncx+xml ncx +application/x-dtbook+xml dtb +application/x-dtbresource+xml res +application/x-dvi dvi +application/x-envoy evy +application/x-eva eva +application/x-font-bdf bdf +# application/x-font-dos +# application/x-font-framemaker +application/x-font-ghostscript gsf +# application/x-font-libgrx +application/x-font-linux-psf psf +application/x-font-otf otf +application/x-font-pcf pcf +application/x-font-snf snf +# application/x-font-speedo +# application/x-font-sunos-news +application/x-font-ttf ttf ttc +application/x-font-type1 pfa pfb pfm afm +application/font-woff woff +# application/x-font-vfont +application/x-freearc arc +application/x-futuresplash spl +application/x-gca-compressed gca +application/x-glulx ulx +application/x-gnumeric gnumeric +application/x-gramps-xml gramps +application/x-gtar gtar +# application/x-gzip +application/x-hdf hdf +application/x-install-instructions install +application/x-iso9660-image iso +application/x-java-jnlp-file jnlp +application/x-latex latex +application/x-lzh-compressed lzh lha +application/x-mie mie +application/x-mobipocket-ebook prc mobi +application/x-ms-application application +application/x-ms-shortcut lnk +application/x-ms-wmd wmd +application/x-ms-wmz wmz +application/x-ms-xbap xbap +application/x-msaccess mdb +application/x-msbinder obd +application/x-mscardfile crd +application/x-msclip clp +application/x-msdownload exe dll com bat msi +application/x-msmediaview mvb m13 m14 +application/x-msmetafile wmf wmz emf emz +application/x-msmoney mny +application/x-mspublisher pub +application/x-msschedule scd +application/x-msterminal trm +application/x-mswrite wri +application/x-netcdf nc cdf +application/x-nzb nzb +application/x-pkcs12 p12 pfx +application/x-pkcs7-certificates p7b spc +application/x-pkcs7-certreqresp p7r +application/x-rar-compressed rar +application/x-research-info-systems ris +application/x-sh sh +application/x-shar shar +application/x-shockwave-flash swf +application/x-silverlight-app xap +application/x-sql sql +application/x-stuffit sit +application/x-stuffitx sitx +application/x-subrip srt +application/x-sv4cpio sv4cpio +application/x-sv4crc sv4crc +application/x-t3vm-image t3 +application/x-tads gam +application/x-tar tar +application/x-tcl tcl +application/x-tex tex +application/x-tex-tfm tfm +application/x-texinfo texinfo texi +application/x-tgif obj +application/x-ustar ustar +application/x-wais-source src +application/x-x509-ca-cert der crt +application/x-xfig fig +application/x-xliff+xml xlf +application/x-xpinstall xpi +application/x-xz xz +application/x-zmachine z1 z2 z3 z4 z5 z6 z7 z8 +# application/x400-bp +application/xaml+xml xaml +# application/xcap-att+xml +# application/xcap-caps+xml +application/xcap-diff+xml xdf +# application/xcap-el+xml +# application/xcap-error+xml +# application/xcap-ns+xml +# application/xcon-conference-info-diff+xml +# application/xcon-conference-info+xml +application/xenc+xml xenc +application/xhtml+xml xhtml xht +# application/xhtml-voice+xml +application/xml xml xsl +application/xml-dtd dtd +# application/xml-external-parsed-entity +# application/xmpp+xml +application/xop+xml xop +application/xproc+xml xpl +application/xslt+xml xslt +application/xspf+xml xspf +application/xv+xml mxml xhvml xvml xvm +application/yang yang +application/yin+xml yin +application/zip zip +# audio/1d-interleaved-parityfec +# audio/32kadpcm +# audio/3gpp +# audio/3gpp2 +# audio/ac3 +audio/adpcm adp +# audio/amr +# audio/amr-wb +# audio/amr-wb+ +# audio/asc +# audio/atrac-advanced-lossless +# audio/atrac-x +# audio/atrac3 +audio/basic au snd +# audio/bv16 +# audio/bv32 +# audio/clearmode +# audio/cn +# audio/dat12 +# audio/dls +# audio/dsr-es201108 +# audio/dsr-es202050 +# audio/dsr-es202211 +# audio/dsr-es202212 +# audio/dv +# audio/dvi4 +# audio/eac3 +# audio/evrc +# audio/evrc-qcp +# audio/evrc0 +# audio/evrc1 +# audio/evrcb +# audio/evrcb0 +# audio/evrcb1 +# audio/evrcwb +# audio/evrcwb0 +# audio/evrcwb1 +# audio/example +# audio/fwdred +# audio/g719 +# audio/g722 +# audio/g7221 +# audio/g723 +# audio/g726-16 +# audio/g726-24 +# audio/g726-32 +# audio/g726-40 +# audio/g728 +# audio/g729 +# audio/g7291 +# audio/g729d +# audio/g729e +# audio/gsm +# audio/gsm-efr +# audio/gsm-hr-08 +# audio/ilbc +# audio/ip-mr_v2.5 +# audio/isac +# audio/l16 +# audio/l20 +# audio/l24 +# audio/l8 +# audio/lpc +audio/midi mid midi kar rmi +# audio/mobile-xmf +audio/mp4 mp4a +# audio/mp4a-latm +# audio/mpa +# audio/mpa-robust +audio/mpeg mpga mp2 mp2a mp3 m2a m3a +# audio/mpeg4-generic +# audio/musepack +audio/ogg oga ogg spx +# audio/opus +# audio/parityfec +# audio/pcma +# audio/pcma-wb +# audio/pcmu-wb +# audio/pcmu +# audio/prs.sid +# audio/qcelp +# audio/red +# audio/rtp-enc-aescm128 +# audio/rtp-midi +# audio/rtx +audio/s3m s3m +audio/silk sil +# audio/smv +# audio/smv0 +# audio/smv-qcp +# audio/sp-midi +# audio/speex +# audio/t140c +# audio/t38 +# audio/telephone-event +# audio/tone +# audio/uemclip +# audio/ulpfec +# audio/vdvi +# audio/vmr-wb +# audio/vnd.3gpp.iufp +# audio/vnd.4sb +# audio/vnd.audiokoz +# audio/vnd.celp +# audio/vnd.cisco.nse +# audio/vnd.cmles.radio-events +# audio/vnd.cns.anp1 +# audio/vnd.cns.inf1 +audio/vnd.dece.audio uva uvva +audio/vnd.digital-winds eol +# audio/vnd.dlna.adts +# audio/vnd.dolby.heaac.1 +# audio/vnd.dolby.heaac.2 +# audio/vnd.dolby.mlp +# audio/vnd.dolby.mps +# audio/vnd.dolby.pl2 +# audio/vnd.dolby.pl2x +# audio/vnd.dolby.pl2z +# audio/vnd.dolby.pulse.1 +audio/vnd.dra dra +audio/vnd.dts dts +audio/vnd.dts.hd dtshd +# audio/vnd.dvb.file +# audio/vnd.everad.plj +# audio/vnd.hns.audio +audio/vnd.lucent.voice lvp +audio/vnd.ms-playready.media.pya pya +# audio/vnd.nokia.mobile-xmf +# audio/vnd.nortel.vbk +audio/vnd.nuera.ecelp4800 ecelp4800 +audio/vnd.nuera.ecelp7470 ecelp7470 +audio/vnd.nuera.ecelp9600 ecelp9600 +# audio/vnd.octel.sbc +# audio/vnd.qcelp +# audio/vnd.rhetorex.32kadpcm +audio/vnd.rip rip +# audio/vnd.sealedmedia.softseal.mpeg +# audio/vnd.vmx.cvsd +# audio/vorbis +# audio/vorbis-config +audio/webm weba +audio/x-aac aac +audio/x-aiff aif aiff aifc +audio/x-caf caf +audio/x-flac flac +audio/x-matroska mka +audio/x-mpegurl m3u +audio/x-ms-wax wax +audio/x-ms-wma wma +audio/x-pn-realaudio ram ra +audio/x-pn-realaudio-plugin rmp +# audio/x-tta +audio/x-wav wav +audio/xm xm +chemical/x-cdx cdx +chemical/x-cif cif +chemical/x-cmdf cmdf +chemical/x-cml cml +chemical/x-csml csml +# chemical/x-pdb +chemical/x-xyz xyz +image/bmp bmp +image/cgm cgm +# image/example +# image/fits +image/g3fax g3 +image/gif gif +image/ief ief +# image/jp2 +image/jpeg jpeg jpg jpe +# image/jpm +# image/jpx +image/ktx ktx +# image/naplps +image/png png +image/prs.btif btif +# image/prs.pti +image/sgi sgi +image/svg+xml svg svgz +# image/t38 +image/tiff tiff tif +# image/tiff-fx +image/vnd.adobe.photoshop psd +# image/vnd.cns.inf2 +image/vnd.dece.graphic uvi uvvi uvg uvvg +image/vnd.dvb.subtitle sub +image/vnd.djvu djvu djv +image/vnd.dwg dwg +image/vnd.dxf dxf +image/vnd.fastbidsheet fbs +image/vnd.fpx fpx +image/vnd.fst fst +image/vnd.fujixerox.edmics-mmr mmr +image/vnd.fujixerox.edmics-rlc rlc +# image/vnd.globalgraphics.pgb +# image/vnd.microsoft.icon +# image/vnd.mix +image/vnd.ms-modi mdi +image/vnd.ms-photo wdp +image/vnd.net-fpx npx +# image/vnd.radiance +# image/vnd.sealed.png +# image/vnd.sealedmedia.softseal.gif +# image/vnd.sealedmedia.softseal.jpg +# image/vnd.svf +image/vnd.wap.wbmp wbmp +image/vnd.xiff xif +image/webp webp +image/x-3ds 3ds +image/x-cmu-raster ras +image/x-cmx cmx +image/x-freehand fh fhc fh4 fh5 fh7 +image/x-icon ico +image/x-mrsid-image sid +image/x-pcx pcx +image/x-pict pic pct +image/x-portable-anymap pnm +image/x-portable-bitmap pbm +image/x-portable-graymap pgm +image/x-portable-pixmap ppm +image/x-rgb rgb +image/x-tga tga +image/x-xbitmap xbm +image/x-xpixmap xpm +image/x-xwindowdump xwd +# message/cpim +# message/delivery-status +# message/disposition-notification +# message/example +# message/external-body +# message/feedback-report +# message/global +# message/global-delivery-status +# message/global-disposition-notification +# message/global-headers +# message/http +# message/imdn+xml +# message/news +# message/partial +message/rfc822 eml mime +# message/s-http +# message/sip +# message/sipfrag +# message/tracking-status +# message/vnd.si.simp +# model/example +model/iges igs iges +model/mesh msh mesh silo +model/vnd.collada+xml dae +model/vnd.dwf dwf +# model/vnd.flatland.3dml +model/vnd.gdl gdl +# model/vnd.gs-gdl +# model/vnd.gs.gdl +model/vnd.gtw gtw +# model/vnd.moml+xml +model/vnd.mts mts +# model/vnd.parasolid.transmit.binary +# model/vnd.parasolid.transmit.text +model/vnd.vtu vtu +model/vrml wrl vrml +model/x3d+binary x3db x3dbz +model/x3d+vrml x3dv x3dvz +model/x3d+xml x3d x3dz +# multipart/alternative +# multipart/appledouble +# multipart/byteranges +# multipart/digest +# multipart/encrypted +# multipart/example +# multipart/form-data +# multipart/header-set +# multipart/mixed +# multipart/parallel +# multipart/related +# multipart/report +# multipart/signed +# multipart/voice-message +# text/1d-interleaved-parityfec +text/cache-manifest appcache +text/calendar ics ifb +text/css css +text/csv csv +# text/directory +# text/dns +# text/ecmascript +# text/enriched +# text/example +# text/fwdred +text/html html htm +# text/javascript +text/n3 n3 +# text/parityfec +text/plain txt text conf def list log in +# text/prs.fallenstein.rst +text/prs.lines.tag dsc +# text/vnd.radisys.msml-basic-layout +# text/red +# text/rfc822-headers +text/richtext rtx +# text/rtf +# text/rtp-enc-aescm128 +# text/rtx +text/sgml sgml sgm +# text/t140 +text/tab-separated-values tsv +text/troff t tr roff man me ms +text/turtle ttl +# text/ulpfec +text/uri-list uri uris urls +text/vcard vcard +# text/vnd.abc +text/vnd.curl curl +text/vnd.curl.dcurl dcurl +text/vnd.curl.scurl scurl +text/vnd.curl.mcurl mcurl +# text/vnd.dmclientscript +text/vnd.dvb.subtitle sub +# text/vnd.esmertec.theme-descriptor +text/vnd.fly fly +text/vnd.fmi.flexstor flx +text/vnd.graphviz gv +text/vnd.in3d.3dml 3dml +text/vnd.in3d.spot spot +# text/vnd.iptc.newsml +# text/vnd.iptc.nitf +# text/vnd.latex-z +# text/vnd.motorola.reflex +# text/vnd.ms-mediapackage +# text/vnd.net2phone.commcenter.command +# text/vnd.si.uricatalogue +text/vnd.sun.j2me.app-descriptor jad +# text/vnd.trolltech.linguist +# text/vnd.wap.si +# text/vnd.wap.sl +text/vnd.wap.wml wml +text/vnd.wap.wmlscript wmls +text/x-asm s asm +text/x-c c cc cxx cpp h hh dic +text/x-fortran f for f77 f90 +text/x-java-source java +text/x-opml opml +text/x-pascal p pas +text/x-nfo nfo +text/x-setext etx +text/x-sfv sfv +text/x-uuencode uu +text/x-vcalendar vcs +text/x-vcard vcf +# text/xml +# text/xml-external-parsed-entity +# video/1d-interleaved-parityfec +video/3gpp 3gp +# video/3gpp-tt +video/3gpp2 3g2 +# video/bmpeg +# video/bt656 +# video/celb +# video/dv +# video/example +video/h261 h261 +video/h263 h263 +# video/h263-1998 +# video/h263-2000 +video/h264 h264 +# video/h264-rcdo +# video/h264-svc +video/jpeg jpgv +# video/jpeg2000 +video/jpm jpm jpgm +video/mj2 mj2 mjp2 +# video/mp1s +# video/mp2p +# video/mp2t +video/mp4 mp4 mp4v mpg4 +# video/mp4v-es +video/mpeg mpeg mpg mpe m1v m2v +# video/mpeg4-generic +# video/mpv +# video/nv +video/ogg ogv +# video/parityfec +# video/pointer +video/quicktime qt mov +# video/raw +# video/rtp-enc-aescm128 +# video/rtx +# video/smpte292m +# video/ulpfec +# video/vc1 +# video/vnd.cctv +video/vnd.dece.hd uvh uvvh +video/vnd.dece.mobile uvm uvvm +# video/vnd.dece.mp4 +video/vnd.dece.pd uvp uvvp +video/vnd.dece.sd uvs uvvs +video/vnd.dece.video uvv uvvv +# video/vnd.directv.mpeg +# video/vnd.directv.mpeg-tts +# video/vnd.dlna.mpeg-tts +video/vnd.dvb.file dvb +video/vnd.fvt fvt +# video/vnd.hns.video +# video/vnd.iptvforum.1dparityfec-1010 +# video/vnd.iptvforum.1dparityfec-2005 +# video/vnd.iptvforum.2dparityfec-1010 +# video/vnd.iptvforum.2dparityfec-2005 +# video/vnd.iptvforum.ttsavc +# video/vnd.iptvforum.ttsmpeg2 +# video/vnd.motorola.video +# video/vnd.motorola.videop +video/vnd.mpegurl mxu m4u +video/vnd.ms-playready.media.pyv pyv +# video/vnd.nokia.interleaved-multimedia +# video/vnd.nokia.videovoip +# video/vnd.objectvideo +# video/vnd.sealed.mpeg1 +# video/vnd.sealed.mpeg4 +# video/vnd.sealed.swf +# video/vnd.sealedmedia.softseal.mov +video/vnd.uvvu.mp4 uvu uvvu +video/vnd.vivo viv +video/webm webm +video/x-f4v f4v +video/x-fli fli +video/x-flv flv +video/x-m4v m4v +video/x-matroska mkv mk3d mks +video/x-mng mng +video/x-ms-asf asf asx +video/x-ms-vob vob +video/x-ms-wm wm +video/x-ms-wmv wmv +video/x-ms-wmx wmx +video/x-ms-wvx wvx +video/x-msvideo avi +video/x-sgi-movie movie +video/x-smv smv +x-conference/x-cooltalk ice diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/types/node.types b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/types/node.types new file mode 100644 index 00000000..55b2cf79 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/mime/types/node.types @@ -0,0 +1,77 @@ +# What: WebVTT +# Why: To allow formats intended for marking up external text track resources. +# http://dev.w3.org/html5/webvtt/ +# Added by: niftylettuce +text/vtt vtt + +# What: Google Chrome Extension +# Why: To allow apps to (work) be served with the right content type header. +# http://codereview.chromium.org/2830017 +# Added by: niftylettuce +application/x-chrome-extension crx + +# What: HTC support +# Why: To properly render .htc files such as CSS3PIE +# Added by: niftylettuce +text/x-component htc + +# What: HTML5 application cache manifes ('.manifest' extension) +# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps +# per https://developer.mozilla.org/en/offline_resources_in_firefox +# Added by: louisremi +text/cache-manifest manifest + +# What: node binary buffer format +# Why: semi-standard extension w/in the node community +# Added by: tootallnate +application/octet-stream buffer + +# What: The "protected" MP-4 formats used by iTunes. +# Why: Required for streaming music to browsers (?) +# Added by: broofa +application/mp4 m4p +audio/mp4 m4a + +# What: Video format, Part of RFC1890 +# Why: See https://github.com/bentomas/node-mime/pull/6 +# Added by: mjrusso +video/MP2T ts + +# What: EventSource mime type +# Why: mime type of Server-Sent Events stream +# http://www.w3.org/TR/eventsource/#text-event-stream +# Added by: francois2metz +text/event-stream event-stream + +# What: Mozilla App manifest mime type +# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests +# Added by: ednapiranha +application/x-web-app-manifest+json webapp + +# What: Lua file types +# Why: Googling around shows de-facto consensus on these +# Added by: creationix (Issue #45) +text/x-lua lua +application/x-lua-bytecode luac + +# What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax +# Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown +# Added by: avoidwork +text/x-markdown markdown md mkd + +# What: ini files +# Why: because they're just text files +# Added by: Matthew Kastor +text/plain ini + +# What: DASH Adaptive Streaming manifest +# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video +# Added by: eelcocramer +application/dash+xml mdp + +# What: OpenType font files - http://www.microsoft.com/typography/otspec/ +# Why: Browsers usually ignore the font MIME types and sniff the content, +# but Chrome, shows a warning if OpenType fonts aren't served with +# the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png. +# Added by: alrra +font/opentype otf diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/.npmignore new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/.npmignore @@ -0,0 +1 @@ +test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/History.md new file mode 100644 index 00000000..82df7b1e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/History.md @@ -0,0 +1,15 @@ + +0.0.4 / 2012-06-17 +================== + + * changed: ret -1 for unsatisfiable and -2 when invalid + +0.0.3 / 2012-06-17 +================== + + * fix last-byte-pos default to len - 1 + +0.0.2 / 2012-06-14 +================== + + * add `.type` diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/Makefile new file mode 100644 index 00000000..8e8640f2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/Makefile @@ -0,0 +1,7 @@ + +test: + @./node_modules/.bin/mocha \ + --reporter spec \ + --require should + +.PHONY: test \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/Readme.md new file mode 100644 index 00000000..b2a67fe8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/Readme.md @@ -0,0 +1,28 @@ + +# node-range-parser + + Range header field parser. + +## Example: + +```js +assert(-1 == parse(200, 'bytes=500-20')); +assert(-2 == parse(200, 'bytes=malformed')); +parse(200, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 199 }])); +parse(1000, 'bytes=0-499').should.eql(arr('bytes', [{ start: 0, end: 499 }])); +parse(1000, 'bytes=40-80').should.eql(arr('bytes', [{ start: 40, end: 80 }])); +parse(1000, 'bytes=-500').should.eql(arr('bytes', [{ start: 500, end: 999 }])); +parse(1000, 'bytes=-400').should.eql(arr('bytes', [{ start: 600, end: 999 }])); +parse(1000, 'bytes=500-').should.eql(arr('bytes', [{ start: 500, end: 999 }])); +parse(1000, 'bytes=400-').should.eql(arr('bytes', [{ start: 400, end: 999 }])); +parse(1000, 'bytes=0-0').should.eql(arr('bytes', [{ start: 0, end: 0 }])); +parse(1000, 'bytes=-1').should.eql(arr('bytes', [{ start: 999, end: 999 }])); +parse(1000, 'items=0-5').should.eql(arr('items', [{ start: 0, end: 5 }])); +parse(1000, 'bytes=40-80,-1').should.eql(arr('bytes', [{ start: 40, end: 80 }, { start: 999, end: 999 }])); +``` + +## Installation + +``` +$ npm install range-parser +``` \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/index.js new file mode 100644 index 00000000..9b0f7a8e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/index.js @@ -0,0 +1,49 @@ + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @return {Array} + * @api public + */ + +module.exports = function(size, str){ + var valid = true; + var i = str.indexOf('='); + + if (-1 == i) return -2; + + var arr = str.slice(i + 1).split(',').map(function(range){ + var range = range.split('-') + , start = parseInt(range[0], 10) + , end = parseInt(range[1], 10); + + // -nnn + if (isNaN(start)) { + start = size - end; + end = size - 1; + // nnn- + } else if (isNaN(end)) { + end = size - 1; + } + + // limit last-byte-pos to current length + if (end > size - 1) end = size - 1; + + // invalid + if (isNaN(start) + || isNaN(end) + || start > end + || start < 0) valid = false; + + return { + start: start, + end: end + }; + }); + + arr.type = str.slice(0, i); + + return valid ? arr : -1; +}; \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/package.json new file mode 100644 index 00000000..e0533cb5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/node_modules/range-parser/package.json @@ -0,0 +1,44 @@ +{ + "name": "range-parser", + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca", + "url": "http://tjholowaychuk.com" + }, + "description": "Range header field string parser", + "version": "0.0.4", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "_id": "range-parser@0.0.4", + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "1.1.19", + "_nodeVersion": "v0.6.16", + "_defaultsLoaded": true, + "dist": { + "shasum": "c0427ffef51c10acba0782a46c9602e744ff620b", + "tarball": "http://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "directories": {}, + "_shasum": "c0427ffef51c10acba0782a46c9602e744ff620b", + "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz", + "_from": "range-parser@0.0.4", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/package.json new file mode 100644 index 00000000..557d28e1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/send/package.json @@ -0,0 +1,59 @@ +{ + "name": "send", + "version": "0.1.4", + "description": "Better streaming static file server with Range and conditional-GET support", + "keywords": [ + "static", + "file", + "server" + ], + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "dependencies": { + "debug": "*", + "mime": "~1.2.9", + "fresh": "0.2.0", + "range-parser": "0.0.4" + }, + "devDependencies": { + "mocha": "*", + "should": "*", + "supertest": "0.0.1", + "connect": "2.x" + }, + "scripts": { + "test": "make test" + }, + "repository": { + "type": "git", + "url": "git://github.com/visionmedia/send.git" + }, + "main": "index", + "bugs": { + "url": "https://github.com/visionmedia/send/issues" + }, + "_id": "send@0.1.4", + "dist": { + "shasum": "be70d8d1be01de61821af13780b50345a4f71abd", + "tarball": "http://registry.npmjs.org/send/-/send-0.1.4.tgz" + }, + "_from": "send@>=0.1.0 <0.2.0", + "_npmVersion": "1.3.4", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "directories": {}, + "_shasum": "be70d8d1be01de61821af13780b50345a4f71abd", + "_resolved": "https://registry.npmjs.org/send/-/send-0.1.4.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/visionmedia/send#readme" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/.npmignore new file mode 100644 index 00000000..39e9864f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/.npmignore @@ -0,0 +1,3 @@ +support +test +examples diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/.travis.yml new file mode 100644 index 00000000..56eca033 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - 0.6 + +notifications: + irc: "irc.freenode.org#socket.io" diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/History.md new file mode 100644 index 00000000..6ae0ecc3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/History.md @@ -0,0 +1,332 @@ + +0.9.17 / 2014-05-22 +=================== + + * use static channels for remote syncing instead of subscribing/unsubscribing 5 channels for every connection + * Use destroy buffer size on websocket transport method as well + * http-polling : adding 'X-XSS-Protection : 0;' to headers necessary not only to jsonp-polling but http-polling + +0.9.16 / 2013-06-06 +=================== + + * transports: added tests for htmlfile escaping/unescaping + +0.9.15 / 2013-06-06 +=================== + + * transports: added escaping to htmlfile (fixes #1251) + +0.9.14 / 2013-03-29 +=================== + + * manager: fix memory leak with SSL [jpallen] + +0.9.13 / 2012-12-13 +=================== + + * package: fixed `base64id` requirement + +0.9.12 / 2012-12-13 +=================== + + * manager: fix for latest node which is returning a clone with `listeners` [viirya] + +0.9.11 / 2012-11-02 +=================== + + * package: move redis to optionalDependenices [3rd-Eden] + * bumped client + +0.9.10 / 2012-08-10 +=================== + + * Don't lowercase log messages + * Always set the HTTP response in case an error should be returned to the client + * Create or destroy the flash policy server on configuration change + * Honour configuration to disable flash policy server + * Add express 3.0 instructions on Readme.md + * Bump client + +0.9.9 / 2012-08-01 +================== + + * Fixed sync disconnect xhrs handling + * Put license text in its own file (#965) + * Add warning to .listen() to ease the migration to Express 3.x + * Restored compatibility with node 0.4.x + +0.9.8 / 2012-07-24 +================== + + * Bumped client. + +0.9.7 / 2012-07-24 +================== + + * Prevent crash when socket leaves a room twice. + * Corrects unsafe usage of for..in + * Fix for node 0.8 with `gzip compression` [vadimi] + * Update redis to support Node 0.8.x + * Made ID generation securely random + * Fix Redis Store race condition in manager onOpen unsubscribe callback + * Fix for EventEmitters always reusing the same Array instance for listeners + +0.9.6 / 2012-04-17 +================== + + * Fixed XSS in jsonp-polling. + +0.9.5 / 2012-04-05 +================== + + * Added test for polling and socket close. + * Ensure close upon request close. + * Fix disconnection reason being lost for polling transports. + * Ensure that polling transports work with Connection: close. + * Log disconnection reason. + +0.9.4 / 2012-04-01 +================== + + * Disconnecting from namespace improvement (#795) [DanielBaulig] + * Bumped client with polling reconnection loop (#438) + +0.9.3 / 2012-03-28 +================== + + * Fix "Syntax error" on FF Web Console with XHR Polling [mikito] + +0.9.2 / 2012-03-13 +================== + + * More sensible close `timeout default` (fixes disconnect issue) + +0.9.1-1 / 2012-03-02 +==================== + + * Bumped client with NPM dependency fix. + +0.9.1 / 2012-03-02 +================== + + * Changed heartbeat timeout and interval defaults (60 and 25 seconds) + * Make tests work both on 0.4 and 0.6 + * Updated client (improvements + bug fixes). + +0.9.0 / 2012-02-26 +================== + + * Make it possible to use a regexp to match the socket.io resource URL. + We need this because we have to prefix the socket.io URL with a variable ID. + * Supplemental fix to gavinuhma/authfix, it looks like the same Access-Control-Origin logic is needed in the http and xhr-polling transports + * Updated express dep for windows compatibility. + * Combine two substr calls into one in decodePayload to improve performance + * Minor documentation fix + * Minor. Conform to style of other files. + * Switching setting to 'match origin protocol' + * Revert "Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect()." + * Revert "Handle leaked dispatch:[id] subscription." + * Merge pull request #667 from dshaw/patch/redis-disconnect + * Handle leaked dispatch:[id] subscription. + * Fixes leaking Redis subscriptions for #663. The local flag was not getting passed through onClientDisconnect(). + * Prevent memory leaking on uncompleted requests & add max post size limitation + * Fix for testcase + * Set Access-Control-Allow-Credentials true, regardless of cookie + * Remove assertvarnish from package as it breaks on 0.6 + * Correct irc channel + * Added proper return after reserved field error + * Fixes manager.js failure to close connection after transport error has happened + * Added implicit port 80 for origin checks. fixes #638 + * Fixed bug #432 in 0.8.7 + * Set Access-Control-Allow-Origin header to origin to enable withCredentials + * Adding configuration variable matchOriginProtocol + * Fixes location mismatch error in Safari. + * Use tty to detect if we should add colors or not by default. + * Updated the package location. + +0.8.7 / 2011-11-05 +================== + + * Fixed memory leaks in closed clients. + * Fixed memory leaks in namespaces. + * Fixed websocket handling for malformed requests from proxies. [einaros] + * Node 0.6 compatibility. [einaros] [3rd-Eden] + * Adapted tests and examples. + +0.8.6 / 2011-10-27 +================== + + * Added JSON decoding on jsonp-polling transport. + * Fixed README example. + * Major speed optimizations [3rd-Eden] [einaros] [visionmedia] + * Added decode/encode benchmarks [visionmedia] + * Added support for black-listing client sent events. + * Fixed logging options, closes #540 [3rd-Eden] + * Added vary header for gzip [3rd-Eden] + * Properly cleaned up async websocket / flashsocket tests, after patching node-websocket-client + * Patched to properly shut down when a finishClose call is made during connection establishment + * Added support for socket.io version on url and far-future Expires [3rd-Eden] [getify] + * Began IE10 compatibility [einaros] [tbranyen] + * Misc WebSocket fixes [einaros] + * Added UTF8 to respone headers for htmlfile [3rd-Eden] + +0.8.5 / 2011-10-07 +================== + + * Added websocket draft HyBi-16 support. [einaros] + * Fixed websocket continuation bugs. [einaros] + * Fixed flashsocket transport name. + * Fixed websocket tests. + * Ensured `parser#decodePayload` doesn't choke. + * Added http referrer verification to manager verifyOrigin. + * Added access control for cross domain xhr handshakes [3rd-Eden] + * Added support for automatic generation of socket.io files [3rd-Eden] + * Added websocket binary support [einaros] + * Added gzip support for socket.io.js [3rd-Eden] + * Expose socket.transport [3rd-Eden] + * Updated client. + +0.8.4 / 2011-09-06 +================== + + * Client build + +0.8.3 / 2011-09-03 +================== + + * Fixed `\n` parsing for non-JSON packets (fixes #479). + * Fixed parsing of certain unicode characters (fixes #451). + * Fixed transport message packet logging. + * Fixed emission of `error` event resulting in an uncaught exception if unhandled (fixes #476). + * Fixed; allow for falsy values as the configuration value of `log level` (fixes #491). + * Fixed repository URI in `package.json`. Fixes #504. + * Added text/plain content-type to handshake responses [einaros] + * Improved single byte writes [einaros] + * Updated socket.io-flashsocket default port from 843 to 10843 [3rd-Eden] + * Updated client. + +0.8.2 / 2011-08-29 +================== + + * Updated client. + +0.8.1 / 2011-08-29 +================== + + * Fixed utf8 bug in send framing in websocket [einaros] + * Fixed typo in docs [Znarkus] + * Fixed bug in send framing for over 64kB of data in websocket [einaros] + * Corrected ping handling in websocket transport [einaros] + +0.8.0 / 2011-08-28 +================== + + * Updated to work with two-level websocket versioning. [einaros] + * Added hybi07 support. [einaros] + * Added hybi10 support. [einaros] + * Added http referrer verification to manager.js verifyOrigin. [einaors] + +0.7.11 / 2011-08-27 +=================== + + * Updated socket.io-client. + +0.7.10 / 2011-08-27 +=================== + + * Updated socket.io-client. + +0.7.9 / 2011-08-12 +================== + + * Updated socket.io-client. + * Make sure we only do garbage collection when the server we receive is actually run. + +0.7.8 / 2011-08-08 +================== + + * Changed; make sure sio#listen passes options to both HTTP server and socket.io manager. + * Added docs for sio#listen. + * Added options parameter support for Manager constructor. + * Added memory leaks tests and test-leaks Makefile task. + * Removed auto npm-linking from make test. + * Make sure that you can disable heartbeats. [3rd-Eden] + * Fixed rooms memory leak [3rd-Eden] + * Send response once we got all POST data, not immediately [Pita] + * Fixed onLeave behavior with missing clientsk [3rd-Eden] + * Prevent duplicate references in rooms. + * Added alias for `to` to `in` and `in` to `to`. + * Fixed roomClients definition. + * Removed dependency on redis for installation without npm [3rd-Eden] + * Expose path and querystring in handshakeData [3rd-Eden] + +0.7.7 / 2011-07-12 +================== + + * Fixed double dispatch handling with emit to closed clients. + * Added test for emitting to closed clients to prevent regression. + * Fixed race condition in redis test. + * Changed Transport#end instrumentation. + * Leveraged $emit instead of emit internally. + * Made tests faster. + * Fixed double disconnect events. + * Fixed disconnect logic + * Simplified remote events handling in Socket. + * Increased testcase timeout. + * Fixed unknown room emitting (GH-291). [3rd-Eden] + * Fixed `address` in handshakeData. [3rd-Eden] + * Removed transports definition in chat example. + * Fixed room cleanup + * Fixed; make sure the client is cleaned up after booting. + * Make sure to mark the client as non-open if the connection is closed. + * Removed unneeded `buffer` declarations. + * Fixed; make sure to clear socket handlers and subscriptions upon transport close. + +0.7.6 / 2011-06-30 +================== + + * Fixed general dispatching when a client has closed. + +0.7.5 / 2011-06-30 +================== + + * Fixed dispatching to clients that are disconnected. + +0.7.4 / 2011-06-30 +================== + + * Fixed; only clear handlers if they were set. [level09] + +0.7.3 / 2011-06-30 +================== + + * Exposed handshake data to clients. + * Refactored dispatcher interface. + * Changed; Moved id generation method into the manager. + * Added sub-namespace authorization. [3rd-Eden] + * Changed; normalized SocketNamespace local eventing [dvv] + * Changed; Use packet.reason or default to 'packet' [3rd-Eden] + * Changed console.error to console.log. + * Fixed; bind both servers at the same time do that the test never times out. + * Added 304 support. + * Removed `Transport#name` for abstract interface. + * Changed; lazily require http and https module only when needed. [3rd-Eden] + +0.7.2 / 2011-06-22 +================== + + * Make sure to write a packet (of type `noop`) when closing a poll. + This solves a problem with cross-domain requests being flagged as aborted and + reconnection being triggered. + * Added `noop` message type. + +0.7.1 / 2011-06-21 +================== + + * Fixed cross-domain XHR. + * Added CORS test to xhr-polling suite. + +0.7.0 / 2010-06-21 +================== + + * http://socket.io/announcement.html diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/LICENSE new file mode 100644 index 00000000..0f4acd44 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2011 Guillermo Rauch + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/Makefile new file mode 100644 index 00000000..832cba8b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/Makefile @@ -0,0 +1,31 @@ + +ALL_TESTS = $(shell find test/ -name '*.test.js') +ALL_BENCH = $(shell find benchmarks -name '*.bench.js') + +run-tests: + @./node_modules/.bin/expresso \ + -t 3000 \ + -I support \ + --serial \ + $(TESTFLAGS) \ + $(TESTS) + +test: + @$(MAKE) NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests + +test-cov: + @TESTFLAGS=--cov $(MAKE) test + +test-leaks: + @ls test/leaks/* | xargs node --expose_debug_as=debug --expose_gc + +run-bench: + @node $(PROFILEFLAGS) benchmarks/runner.js + +bench: + @$(MAKE) BENCHMARKS="$(ALL_BENCH)" run-bench + +profile: + @PROFILEFLAGS='--prof --trace-opt --trace-bailout --trace-deopt' $(MAKE) bench + +.PHONY: test bench profile diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/Readme.md new file mode 100644 index 00000000..41f21f68 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/Readme.md @@ -0,0 +1,364 @@ +# Socket.IO + +Socket.IO is a Node.JS project that makes WebSockets and realtime possible in +all browsers. It also enhances WebSockets by providing built-in multiplexing, +horizontal scalability, automatic JSON encoding/decoding, and more. + +## How to Install + +```bash +npm install socket.io +``` + +## How to use + +First, require `socket.io`: + +```js +var io = require('socket.io'); +``` + +Next, attach it to a HTTP/HTTPS server. If you're using the fantastic `express` +web framework: + +#### Express 3.x + +```js +var app = express() + , server = require('http').createServer(app) + , io = io.listen(server); + +server.listen(80); + +io.sockets.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data) { + console.log(data); + }); +}); +``` + +#### Express 2.x + +```js +var app = express.createServer() + , io = io.listen(app); + +app.listen(80); + +io.sockets.on('connection', function (socket) { + socket.emit('news', { hello: 'world' }); + socket.on('my other event', function (data) { + console.log(data); + }); +}); +``` + +Finally, load it from the client side code: + +```html + + +``` + +For more thorough examples, look at the `examples/` directory. + +## Short recipes + +### Sending and receiving events. + +Socket.IO allows you to emit and receive custom events. +Besides `connect`, `message` and `disconnect`, you can emit custom events: + +```js +// note, io.listen() will create a http server for you +var io = require('socket.io').listen(80); + +io.sockets.on('connection', function (socket) { + io.sockets.emit('this', { will: 'be received by everyone' }); + + socket.on('private message', function (from, msg) { + console.log('I received a private message by ', from, ' saying ', msg); + }); + + socket.on('disconnect', function () { + io.sockets.emit('user disconnected'); + }); +}); +``` + +### Storing data associated to a client + +Sometimes it's necessary to store data associated with a client that's +necessary for the duration of the session. + +#### Server side + +```js +var io = require('socket.io').listen(80); + +io.sockets.on('connection', function (socket) { + socket.on('set nickname', function (name) { + socket.set('nickname', name, function () { socket.emit('ready'); }); + }); + + socket.on('msg', function () { + socket.get('nickname', function (err, name) { + console.log('Chat message by ', name); + }); + }); +}); +``` + +#### Client side + +```html + +``` + +### Restricting yourself to a namespace + +If you have control over all the messages and events emitted for a particular +application, using the default `/` namespace works. + +If you want to leverage 3rd-party code, or produce code to share with others, +socket.io provides a way of namespacing a `socket`. + +This has the benefit of `multiplexing` a single connection. Instead of +socket.io using two `WebSocket` connections, it'll use one. + +The following example defines a socket that listens on '/chat' and one for +'/news': + +#### Server side + +```js +var io = require('socket.io').listen(80); + +var chat = io + .of('/chat') + .on('connection', function (socket) { + socket.emit('a message', { that: 'only', '/chat': 'will get' }); + chat.emit('a message', { everyone: 'in', '/chat': 'will get' }); + }); + +var news = io + .of('/news'); + .on('connection', function (socket) { + socket.emit('item', { news: 'item' }); + }); +``` + +#### Client side: + +```html + +``` + +### Sending volatile messages. + +Sometimes certain messages can be dropped. Let's say you have an app that +shows realtime tweets for the keyword `bieber`. + +If a certain client is not ready to receive messages (because of network slowness +or other issues, or because he's connected through long polling and is in the +middle of a request-response cycle), if he doesn't receive ALL the tweets related +to bieber your application won't suffer. + +In that case, you might want to send those messages as volatile messages. + +#### Server side + +```js +var io = require('socket.io').listen(80); + +io.sockets.on('connection', function (socket) { + var tweets = setInterval(function () { + getBieberTweet(function (tweet) { + socket.volatile.emit('bieber tweet', tweet); + }); + }, 100); + + socket.on('disconnect', function () { + clearInterval(tweets); + }); +}); +``` + +#### Client side + +In the client side, messages are received the same way whether they're volatile +or not. + +### Getting acknowledgements + +Sometimes, you might want to get a callback when the client confirmed the message +reception. + +To do this, simply pass a function as the last parameter of `.send` or `.emit`. +What's more, when you use `.emit`, the acknowledgement is done by you, which +means you can also pass data along: + +#### Server side + +```js +var io = require('socket.io').listen(80); + +io.sockets.on('connection', function (socket) { + socket.on('ferret', function (name, fn) { + fn('woot'); + }); +}); +``` + +#### Client side + +```html + +``` + +### Broadcasting messages + +To broadcast, simply add a `broadcast` flag to `emit` and `send` method calls. +Broadcasting means sending a message to everyone else except for the socket +that starts it. + +#### Server side + +```js +var io = require('socket.io').listen(80); + +io.sockets.on('connection', function (socket) { + socket.broadcast.emit('user connected'); + socket.broadcast.json.send({ a: 'message' }); +}); +``` + +### Rooms + +Sometimes you want to put certain sockets in the same room, so that it's easy +to broadcast to all of them together. + +Think of this as built-in channels for sockets. Sockets `join` and `leave` +rooms in each socket. + +#### Server side + +```js +var io = require('socket.io').listen(80); + +io.sockets.on('connection', function (socket) { + socket.join('justin bieber fans'); + socket.broadcast.to('justin bieber fans').emit('new fan'); + io.sockets.in('rammstein fans').emit('new non-fan'); +}); +``` + +### Using it just as a cross-browser WebSocket + +If you just want the WebSocket semantics, you can do that too. +Simply leverage `send` and listen on the `message` event: + +#### Server side + +```js +var io = require('socket.io').listen(80); + +io.sockets.on('connection', function (socket) { + socket.on('message', function () { }); + socket.on('disconnect', function () { }); +}); +``` + +#### Client side + +```html + +``` + +### Changing configuration + +Configuration in socket.io is TJ-style: + +#### Server side + +```js +var io = require('socket.io').listen(80); + +io.configure(function () { + io.set('transports', ['websocket', 'flashsocket', 'xhr-polling']); +}); + +io.configure('development', function () { + io.set('transports', ['websocket', 'xhr-polling']); + io.enable('log'); +}); +``` + +## License + +(The MIT License) + +Copyright (c) 2011 Guillermo Rauch <guillermo@learnboost.com> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/decode.bench.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/decode.bench.js new file mode 100644 index 00000000..4855d805 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/decode.bench.js @@ -0,0 +1,64 @@ + +/** + * Module dependencies. + */ + +var benchmark = require('benchmark') + , colors = require('colors') + , io = require('../') + , parser = io.parser + , suite = new benchmark.Suite('Decode packet'); + +suite.add('string', function () { + parser.decodePacket('4:::"2"'); +}); + +suite.add('event', function () { + parser.decodePacket('5:::{"name":"woot"}'); +}); + +suite.add('event+ack', function () { + parser.decodePacket('5:1+::{"name":"tobi"}'); +}); + +suite.add('event+data', function () { + parser.decodePacket('5:::{"name":"edwald","args":[{"a": "b"},2,"3"]}'); +}); + +suite.add('heartbeat', function () { + parser.decodePacket('2:::'); +}); + +suite.add('error', function () { + parser.decodePacket('7:::2+0'); +}); + +var payload = parser.encodePayload([ + parser.encodePacket({ type: 'message', data: '5', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: '53d', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobar', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobarbaz', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobarbazfoobarbaz', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobarbaz', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobar', endpoint: '' }) +]); + +suite.add('payload', function () { + parser.decodePayload(payload); +}); + +suite.on('cycle', function (bench, details) { + console.log('\n' + suite.name.grey, details.name.white.bold); + console.log([ + details.hz.toFixed(2).cyan + ' ops/sec'.grey + , details.count.toString().white + ' times executed'.grey + , 'benchmark took '.grey + details.times.elapsed.toString().white + ' sec.'.grey + , + ].join(', '.grey)); +}); + +if (!module.parent) { + suite.run(); +} else { + module.exports = suite; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/encode.bench.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/encode.bench.js new file mode 100644 index 00000000..5037702d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/encode.bench.js @@ -0,0 +1,90 @@ + +/** + * Module dependencies. + */ + +var benchmark = require('benchmark') + , colors = require('colors') + , io = require('../') + , parser = io.parser + , suite = new benchmark.Suite('Encode packet'); + +suite.add('string', function () { + parser.encodePacket({ + type: 'json' + , endpoint: '' + , data: '2' + }); +}); + +suite.add('event', function () { + parser.encodePacket({ + type: 'event' + , name: 'woot' + , endpoint: '' + , args: [] + }); +}); + +suite.add('event+ack', function () { + parser.encodePacket({ + type: 'json' + , id: 1 + , ack: 'data' + , endpoint: '' + , data: { a: 'b' } + }); +}); + +suite.add('event+data', function () { + parser.encodePacket({ + type: 'event' + , name: 'edwald' + , endpoint: '' + , args: [{a: 'b'}, 2, '3'] + }); +}); + +suite.add('heartbeat', function () { + parser.encodePacket({ + type: 'heartbeat' + , endpoint: '' + }) +}); + +suite.add('error', function () { + parser.encodePacket({ + type: 'error' + , reason: 'unauthorized' + , advice: 'reconnect' + , endpoint: '' + }) +}) + +suite.add('payload', function () { + parser.encodePayload([ + parser.encodePacket({ type: 'message', data: '5', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: '53d', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobar', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobarbaz', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobarbazfoobarbaz', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobarbaz', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: 'foobar', endpoint: '' }) + ]); +}); + +suite.on('cycle', function (bench, details) { + console.log('\n' + suite.name.grey, details.name.white.bold); + console.log([ + details.hz.toFixed(2).cyan + ' ops/sec'.grey + , details.count.toString().white + ' times executed'.grey + , 'benchmark took '.grey + details.times.elapsed.toString().white + ' sec.'.grey + , + ].join(', '.grey)); +}); + +if (!module.parent) { + suite.run(); +} else { + module.exports = suite; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/runner.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/runner.js new file mode 100644 index 00000000..81e55cae --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/benchmarks/runner.js @@ -0,0 +1,55 @@ +/** + * Benchmark runner dependencies + */ + +var colors = require('colors') + , path = require('path'); + +/** + * Find all the benchmarks + */ + +var benchmarks_files = process.env.BENCHMARKS.split(' ') + , all = [].concat(benchmarks_files) + , first = all.shift() + , benchmarks = {}; + +// find the benchmarks and load them all in our obj +benchmarks_files.forEach(function (file) { + benchmarks[file] = require(path.join(__dirname, '..', file)); +}); + +// setup the complete listeners +benchmarks_files.forEach(function (file) { + var benchmark = benchmarks[file] + , next_file = all.shift() + , next = benchmarks[next_file]; + + /** + * Generate a oncomplete function for the tests, either we are done or we + * have more benchmarks to process. + */ + + function complete () { + if (!next) { + console.log( + '\n\nBenchmark completed in'.grey + , (Date.now() - start).toString().green + ' ms'.grey + ); + } else { + console.log('\nStarting benchmark '.grey + next_file.yellow); + next.run(); + } + } + + // attach the listener + benchmark.on('complete', complete); +}); + +/** + * Start the benchmark + */ + +var start = Date.now(); +console.log('Starting benchmark '.grey + first.yellow); +benchmarks[first].run(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/index.js new file mode 100644 index 00000000..cc00c103 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/index.js @@ -0,0 +1,8 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +module.exports = require('./lib/socket.io'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/latest b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/latest new file mode 100755 index 00000000..a1001932 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/latest @@ -0,0 +1,2 @@ +#!/usr/bin/env bash +npm tag socket.io@0.9.16 latest diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/logger.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/logger.js new file mode 100644 index 00000000..49d02c98 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/logger.js @@ -0,0 +1,97 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var util = require('./util') + , toArray = util.toArray; + +/** + * Log levels. + */ + +var levels = [ + 'error' + , 'warn' + , 'info' + , 'debug' +]; + +/** + * Colors for log levels. + */ + +var colors = [ + 31 + , 33 + , 36 + , 90 +]; + +/** + * Pads the nice output to the longest log level. + */ + +function pad (str) { + var max = 0; + + for (var i = 0, l = levels.length; i < l; i++) + max = Math.max(max, levels[i].length); + + if (str.length < max) + return str + new Array(max - str.length + 1).join(' '); + + return str; +}; + +/** + * Logger (console). + * + * @api public + */ + +var Logger = module.exports = function (opts) { + opts = opts || {} + this.colors = false !== opts.colors; + this.level = 3; + this.enabled = true; +}; + +/** + * Log method. + * + * @api public + */ + +Logger.prototype.log = function (type) { + var index = levels.indexOf(type); + + if (index > this.level || !this.enabled) + return this; + + console.log.apply( + console + , [this.colors + ? ' \033[' + colors[index] + 'm' + pad(type) + ' -\033[39m' + : type + ':' + ].concat(toArray(arguments).slice(1)) + ); + + return this; +}; + +/** + * Generate methods. + */ + +levels.forEach(function (name) { + Logger.prototype[name] = function () { + this.log.apply(this, [name].concat(toArray(arguments))); + }; +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/manager.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/manager.js new file mode 100644 index 00000000..17ed9e4e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/manager.js @@ -0,0 +1,1042 @@ +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var fs = require('fs') + , url = require('url') + , tty = require('tty') + , crypto = require('crypto') + , util = require('./util') + , store = require('./store') + , client = require('socket.io-client') + , transports = require('./transports') + , Logger = require('./logger') + , Socket = require('./socket') + , MemoryStore = require('./stores/memory') + , SocketNamespace = require('./namespace') + , Static = require('./static') + , EventEmitter = process.EventEmitter; + +/** + * Export the constructor. + */ + +exports = module.exports = Manager; + +/** + * Default transports. + */ + +var defaultTransports = exports.defaultTransports = [ + 'websocket' + , 'htmlfile' + , 'xhr-polling' + , 'jsonp-polling' +]; + +/** + * Inherited defaults. + */ + +var parent = module.parent.exports + , protocol = parent.protocol + , jsonpolling_re = /^\d+$/; + +/** + * Manager constructor. + * + * @param {HTTPServer} server + * @param {Object} options, optional + * @api public + */ + +function Manager (server, options) { + this.server = server; + this.namespaces = {}; + this.sockets = this.of(''); + this.settings = { + origins: '*:*' + , log: true + , store: new MemoryStore + , logger: new Logger + , static: new Static(this) + , heartbeats: true + , resource: '/socket.io' + , transports: defaultTransports + , authorization: false + , blacklist: ['disconnect'] + , 'log level': 3 + , 'log colors': tty.isatty(process.stdout.fd) + , 'close timeout': 60 + , 'heartbeat interval': 25 + , 'heartbeat timeout': 60 + , 'polling duration': 20 + , 'flash policy server': true + , 'flash policy port': 10843 + , 'destroy upgrade': true + , 'destroy buffer size': 10E7 + , 'browser client': true + , 'browser client cache': true + , 'browser client minification': false + , 'browser client etag': false + , 'browser client expires': 315360000 + , 'browser client gzip': false + , 'browser client handler': false + , 'client store expiration': 15 + , 'match origin protocol': false + }; + + for (var i in options) { + if (options.hasOwnProperty(i)) { + this.settings[i] = options[i]; + } + } + + var self = this; + + // default error handler + server.on('error', function(err) { + self.log.warn('error raised: ' + err); + }); + + this.initStore(); + + this.on('set:store', function() { + self.initStore(); + }); + + // reset listeners + this.oldListeners = server.listeners('request').splice(0); + server.removeAllListeners('request'); + + server.on('request', function (req, res) { + self.handleRequest(req, res); + }); + + server.on('upgrade', function (req, socket, head) { + self.handleUpgrade(req, socket, head); + }); + + server.on('close', function () { + clearInterval(self.gc); + }); + + server.once('listening', function () { + self.gc = setInterval(self.garbageCollection.bind(self), 10000); + }); + + for (var i in transports) { + if (transports.hasOwnProperty(i)) { + if (transports[i].init) { + transports[i].init(this); + } + } + } + + // forward-compatibility with 1.0 + var self = this; + this.sockets.on('connection', function (conn) { + self.emit('connection', conn); + }); + + this.sequenceNumber = Date.now() | 0; + + this.log.info('socket.io started'); +}; + +Manager.prototype.__proto__ = EventEmitter.prototype + +/** + * Store accessor shortcut. + * + * @api public + */ + +Manager.prototype.__defineGetter__('store', function () { + var store = this.get('store'); + store.manager = this; + return store; +}); + +/** + * Logger accessor. + * + * @api public + */ + +Manager.prototype.__defineGetter__('log', function () { + var logger = this.get('logger'); + + logger.level = this.get('log level') || -1; + logger.colors = this.get('log colors'); + logger.enabled = this.enabled('log'); + + return logger; +}); + +/** + * Static accessor. + * + * @api public + */ + +Manager.prototype.__defineGetter__('static', function () { + return this.get('static'); +}); + +/** + * Get settings. + * + * @api public + */ + +Manager.prototype.get = function (key) { + return this.settings[key]; +}; + +/** + * Set settings + * + * @api public + */ + +Manager.prototype.set = function (key, value) { + if (arguments.length == 1) return this.get(key); + this.settings[key] = value; + this.emit('set:' + key, this.settings[key], key); + return this; +}; + +/** + * Enable a setting + * + * @api public + */ + +Manager.prototype.enable = function (key) { + this.settings[key] = true; + this.emit('set:' + key, this.settings[key], key); + return this; +}; + +/** + * Disable a setting + * + * @api public + */ + +Manager.prototype.disable = function (key) { + this.settings[key] = false; + this.emit('set:' + key, this.settings[key], key); + return this; +}; + +/** + * Checks if a setting is enabled + * + * @api public + */ + +Manager.prototype.enabled = function (key) { + return !!this.settings[key]; +}; + +/** + * Checks if a setting is disabled + * + * @api public + */ + +Manager.prototype.disabled = function (key) { + return !this.settings[key]; +}; + +/** + * Configure callbacks. + * + * @api public + */ + +Manager.prototype.configure = function (env, fn) { + if ('function' == typeof env) { + env.call(this); + } else if (env == (process.env.NODE_ENV || 'development')) { + fn.call(this); + } + + return this; +}; + +/** + * Initializes everything related to the message dispatcher. + * + * @api private + */ + +Manager.prototype.initStore = function () { + this.handshaken = {}; + this.connected = {}; + this.open = {}; + this.closed = {}; + this.rooms = {}; + this.roomClients = {}; + + var self = this; + + this.store.subscribe('handshake', function (id, data) { + self.onHandshake(id, data); + }); + + this.store.subscribe('connect', function (id) { + self.onConnect(id); + }); + + this.store.subscribe('open', function (id) { + self.onOpen(id); + }); + + this.store.subscribe('join', function (id, room) { + self.onJoin(id, room); + }); + + this.store.subscribe('leave', function (id, room) { + self.onLeave(id, room); + }); + + this.store.subscribe('close', function (id) { + self.onClose(id); + }); + + this.store.subscribe('dispatch', function (room, packet, volatile, exceptions) { + self.onDispatch(room, packet, volatile, exceptions); + }); + + this.store.subscribe('disconnect', function (id) { + self.onDisconnect(id); + }); + + // we need to do this in a pub/sub way since the client can POST the message + // over a different socket (ie: different Transport instance) + + //use persistent channel for these, don't add and remove 5 channels for every connection + //eg. for 10,000 concurrent users this creates 50,000 channels in redis, which kind of slows things down + //we only need 5 (extra) total channels at all times + this.store.subscribe('message-remote',function (id, packet) { + self.onClientMessage(id, packet); + }); + + this.store.subscribe('disconnect-remote', function (id, reason) { + self.onClientDisconnect(id, reason); + }); + + this.store.subscribe('dispatch-remote', function (id, packet, volatile) { + var transport = self.transports[id]; + if (transport) { + transport.onDispatch(packet, volatile); + } + + if (!volatile) { + self.onClientDispatch(id, packet); + } + }); + + this.store.subscribe('heartbeat-clear', function (id) { + var transport = self.transports[id]; + if (transport) { + transport.onHeartbeatClear(); + } + }); + + this.store.subscribe('disconnect-force', function (id) { + var transport = self.transports[id]; + if (transport) { + transport.onForcedDisconnect(); + } + }); +}; +/** + * Called when a client handshakes. + * + * @param text + */ + +Manager.prototype.onHandshake = function (id, data) { + this.handshaken[id] = data; +}; + +/** + * Called when a client connects (ie: transport first opens) + * + * @api private + */ + +Manager.prototype.onConnect = function (id) { + this.connected[id] = true; +}; + +/** + * Called when a client opens a request in a different node. + * + * @api private + */ + +Manager.prototype.onOpen = function (id) { + this.open[id] = true; + + if (this.closed[id]) { + var self = this; + + var transport = self.transports[id]; + if (self.closed[id] && self.closed[id].length && transport) { + + // if we have buffered messages that accumulate between calling + // onOpen an this async callback, send them if the transport is + // still open, otherwise leave them buffered + if (transport.open) { + transport.payload(self.closed[id]); + self.closed[id] = []; + } + } + } + + // clear the current transport + if (this.transports[id]) { + this.transports[id].discard(); + this.transports[id] = null; + } +}; + +/** + * Called when a message is sent to a namespace and/or room. + * + * @api private + */ + +Manager.prototype.onDispatch = function (room, packet, volatile, exceptions) { + if (this.rooms[room]) { + for (var i = 0, l = this.rooms[room].length; i < l; i++) { + var id = this.rooms[room][i]; + + if (!~exceptions.indexOf(id)) { + if (this.transports[id] && this.transports[id].open) { + this.transports[id].onDispatch(packet, volatile); + } else if (!volatile) { + this.onClientDispatch(id, packet); + } + } + } + } +}; + +/** + * Called when a client joins a nsp / room. + * + * @api private + */ + +Manager.prototype.onJoin = function (id, name) { + if (!this.roomClients[id]) { + this.roomClients[id] = {}; + } + + if (!this.rooms[name]) { + this.rooms[name] = []; + } + + if (!~this.rooms[name].indexOf(id)) { + this.rooms[name].push(id); + this.roomClients[id][name] = true; + } +}; + +/** + * Called when a client leaves a nsp / room. + * + * @param private + */ + +Manager.prototype.onLeave = function (id, room) { + if (this.rooms[room]) { + var index = this.rooms[room].indexOf(id); + + if (index >= 0) { + this.rooms[room].splice(index, 1); + } + + if (!this.rooms[room].length) { + delete this.rooms[room]; + } + + if (this.roomClients[id]) { + delete this.roomClients[id][room]; + } + } +}; + +/** + * Called when a client closes a request in different node. + * + * @api private + */ + +Manager.prototype.onClose = function (id) { + if (this.open[id]) { + delete this.open[id]; + } + + this.closed[id] = []; + + var self = this; +}; + +/** + * Dispatches a message for a closed client. + * + * @api private + */ + +Manager.prototype.onClientDispatch = function (id, packet) { + if (this.closed[id]) { + this.closed[id].push(packet); + } +}; + +/** + * Receives a message for a client. + * + * @api private + */ + +Manager.prototype.onClientMessage = function (id, packet) { + if (this.namespaces[packet.endpoint]) { + this.namespaces[packet.endpoint].handlePacket(id, packet); + } +}; + +/** + * Fired when a client disconnects (not triggered). + * + * @api private + */ + +Manager.prototype.onClientDisconnect = function (id, reason) { + for (var name in this.namespaces) { + if (this.namespaces.hasOwnProperty(name)) { + this.namespaces[name].handleDisconnect(id, reason, typeof this.roomClients[id] !== 'undefined' && + typeof this.roomClients[id][name] !== 'undefined'); + } + } + + this.onDisconnect(id); +}; + +/** + * Called when a client disconnects. + * + * @param text + */ + +Manager.prototype.onDisconnect = function (id) { + delete this.handshaken[id]; + + if (this.open[id]) { + delete this.open[id]; + } + + if (this.connected[id]) { + delete this.connected[id]; + } + + if (this.transports[id]) { + this.transports[id].discard(); + delete this.transports[id]; + } + + if (this.closed[id]) { + delete this.closed[id]; + } + + if (this.roomClients[id]) { + for (var room in this.roomClients[id]) { + if (this.roomClients[id].hasOwnProperty(room)) { + this.onLeave(id, room); + } + } + delete this.roomClients[id] + } + + this.store.destroyClient(id, this.get('client store expiration')); +}; + +/** + * Handles an HTTP request. + * + * @api private + */ + +Manager.prototype.handleRequest = function (req, res) { + var data = this.checkRequest(req); + + if (!data) { + for (var i = 0, l = this.oldListeners.length; i < l; i++) { + this.oldListeners[i].call(this.server, req, res); + } + + return; + } + + if (data.static || !data.transport && !data.protocol) { + if (data.static && this.enabled('browser client')) { + this.static.write(data.path, req, res); + } else { + res.writeHead(200); + res.end('Welcome to socket.io.'); + + this.log.info('unhandled socket.io url'); + } + + return; + } + + if (data.protocol != protocol) { + res.writeHead(500); + res.end('Protocol version not supported.'); + + this.log.info('client protocol version unsupported'); + } else { + if (data.id) { + this.handleHTTPRequest(data, req, res); + } else { + this.handleHandshake(data, req, res); + } + } +}; + +/** + * Handles an HTTP Upgrade. + * + * @api private + */ + +Manager.prototype.handleUpgrade = function (req, socket, head) { + var data = this.checkRequest(req) + , self = this; + + if (!data) { + if (this.enabled('destroy upgrade')) { + socket.end(); + this.log.debug('destroying non-socket.io upgrade'); + } + + return; + } + + req.head = head; + this.handleClient(data, req); + req.head = null; +}; + +/** + * Handles a normal handshaken HTTP request (eg: long-polling) + * + * @api private + */ + +Manager.prototype.handleHTTPRequest = function (data, req, res) { + req.res = res; + this.handleClient(data, req); +}; + +/** + * Intantiantes a new client. + * + * @api private + */ + +Manager.prototype.handleClient = function (data, req) { + var socket = req.socket + , store = this.store + , self = this; + + // handle sync disconnect xhrs + if (undefined != data.query.disconnect) { + if (this.transports[data.id] && this.transports[data.id].open) { + this.transports[data.id].onForcedDisconnect(); + } else { + this.store.publish('disconnect-force', data.id); + } + req.res.writeHead(200); + req.res.end(); + return; + } + + if (!~this.get('transports').indexOf(data.transport)) { + this.log.warn('unknown transport: "' + data.transport + '"'); + req.connection.end(); + return; + } + + var transport = new transports[data.transport](this, data, req) + , handshaken = this.handshaken[data.id]; + + if (transport.disconnected) { + // failed during transport setup + req.connection.end(); + return; + } + if (handshaken) { + if (transport.open) { + if (this.closed[data.id] && this.closed[data.id].length) { + transport.payload(this.closed[data.id]); + this.closed[data.id] = []; + } + + this.onOpen(data.id); + this.store.publish('open', data.id); + this.transports[data.id] = transport; + } + + if (!this.connected[data.id]) { + this.onConnect(data.id); + this.store.publish('connect', data.id); + + // flag as used + delete handshaken.issued; + this.onHandshake(data.id, handshaken); + this.store.publish('handshake', data.id, handshaken); + + // initialize the socket for all namespaces + for (var i in this.namespaces) { + if (this.namespaces.hasOwnProperty(i)) { + var socket = this.namespaces[i].socket(data.id, true); + + // echo back connect packet and fire connection event + if (i === '') { + this.namespaces[i].handlePacket(data.id, { type: 'connect' }); + } + } + } + } + } else { + if (transport.open) { + transport.error('client not handshaken', 'reconnect'); + } + + transport.discard(); + } +}; + +/** + * Generates a session id. + * + * @api private + */ + +Manager.prototype.generateId = function () { + var rand = new Buffer(15); // multiple of 3 for base64 + if (!rand.writeInt32BE) { + return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString() + + Math.abs(Math.random() * Math.random() * Date.now() | 0).toString(); + } + this.sequenceNumber = (this.sequenceNumber + 1) | 0; + rand.writeInt32BE(this.sequenceNumber, 11); + if (crypto.randomBytes) { + crypto.randomBytes(12).copy(rand); + } else { + // not secure for node 0.4 + [0, 4, 8].forEach(function(i) { + rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i); + }); + } + return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-'); +}; + +/** + * Handles a handshake request. + * + * @api private + */ + +Manager.prototype.handleHandshake = function (data, req, res) { + var self = this + , origin = req.headers.origin + , headers = { + 'Content-Type': 'text/plain' + }; + + function writeErr (status, message) { + if (data.query.jsonp && jsonpolling_re.test(data.query.jsonp)) { + res.writeHead(200, { 'Content-Type': 'application/javascript' }); + res.end('io.j[' + data.query.jsonp + '](new Error("' + message + '"));'); + } else { + res.writeHead(status, headers); + res.end(message); + } + }; + + function error (err) { + writeErr(500, 'handshake error'); + self.log.warn('handshake error ' + err); + }; + + if (!this.verifyOrigin(req)) { + writeErr(403, 'handshake bad origin'); + return; + } + + var handshakeData = this.handshakeData(data); + + if (origin) { + // https://developer.mozilla.org/En/HTTP_Access_Control + headers['Access-Control-Allow-Origin'] = origin; + headers['Access-Control-Allow-Credentials'] = 'true'; + } + + this.authorize(handshakeData, function (err, authorized, newData) { + if (err) return error(err); + + if (authorized) { + var id = self.generateId() + , hs = [ + id + , self.enabled('heartbeats') ? self.get('heartbeat timeout') || '' : '' + , self.get('close timeout') || '' + , self.transports(data).join(',') + ].join(':'); + + if (data.query.jsonp && jsonpolling_re.test(data.query.jsonp)) { + hs = 'io.j[' + data.query.jsonp + '](' + JSON.stringify(hs) + ');'; + res.writeHead(200, { 'Content-Type': 'application/javascript' }); + } else { + res.writeHead(200, headers); + } + + self.onHandshake(id, newData || handshakeData); + self.store.publish('handshake', id, newData || handshakeData); + + res.end(hs); + + self.log.info('handshake authorized', id); + } else { + writeErr(403, 'handshake unauthorized'); + self.log.info('handshake unauthorized'); + } + }) +}; + +/** + * Gets normalized handshake data + * + * @api private + */ + +Manager.prototype.handshakeData = function (data) { + var connection = data.request.connection + , connectionAddress + , date = new Date; + + if (connection.remoteAddress) { + connectionAddress = { + address: connection.remoteAddress + , port: connection.remotePort + }; + } else if (connection.socket && connection.socket.remoteAddress) { + connectionAddress = { + address: connection.socket.remoteAddress + , port: connection.socket.remotePort + }; + } + + return { + headers: data.headers + , address: connectionAddress + , time: date.toString() + , query: data.query + , url: data.request.url + , xdomain: !!data.request.headers.origin + , secure: data.request.connection.secure + , issued: +date + }; +}; + +/** + * Verifies the origin of a request. + * + * @api private + */ + +Manager.prototype.verifyOrigin = function (request) { + var origin = request.headers.origin || request.headers.referer + , origins = this.get('origins'); + + if (origin === 'null') origin = '*'; + + if (origins.indexOf('*:*') !== -1) { + return true; + } + + if (origin) { + try { + var parts = url.parse(origin); + parts.port = parts.port || 80; + var ok = + ~origins.indexOf(parts.hostname + ':' + parts.port) || + ~origins.indexOf(parts.hostname + ':*') || + ~origins.indexOf('*:' + parts.port); + if (!ok) this.log.warn('illegal origin: ' + origin); + return ok; + } catch (ex) { + this.log.warn('error parsing origin'); + } + } + else { + this.log.warn('origin missing from handshake, yet required by config'); + } + return false; +}; + +/** + * Handles an incoming packet. + * + * @api private + */ + +Manager.prototype.handlePacket = function (sessid, packet) { + this.of(packet.endpoint || '').handlePacket(sessid, packet); +}; + +/** + * Performs authentication. + * + * @param Object client request data + * @api private + */ + +Manager.prototype.authorize = function (data, fn) { + if (this.get('authorization')) { + var self = this; + + this.get('authorization').call(this, data, function (err, authorized) { + self.log.debug('client ' + authorized ? 'authorized' : 'unauthorized'); + fn(err, authorized); + }); + } else { + this.log.debug('client authorized'); + fn(null, true); + } + + return this; +}; + +/** + * Retrieves the transports adviced to the user. + * + * @api private + */ + +Manager.prototype.transports = function (data) { + var transp = this.get('transports') + , ret = []; + + for (var i = 0, l = transp.length; i < l; i++) { + var transport = transp[i]; + + if (transport) { + if (!transport.checkClient || transport.checkClient(data)) { + ret.push(transport); + } + } + } + + return ret; +}; + +/** + * Checks whether a request is a socket.io one. + * + * @return {Object} a client request data object or `false` + * @api private + */ + +var regexp = /^\/([^\/]+)\/?([^\/]+)?\/?([^\/]+)?\/?$/ + +Manager.prototype.checkRequest = function (req) { + var resource = this.get('resource'); + + var match; + if (typeof resource === 'string') { + match = req.url.substr(0, resource.length); + if (match !== resource) match = null; + } else { + match = resource.exec(req.url); + if (match) match = match[0]; + } + + if (match) { + var uri = url.parse(req.url.substr(match.length), true) + , path = uri.pathname || '' + , pieces = path.match(regexp); + + // client request data + var data = { + query: uri.query || {} + , headers: req.headers + , request: req + , path: path + }; + + if (pieces) { + data.protocol = Number(pieces[1]); + data.transport = pieces[2]; + data.id = pieces[3]; + data.static = !!this.static.has(path); + }; + + return data; + } + + return false; +}; + +/** + * Declares a socket namespace + * + * @api public + */ + +Manager.prototype.of = function (nsp) { + if (this.namespaces[nsp]) { + return this.namespaces[nsp]; + } + + return this.namespaces[nsp] = new SocketNamespace(this, nsp); +}; + +/** + * Perform garbage collection on long living objects and properties that cannot + * be removed automatically. + * + * @api private + */ + +Manager.prototype.garbageCollection = function () { + // clean up unused handshakes + var ids = Object.keys(this.handshaken) + , i = ids.length + , now = Date.now() + , handshake; + + while (i--) { + handshake = this.handshaken[ids[i]]; + + if ('issued' in handshake && (now - handshake.issued) >= 3E4) { + this.onDisconnect(ids[i]); + } + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/namespace.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/namespace.js new file mode 100644 index 00000000..6e1e1c92 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/namespace.js @@ -0,0 +1,355 @@ +/** + * Module dependencies. + */ + +var Socket = require('./socket') + , EventEmitter = process.EventEmitter + , parser = require('./parser') + , util = require('./util'); + +/** + * Exports the constructor. + */ + +exports = module.exports = SocketNamespace; + +/** + * Constructor. + * + * @api public. + */ + +function SocketNamespace (mgr, name) { + this.manager = mgr; + this.name = name || ''; + this.sockets = {}; + this.auth = false; + this.setFlags(); +}; + +/** + * Inherits from EventEmitter. + */ + +SocketNamespace.prototype.__proto__ = EventEmitter.prototype; + +/** + * Copies emit since we override it. + * + * @api private + */ + +SocketNamespace.prototype.$emit = EventEmitter.prototype.emit; + +/** + * Retrieves all clients as Socket instances as an array. + * + * @api public + */ + +SocketNamespace.prototype.clients = function (room) { + var room = this.name + (room !== undefined ? + '/' + room : ''); + + if (!this.manager.rooms[room]) { + return []; + } + + return this.manager.rooms[room].map(function (id) { + return this.socket(id); + }, this); +}; + +/** + * Access logger interface. + * + * @api public + */ + +SocketNamespace.prototype.__defineGetter__('log', function () { + return this.manager.log; +}); + +/** + * Access store. + * + * @api public + */ + +SocketNamespace.prototype.__defineGetter__('store', function () { + return this.manager.store; +}); + +/** + * JSON message flag. + * + * @api public + */ + +SocketNamespace.prototype.__defineGetter__('json', function () { + this.flags.json = true; + return this; +}); + +/** + * Volatile message flag. + * + * @api public + */ + +SocketNamespace.prototype.__defineGetter__('volatile', function () { + this.flags.volatile = true; + return this; +}); + +/** + * Overrides the room to relay messages to (flag). + * + * @api public + */ + +SocketNamespace.prototype.in = SocketNamespace.prototype.to = function (room) { + this.flags.endpoint = this.name + (room ? '/' + room : ''); + return this; +}; + +/** + * Adds a session id we should prevent relaying messages to (flag). + * + * @api public + */ + +SocketNamespace.prototype.except = function (id) { + this.flags.exceptions.push(id); + return this; +}; + +/** + * Sets the default flags. + * + * @api private + */ + +SocketNamespace.prototype.setFlags = function () { + this.flags = { + endpoint: this.name + , exceptions: [] + }; + return this; +}; + +/** + * Sends out a packet. + * + * @api private + */ + +SocketNamespace.prototype.packet = function (packet) { + packet.endpoint = this.name; + + var store = this.store + , log = this.log + , volatile = this.flags.volatile + , exceptions = this.flags.exceptions + , packet = parser.encodePacket(packet); + + this.manager.onDispatch(this.flags.endpoint, packet, volatile, exceptions); + this.store.publish('dispatch', this.flags.endpoint, packet, volatile, exceptions); + + this.setFlags(); + + return this; +}; + +/** + * Sends to everyone. + * + * @api public + */ + +SocketNamespace.prototype.send = function (data) { + return this.packet({ + type: this.flags.json ? 'json' : 'message' + , data: data + }); +}; + +/** + * Emits to everyone (override). + * + * @api public + */ + +SocketNamespace.prototype.emit = function (name) { + if (name == 'newListener') { + return this.$emit.apply(this, arguments); + } + + return this.packet({ + type: 'event' + , name: name + , args: util.toArray(arguments).slice(1) + }); +}; + +/** + * Retrieves or creates a write-only socket for a client, unless specified. + * + * @param {Boolean} whether the socket will be readable when initialized + * @api public + */ + +SocketNamespace.prototype.socket = function (sid, readable) { + if (!this.sockets[sid]) { + this.sockets[sid] = new Socket(this.manager, sid, this, readable); + } + + return this.sockets[sid]; +}; + +/** + * Sets authorization for this namespace. + * + * @api public + */ + +SocketNamespace.prototype.authorization = function (fn) { + this.auth = fn; + return this; +}; + +/** + * Called when a socket disconnects entirely. + * + * @api private + */ + +SocketNamespace.prototype.handleDisconnect = function (sid, reason, raiseOnDisconnect) { + if (this.sockets[sid] && this.sockets[sid].readable) { + if (raiseOnDisconnect) this.sockets[sid].onDisconnect(reason); + delete this.sockets[sid]; + } +}; + +/** + * Performs authentication. + * + * @param Object client request data + * @api private + */ + +SocketNamespace.prototype.authorize = function (data, fn) { + if (this.auth) { + var self = this; + + this.auth.call(this, data, function (err, authorized) { + self.log.debug('client ' + + (authorized ? '' : 'un') + 'authorized for ' + self.name); + fn(err, authorized); + }); + } else { + this.log.debug('client authorized for ' + this.name); + fn(null, true); + } + + return this; +}; + +/** + * Handles a packet. + * + * @api private + */ + +SocketNamespace.prototype.handlePacket = function (sessid, packet) { + var socket = this.socket(sessid) + , dataAck = packet.ack == 'data' + , manager = this.manager + , self = this; + + function ack () { + self.log.debug('sending data ack packet'); + socket.packet({ + type: 'ack' + , args: util.toArray(arguments) + , ackId: packet.id + }); + }; + + function error (err) { + self.log.warn('handshake error ' + err + ' for ' + self.name); + socket.packet({ type: 'error', reason: err }); + }; + + function connect () { + self.manager.onJoin(sessid, self.name); + self.store.publish('join', sessid, self.name); + + // packet echo + socket.packet({ type: 'connect' }); + + // emit connection event + self.$emit('connection', socket); + }; + + switch (packet.type) { + case 'connect': + if (packet.endpoint == '') { + connect(); + } else { + var handshakeData = manager.handshaken[sessid]; + + this.authorize(handshakeData, function (err, authorized, newData) { + if (err) return error(err); + + if (authorized) { + manager.onHandshake(sessid, newData || handshakeData); + self.store.publish('handshake', sessid, newData || handshakeData); + connect(); + } else { + error('unauthorized'); + } + }); + } + break; + + case 'ack': + if (socket.acks[packet.ackId]) { + socket.acks[packet.ackId].apply(socket, packet.args); + } else { + this.log.info('unknown ack packet'); + } + break; + + case 'event': + // check if the emitted event is not blacklisted + if (-~manager.get('blacklist').indexOf(packet.name)) { + this.log.debug('ignoring blacklisted event `' + packet.name + '`'); + } else { + var params = [packet.name].concat(packet.args); + + if (dataAck) { + params.push(ack); + } + + socket.$emit.apply(socket, params); + } + break; + + case 'disconnect': + this.manager.onLeave(sessid, this.name); + this.store.publish('leave', sessid, this.name); + + socket.$emit('disconnect', packet.reason || 'packet'); + break; + + case 'json': + case 'message': + var params = ['message', packet.data]; + + if (dataAck) + params.push(ack); + + socket.$emit.apply(socket, params); + }; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/parser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/parser.js new file mode 100644 index 00000000..d56b5500 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/parser.js @@ -0,0 +1,249 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +/** + * Packet types. + */ + +var packets = exports.packets = { + 'disconnect': 0 + , 'connect': 1 + , 'heartbeat': 2 + , 'message': 3 + , 'json': 4 + , 'event': 5 + , 'ack': 6 + , 'error': 7 + , 'noop': 8 + } + , packetslist = Object.keys(packets); + +/** + * Errors reasons. + */ + +var reasons = exports.reasons = { + 'transport not supported': 0 + , 'client not handshaken': 1 + , 'unauthorized': 2 + } + , reasonslist = Object.keys(reasons); + +/** + * Errors advice. + */ + +var advice = exports.advice = { + 'reconnect': 0 + } + , advicelist = Object.keys(advice); + +/** + * Encodes a packet. + * + * @api private + */ + +exports.encodePacket = function (packet) { + var type = packets[packet.type] + , id = packet.id || '' + , endpoint = packet.endpoint || '' + , ack = packet.ack + , data = null; + + switch (packet.type) { + case 'message': + if (packet.data !== '') + data = packet.data; + break; + + case 'event': + var ev = { name: packet.name }; + + if (packet.args && packet.args.length) { + ev.args = packet.args; + } + + data = JSON.stringify(ev); + break; + + case 'json': + data = JSON.stringify(packet.data); + break; + + case 'ack': + data = packet.ackId + + (packet.args && packet.args.length + ? '+' + JSON.stringify(packet.args) : ''); + break; + + case 'connect': + if (packet.qs) + data = packet.qs; + break; + + case 'error': + var reason = packet.reason ? reasons[packet.reason] : '' + , adv = packet.advice ? advice[packet.advice] : '' + + if (reason !== '' || adv !== '') + data = reason + (adv !== '' ? ('+' + adv) : '') + + break; + } + + // construct packet with required fragments + var encoded = type + ':' + id + (ack == 'data' ? '+' : '') + ':' + endpoint; + + // data fragment is optional + if (data !== null && data !== undefined) + encoded += ':' + data; + + return encoded; +}; + +/** + * Encodes multiple messages (payload). + * + * @param {Array} messages + * @api private + */ + +exports.encodePayload = function (packets) { + var decoded = ''; + + if (packets.length == 1) + return packets[0]; + + for (var i = 0, l = packets.length; i < l; i++) { + var packet = packets[i]; + decoded += '\ufffd' + packet.length + '\ufffd' + packets[i] + } + + return decoded; +}; + +/** + * Decodes a packet + * + * @api private + */ + +var regexp = /([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/; + +/** + * Wrap the JSON.parse in a seperate function the crankshaft optimizer will + * only punish this function for the usage for try catch + * + * @api private + */ + +function parse (data) { + try { return JSON.parse(data) } + catch (e) { return false } +} + +exports.decodePacket = function (data) { + var pieces = data.match(regexp); + + if (!pieces) return {}; + + var id = pieces[2] || '' + , data = pieces[5] || '' + , packet = { + type: packetslist[pieces[1]] + , endpoint: pieces[4] || '' + }; + + // whether we need to acknowledge the packet + if (id) { + packet.id = id; + if (pieces[3]) + packet.ack = 'data'; + else + packet.ack = true; + } + + // handle different packet types + switch (packet.type) { + case 'message': + packet.data = data || ''; + break; + + case 'event': + pieces = parse(data); + if (pieces) { + packet.name = pieces.name; + packet.args = pieces.args; + } + + packet.args = packet.args || []; + break; + + case 'json': + packet.data = parse(data); + break; + + case 'connect': + packet.qs = data || ''; + break; + + case 'ack': + pieces = data.match(/^([0-9]+)(\+)?(.*)/); + if (pieces) { + packet.ackId = pieces[1]; + packet.args = []; + + if (pieces[3]) { + packet.args = parse(pieces[3]) || []; + } + } + break; + + case 'error': + pieces = data.split('+'); + packet.reason = reasonslist[pieces[0]] || ''; + packet.advice = advicelist[pieces[1]] || ''; + } + + return packet; +}; + +/** + * Decodes data payload. Detects multiple messages + * + * @return {Array} messages + * @api public + */ + +exports.decodePayload = function (data) { + if (undefined == data || null == data) { + return []; + } + + if (data[0] == '\ufffd') { + var ret = []; + + for (var i = 1, length = ''; i < data.length; i++) { + if (data[i] == '\ufffd') { + ret.push(exports.decodePacket(data.substr(i + 1, length))); + i += Number(length) + 1; + length = ''; + } else { + length += data[i]; + } + } + + return ret; + } else { + return [exports.decodePacket(data)]; + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/socket.io.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/socket.io.js new file mode 100644 index 00000000..d9d1c1fd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/socket.io.js @@ -0,0 +1,143 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var client = require('socket.io-client'); + +/** + * Version. + */ + +exports.version = '0.9.16'; + +/** + * Supported protocol version. + */ + +exports.protocol = 1; + +/** + * Client that we serve. + */ + +exports.clientVersion = client.version; + +/** + * Attaches a manager + * + * @param {HTTPServer/Number} a HTTP/S server or a port number to listen on. + * @param {Object} opts to be passed to Manager and/or http server + * @param {Function} callback if a port is supplied + * @api public + */ + +exports.listen = function (server, options, fn) { + if ('function' == typeof server) { + console.warn('Socket.IO\'s `listen()` method expects an `http.Server` instance\n' + + 'as its first parameter. Are you migrating from Express 2.x to 3.x?\n' + + 'If so, check out the "Socket.IO compatibility" section at:\n' + + 'https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x'); + } + + if ('function' == typeof options) { + fn = options; + options = {}; + } + + if ('undefined' == typeof server) { + // create a server that listens on port 80 + server = 80; + } + + if ('number' == typeof server) { + // if a port number is passed + var port = server; + + if (options && options.key) + server = require('https').createServer(options); + else + server = require('http').createServer(); + + // default response + server.on('request', function (req, res) { + res.writeHead(200); + res.end('Welcome to socket.io.'); + }); + + server.listen(port, fn); + } + + // otherwise assume a http/s server + return new exports.Manager(server, options); +}; + +/** + * Manager constructor. + * + * @api public + */ + +exports.Manager = require('./manager'); + +/** + * Transport constructor. + * + * @api public + */ + +exports.Transport = require('./transport'); + +/** + * Socket constructor. + * + * @api public + */ + +exports.Socket = require('./socket'); + +/** + * Static constructor. + * + * @api public + */ + +exports.Static = require('./static'); + +/** + * Store constructor. + * + * @api public + */ + +exports.Store = require('./store'); + +/** + * Memory Store constructor. + * + * @api public + */ + +exports.MemoryStore = require('./stores/memory'); + +/** + * Redis Store constructor. + * + * @api public + */ + +exports.RedisStore = require('./stores/redis'); + +/** + * Parser. + * + * @api public + */ + +exports.parser = require('./parser'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/socket.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/socket.js new file mode 100644 index 00000000..cd39635d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/socket.js @@ -0,0 +1,369 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var parser = require('./parser') + , util = require('./util') + , EventEmitter = process.EventEmitter + +/** + * Export the constructor. + */ + +exports = module.exports = Socket; + +/** + * Default error event listener to prevent uncaught exceptions. + */ + +var defaultError = function () {}; + +/** + * Socket constructor. + * + * @param {Manager} manager instance + * @param {String} session id + * @param {Namespace} namespace the socket belongs to + * @param {Boolean} whether the + * @api public + */ + +function Socket (manager, id, nsp, readable) { + this.id = id; + this.namespace = nsp; + this.manager = manager; + this.disconnected = false; + this.ackPackets = 0; + this.acks = {}; + this.setFlags(); + this.readable = readable; + this.store = this.manager.store.client(this.id); + this.on('error', defaultError); +}; + +/** + * Inherits from EventEmitter. + */ + +Socket.prototype.__proto__ = EventEmitter.prototype; + +/** + * Accessor shortcut for the handshake data + * + * @api private + */ + +Socket.prototype.__defineGetter__('handshake', function () { + return this.manager.handshaken[this.id]; +}); + +/** + * Accessor shortcut for the transport type + * + * @api private + */ + +Socket.prototype.__defineGetter__('transport', function () { + return this.manager.transports[this.id].name; +}); + +/** + * Accessor shortcut for the logger. + * + * @api private + */ + +Socket.prototype.__defineGetter__('log', function () { + return this.manager.log; +}); + +/** + * JSON message flag. + * + * @api public + */ + +Socket.prototype.__defineGetter__('json', function () { + this.flags.json = true; + return this; +}); + +/** + * Volatile message flag. + * + * @api public + */ + +Socket.prototype.__defineGetter__('volatile', function () { + this.flags.volatile = true; + return this; +}); + +/** + * Broadcast message flag. + * + * @api public + */ + +Socket.prototype.__defineGetter__('broadcast', function () { + this.flags.broadcast = true; + return this; +}); + +/** + * Overrides the room to broadcast messages to (flag) + * + * @api public + */ + +Socket.prototype.to = Socket.prototype.in = function (room) { + this.flags.room = room; + return this; +}; + +/** + * Resets flags + * + * @api private + */ + +Socket.prototype.setFlags = function () { + this.flags = { + endpoint: this.namespace.name + , room: '' + }; + return this; +}; + +/** + * Triggered on disconnect + * + * @api private + */ + +Socket.prototype.onDisconnect = function (reason) { + if (!this.disconnected) { + this.$emit('disconnect', reason); + this.disconnected = true; + } +}; + +/** + * Joins a user to a room. + * + * @api public + */ + +Socket.prototype.join = function (name, fn) { + var nsp = this.namespace.name + , name = (nsp + '/') + name; + + this.manager.onJoin(this.id, name); + this.manager.store.publish('join', this.id, name); + + if (fn) { + this.log.warn('Client#join callback is deprecated'); + fn(); + } + + return this; +}; + +/** + * Un-joins a user from a room. + * + * @api public + */ + +Socket.prototype.leave = function (name, fn) { + var nsp = this.namespace.name + , name = (nsp + '/') + name; + + this.manager.onLeave(this.id, name); + this.manager.store.publish('leave', this.id, name); + + if (fn) { + this.log.warn('Client#leave callback is deprecated'); + fn(); + } + + return this; +}; + +/** + * Transmits a packet. + * + * @api private + */ + +Socket.prototype.packet = function (packet) { + if (this.flags.broadcast) { + this.log.debug('broadcasting packet'); + this.namespace.in(this.flags.room).except(this.id).packet(packet); + } else { + packet.endpoint = this.flags.endpoint; + packet = parser.encodePacket(packet); + + this.dispatch(packet, this.flags.volatile); + } + + this.setFlags(); + + return this; +}; + +/** + * Dispatches a packet + * + * @api private + */ + +Socket.prototype.dispatch = function (packet, volatile) { + if (this.manager.transports[this.id] && this.manager.transports[this.id].open) { + this.manager.transports[this.id].onDispatch(packet, volatile); + } else { + if (!volatile) { + this.manager.onClientDispatch(this.id, packet, volatile); + } + + this.manager.store.publish('dispatch-remote', this.id, packet, volatile); + } +}; + +/** + * Stores data for the client. + * + * @api public + */ + +Socket.prototype.set = function (key, value, fn) { + this.store.set(key, value, fn); + return this; +}; + +/** + * Retrieves data for the client + * + * @api public + */ + +Socket.prototype.get = function (key, fn) { + this.store.get(key, fn); + return this; +}; + +/** + * Checks data for the client + * + * @api public + */ + +Socket.prototype.has = function (key, fn) { + this.store.has(key, fn); + return this; +}; + +/** + * Deletes data for the client + * + * @api public + */ + +Socket.prototype.del = function (key, fn) { + this.store.del(key, fn); + return this; +}; + +/** + * Kicks client + * + * @api public + */ + +Socket.prototype.disconnect = function () { + if (!this.disconnected) { + this.log.info('booting client'); + + if ('' === this.namespace.name) { + if (this.manager.transports[this.id] && this.manager.transports[this.id].open) { + this.manager.transports[this.id].onForcedDisconnect(); + } else { + this.manager.onClientDisconnect(this.id); + this.manager.store.publish('disconnect-remote', this.id); + } + } else { + this.packet({type: 'disconnect'}); + this.manager.onLeave(this.id, this.namespace.name); + this.$emit('disconnect', 'booted'); + } + + } + + return this; +}; + +/** + * Send a message. + * + * @api public + */ + +Socket.prototype.send = function (data, fn) { + var packet = { + type: this.flags.json ? 'json' : 'message' + , data: data + }; + + if (fn) { + packet.id = ++this.ackPackets; + packet.ack = true; + this.acks[packet.id] = fn; + } + + return this.packet(packet); +}; + +/** + * Original emit function. + * + * @api private + */ + +Socket.prototype.$emit = EventEmitter.prototype.emit; + +/** + * Emit override for custom events. + * + * @api public + */ + +Socket.prototype.emit = function (ev) { + if (ev == 'newListener') { + return this.$emit.apply(this, arguments); + } + + var args = util.toArray(arguments).slice(1) + , lastArg = args[args.length - 1] + , packet = { + type: 'event' + , name: ev + }; + + if ('function' == typeof lastArg) { + packet.id = ++this.ackPackets; + packet.ack = lastArg.length ? 'data' : true; + this.acks[packet.id] = lastArg; + args = args.slice(0, args.length - 1); + } + + packet.args = args; + + return this.packet(packet); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/static.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/static.js new file mode 100644 index 00000000..fe505937 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/static.js @@ -0,0 +1,395 @@ + +/*! +* socket.io-node +* Copyright(c) 2011 LearnBoost +* MIT Licensed +*/ + +/** + * Module dependencies. + */ + +var client = require('socket.io-client') + , cp = require('child_process') + , fs = require('fs') + , util = require('./util'); + +/** + * File type details. + * + * @api private + */ + +var mime = { + js: { + type: 'application/javascript' + , encoding: 'utf8' + , gzip: true + } + , swf: { + type: 'application/x-shockwave-flash' + , encoding: 'binary' + , gzip: false + } +}; + +/** + * Regexp for matching custom transport patterns. Users can configure their own + * socket.io bundle based on the url structure. Different transport names are + * concatinated using the `+` char. /socket.io/socket.io+websocket.js should + * create a bundle that only contains support for the websocket. + * + * @api private + */ + +var bundle = /\+((?:\+)?[\w\-]+)*(?:\.v\d+\.\d+\.\d+)?(?:\.js)$/ + , versioning = /\.v\d+\.\d+\.\d+(?:\.js)$/; + +/** + * Export the constructor + */ + +exports = module.exports = Static; + +/** + * Static constructor + * + * @api public + */ + +function Static (manager) { + this.manager = manager; + this.cache = {}; + this.paths = {}; + + this.init(); +} + +/** + * Initialize the Static by adding default file paths. + * + * @api public + */ + +Static.prototype.init = function () { + /** + * Generates a unique id based the supplied transports array + * + * @param {Array} transports The array with transport types + * @api private + */ + function id (transports) { + var id = transports.join('').split('').map(function (char) { + return ('' + char.charCodeAt(0)).split('').pop(); + }).reduce(function (char, id) { + return char +id; + }); + + return client.version + ':' + id; + } + + /** + * Generates a socket.io-client file based on the supplied transports. + * + * @param {Array} transports The array with transport types + * @param {Function} callback Callback for the static.write + * @api private + */ + + function build (transports, callback) { + client.builder(transports, { + minify: self.manager.enabled('browser client minification') + }, function (err, content) { + callback(err, content ? new Buffer(content) : null, id(transports)); + } + ); + } + + var self = this; + + // add our default static files + this.add('/static/flashsocket/WebSocketMain.swf', { + file: client.dist + '/WebSocketMain.swf' + }); + + this.add('/static/flashsocket/WebSocketMainInsecure.swf', { + file: client.dist + '/WebSocketMainInsecure.swf' + }); + + // generates dedicated build based on the available transports + this.add('/socket.io.js', function (path, callback) { + build(self.manager.get('transports'), callback); + }); + + this.add('/socket.io.v', { mime: mime.js }, function (path, callback) { + build(self.manager.get('transports'), callback); + }); + + // allow custom builds based on url paths + this.add('/socket.io+', { mime: mime.js }, function (path, callback) { + var available = self.manager.get('transports') + , matches = path.match(bundle) + , transports = []; + + if (!matches) return callback('No valid transports'); + + // make sure they valid transports + matches[0].split('.')[0].split('+').slice(1).forEach(function (transport) { + if (!!~available.indexOf(transport)) { + transports.push(transport); + } + }); + + if (!transports.length) return callback('No valid transports'); + build(transports, callback); + }); + + // clear cache when transports change + this.manager.on('set:transports', function (key, value) { + delete self.cache['/socket.io.js']; + Object.keys(self.cache).forEach(function (key) { + if (bundle.test(key)) { + delete self.cache[key]; + } + }); + }); +}; + +/** + * Gzip compress buffers. + * + * @param {Buffer} data The buffer that needs gzip compression + * @param {Function} callback + * @api public + */ + +Static.prototype.gzip = function (data, callback) { + var gzip = cp.spawn('gzip', ['-9', '-c', '-f', '-n']) + , encoding = Buffer.isBuffer(data) ? 'binary' : 'utf8' + , buffer = [] + , err; + + gzip.stdout.on('data', function (data) { + buffer.push(data); + }); + + gzip.stderr.on('data', function (data) { + err = data +''; + buffer.length = 0; + }); + + gzip.on('close', function () { + if (err) return callback(err); + + var size = 0 + , index = 0 + , i = buffer.length + , content; + + while (i--) { + size += buffer[i].length; + } + + content = new Buffer(size); + i = buffer.length; + + buffer.forEach(function (buffer) { + var length = buffer.length; + + buffer.copy(content, index, 0, length); + index += length; + }); + + buffer.length = 0; + callback(null, content); + }); + + gzip.stdin.end(data, encoding); +}; + +/** + * Is the path a static file? + * + * @param {String} path The path that needs to be checked + * @api public + */ + +Static.prototype.has = function (path) { + // fast case + if (this.paths[path]) return this.paths[path]; + + var keys = Object.keys(this.paths) + , i = keys.length; + + while (i--) { + if (-~path.indexOf(keys[i])) return this.paths[keys[i]]; + } + + return false; +}; + +/** + * Add new paths new paths that can be served using the static provider. + * + * @param {String} path The path to respond to + * @param {Options} options Options for writing out the response + * @param {Function} [callback] Optional callback if no options.file is + * supplied this would be called instead. + * @api public + */ + +Static.prototype.add = function (path, options, callback) { + var extension = /(?:\.(\w{1,4}))$/.exec(path); + + if (!callback && typeof options == 'function') { + callback = options; + options = {}; + } + + options.mime = options.mime || (extension ? mime[extension[1]] : false); + + if (callback) options.callback = callback; + if (!(options.file || options.callback) || !options.mime) return false; + + this.paths[path] = options; + + return true; +}; + +/** + * Writes a static response. + * + * @param {String} path The path for the static content + * @param {HTTPRequest} req The request object + * @param {HTTPResponse} res The response object + * @api public + */ + +Static.prototype.write = function (path, req, res) { + /** + * Write a response without throwing errors because can throw error if the + * response is no longer writable etc. + * + * @api private + */ + + function write (status, headers, content, encoding) { + try { + res.writeHead(status, headers || undefined); + + // only write content if it's not a HEAD request and we actually have + // some content to write (304's doesn't have content). + res.end( + req.method !== 'HEAD' && content ? content : '' + , encoding || undefined + ); + } catch (e) {} + } + + /** + * Answers requests depending on the request properties and the reply object. + * + * @param {Object} reply The details and content to reply the response with + * @api private + */ + + function answer (reply) { + var cached = req.headers['if-none-match'] === reply.etag; + if (cached && self.manager.enabled('browser client etag')) { + return write(304); + } + + var accept = req.headers['accept-encoding'] || '' + , gzip = !!~accept.toLowerCase().indexOf('gzip') + , mime = reply.mime + , versioned = reply.versioned + , headers = { + 'Content-Type': mime.type + }; + + // check if we can add a etag + if (self.manager.enabled('browser client etag') && reply.etag && !versioned) { + headers['Etag'] = reply.etag; + } + + // see if we need to set Expire headers because the path is versioned + if (versioned) { + var expires = self.manager.get('browser client expires'); + headers['Cache-Control'] = 'private, x-gzip-ok="", max-age=' + expires; + headers['Date'] = new Date().toUTCString(); + headers['Expires'] = new Date(Date.now() + (expires * 1000)).toUTCString(); + } + + if (gzip && reply.gzip) { + headers['Content-Length'] = reply.gzip.length; + headers['Content-Encoding'] = 'gzip'; + headers['Vary'] = 'Accept-Encoding'; + write(200, headers, reply.gzip.content, mime.encoding); + } else { + headers['Content-Length'] = reply.length; + write(200, headers, reply.content, mime.encoding); + } + + self.manager.log.debug('served static content ' + path); + } + + var self = this + , details; + + // most common case first + if (this.manager.enabled('browser client cache') && this.cache[path]) { + return answer(this.cache[path]); + } else if (this.manager.get('browser client handler')) { + return this.manager.get('browser client handler').call(this, req, res); + } else if ((details = this.has(path))) { + /** + * A small helper function that will let us deal with fs and dynamic files + * + * @param {Object} err Optional error + * @param {Buffer} content The data + * @api private + */ + + function ready (err, content, etag) { + if (err) { + self.manager.log.warn('Unable to serve file. ' + (err.message || err)); + return write(500, null, 'Error serving static ' + path); + } + + // store the result in the cache + var reply = self.cache[path] = { + content: content + , length: content.length + , mime: details.mime + , etag: etag || client.version + , versioned: versioning.test(path) + }; + + // check if gzip is enabled + if (details.mime.gzip && self.manager.enabled('browser client gzip')) { + self.gzip(content, function (err, content) { + if (!err) { + reply.gzip = { + content: content + , length: content.length + } + } + + answer(reply); + }); + } else { + answer(reply); + } + } + + if (details.file) { + fs.readFile(details.file, ready); + } else if(details.callback) { + details.callback.call(this, path, ready); + } else { + write(404, null, 'File handle not found'); + } + } else { + write(404, null, 'File not found'); + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/store.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/store.js new file mode 100644 index 00000000..06c0389a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/store.js @@ -0,0 +1,98 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Expose the constructor. + */ + +exports = module.exports = Store; + +/** + * Module dependencies. + */ + +var EventEmitter = process.EventEmitter; + +/** + * Store interface + * + * @api public + */ + +function Store (options) { + this.options = options; + this.clients = {}; +}; + +/** + * Inherit from EventEmitter. + */ + +Store.prototype.__proto__ = EventEmitter.prototype; + +/** + * Initializes a client store + * + * @param {String} id + * @api public + */ + +Store.prototype.client = function (id) { + if (!this.clients[id]) { + this.clients[id] = new (this.constructor.Client)(this, id); + } + + return this.clients[id]; +}; + +/** + * Destroys a client + * + * @api {String} sid + * @param {Number} number of seconds to expire client data + * @api private + */ + +Store.prototype.destroyClient = function (id, expiration) { + if (this.clients[id]) { + this.clients[id].destroy(expiration); + delete this.clients[id]; + } + + return this; +}; + +/** + * Destroys the store + * + * @param {Number} number of seconds to expire client data + * @api private + */ + +Store.prototype.destroy = function (clientExpiration) { + var keys = Object.keys(this.clients) + , count = keys.length; + + for (var i = 0, l = count; i < l; i++) { + this.destroyClient(keys[i], clientExpiration); + } + + this.clients = {}; + + return this; +}; + +/** + * Client. + * + * @api public + */ + +Store.Client = function (store, id) { + this.store = store; + this.id = id; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/stores/memory.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/stores/memory.js new file mode 100644 index 00000000..8b731a79 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/stores/memory.js @@ -0,0 +1,143 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , Store = require('../store'); + +/** + * Exports the constructor. + */ + +exports = module.exports = Memory; +Memory.Client = Client; + +/** + * Memory store + * + * @api public + */ + +function Memory (opts) { + Store.call(this, opts); +}; + +/** + * Inherits from Store. + */ + +Memory.prototype.__proto__ = Store.prototype; + +/** + * Publishes a message. + * + * @api private + */ + +Memory.prototype.publish = function () { }; + +/** + * Subscribes to a channel + * + * @api private + */ + +Memory.prototype.subscribe = function () { }; + +/** + * Unsubscribes + * + * @api private + */ + +Memory.prototype.unsubscribe = function () { }; + +/** + * Client constructor + * + * @api private + */ + +function Client () { + Store.Client.apply(this, arguments); + this.data = {}; +}; + +/** + * Inherits from Store.Client + */ + +Client.prototype.__proto__ = Store.Client; + +/** + * Gets a key + * + * @api public + */ + +Client.prototype.get = function (key, fn) { + fn(null, this.data[key] === undefined ? null : this.data[key]); + return this; +}; + +/** + * Sets a key + * + * @api public + */ + +Client.prototype.set = function (key, value, fn) { + this.data[key] = value; + fn && fn(null); + return this; +}; + +/** + * Has a key + * + * @api public + */ + +Client.prototype.has = function (key, fn) { + fn(null, key in this.data); +}; + +/** + * Deletes a key + * + * @api public + */ + +Client.prototype.del = function (key, fn) { + delete this.data[key]; + fn && fn(null); + return this; +}; + +/** + * Destroys the client. + * + * @param {Number} number of seconds to expire data + * @api private + */ + +Client.prototype.destroy = function (expiration) { + if ('number' != typeof expiration) { + this.data = {}; + } else { + var self = this; + + setTimeout(function () { + self.data = {}; + }, expiration * 1000); + } + + return this; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/stores/redis.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/stores/redis.js new file mode 100644 index 00000000..8fea235f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/stores/redis.js @@ -0,0 +1,269 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , Store = require('../store') + , assert = require('assert'); + +/** + * Exports the constructor. + */ + +exports = module.exports = Redis; +Redis.Client = Client; + +/** + * Redis store. + * Options: + * - nodeId (fn) gets an id that uniquely identifies this node + * - redis (fn) redis constructor, defaults to redis + * - redisPub (object) options to pass to the pub redis client + * - redisSub (object) options to pass to the sub redis client + * - redisClient (object) options to pass to the general redis client + * - pack (fn) custom packing, defaults to JSON or msgpack if installed + * - unpack (fn) custom packing, defaults to JSON or msgpack if installed + * + * @api public + */ + +function Redis (opts) { + opts = opts || {}; + + // node id to uniquely identify this node + var nodeId = opts.nodeId || function () { + // by default, we generate a random id + return Math.abs(Math.random() * Math.random() * Date.now() | 0); + }; + + this.nodeId = nodeId(); + + // packing / unpacking mechanism + if (opts.pack) { + this.pack = opts.pack; + this.unpack = opts.unpack; + } else { + try { + var msgpack = require('msgpack'); + this.pack = msgpack.pack; + this.unpack = msgpack.unpack; + } catch (e) { + this.pack = JSON.stringify; + this.unpack = JSON.parse; + } + } + + var redis = opts.redis || require('redis') + , RedisClient = redis.RedisClient; + + // initialize a pubsub client and a regular client + if (opts.redisPub instanceof RedisClient) { + this.pub = opts.redisPub; + } else { + opts.redisPub || (opts.redisPub = {}); + this.pub = redis.createClient(opts.redisPub.port, opts.redisPub.host, opts.redisPub); + } + if (opts.redisSub instanceof RedisClient) { + this.sub = opts.redisSub; + } else { + opts.redisSub || (opts.redisSub = {}); + this.sub = redis.createClient(opts.redisSub.port, opts.redisSub.host, opts.redisSub); + } + if (opts.redisClient instanceof RedisClient) { + this.cmd = opts.redisClient; + } else { + opts.redisClient || (opts.redisClient = {}); + this.cmd = redis.createClient(opts.redisClient.port, opts.redisClient.host, opts.redisClient); + } + + Store.call(this, opts); + + this.sub.setMaxListeners(0); + this.setMaxListeners(0); +}; + +/** + * Inherits from Store. + */ + +Redis.prototype.__proto__ = Store.prototype; + +/** + * Publishes a message. + * + * @api private + */ + +Redis.prototype.publish = function (name) { + var args = Array.prototype.slice.call(arguments, 1); + this.pub.publish(name, this.pack({ nodeId: this.nodeId, args: args })); + this.emit.apply(this, ['publish', name].concat(args)); +}; + +/** + * Subscribes to a channel + * + * @api private + */ + +Redis.prototype.subscribe = function (name, consumer, fn) { + this.sub.subscribe(name); + + if (consumer || fn) { + var self = this; + + self.sub.on('subscribe', function subscribe (ch) { + if (name == ch) { + function message (ch, msg) { + if (name == ch) { + msg = self.unpack(msg); + + // we check that the message consumed wasnt emitted by this node + if (self.nodeId != msg.nodeId) { + consumer.apply(null, msg.args); + } + } + }; + + self.sub.on('message', message); + + self.on('unsubscribe', function unsubscribe (ch) { + if (name == ch) { + self.sub.removeListener('message', message); + self.removeListener('unsubscribe', unsubscribe); + } + }); + + self.sub.removeListener('subscribe', subscribe); + + fn && fn(); + } + }); + } + + this.emit('subscribe', name, consumer, fn); +}; + +/** + * Unsubscribes + * + * @api private + */ + +Redis.prototype.unsubscribe = function (name, fn) { + this.sub.unsubscribe(name); + + if (fn) { + var client = this.sub; + + client.on('unsubscribe', function unsubscribe (ch) { + if (name == ch) { + fn(); + client.removeListener('unsubscribe', unsubscribe); + } + }); + } + + this.emit('unsubscribe', name, fn); +}; + +/** + * Destroys the store + * + * @api public + */ + +Redis.prototype.destroy = function () { + Store.prototype.destroy.call(this); + + this.pub.end(); + this.sub.end(); + this.cmd.end(); +}; + +/** + * Client constructor + * + * @api private + */ + +function Client (store, id) { + Store.Client.call(this, store, id); +}; + +/** + * Inherits from Store.Client + */ + +Client.prototype.__proto__ = Store.Client; + +/** + * Redis hash get + * + * @api private + */ + +Client.prototype.get = function (key, fn) { + this.store.cmd.hget(this.id, key, fn); + return this; +}; + +/** + * Redis hash set + * + * @api private + */ + +Client.prototype.set = function (key, value, fn) { + this.store.cmd.hset(this.id, key, value, fn); + return this; +}; + +/** + * Redis hash del + * + * @api private + */ + +Client.prototype.del = function (key, fn) { + this.store.cmd.hdel(this.id, key, fn); + return this; +}; + +/** + * Redis hash has + * + * @api private + */ + +Client.prototype.has = function (key, fn) { + this.store.cmd.hexists(this.id, key, function (err, has) { + if (err) return fn(err); + fn(null, !!has); + }); + return this; +}; + +/** + * Destroys client + * + * @param {Number} number of seconds to expire data + * @api private + */ + +Client.prototype.destroy = function (expiration) { + if ('number' != typeof expiration) { + this.store.cmd.del(this.id); + } else { + this.store.cmd.expire(this.id, expiration); + } + + return this; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transport.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transport.js new file mode 100644 index 00000000..e04d2aee --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transport.js @@ -0,0 +1,516 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var parser = require('./parser'); + +/** + * Expose the constructor. + */ + +exports = module.exports = Transport; + +/** + * Transport constructor. + * + * @api public + */ + +function Transport (mng, data, req) { + this.manager = mng; + this.id = data.id; + this.disconnected = false; + this.drained = true; + this.handleRequest(req); +}; + +/** + * Access the logger. + * + * @api public + */ + +Transport.prototype.__defineGetter__('log', function () { + return this.manager.log; +}); + +/** + * Access the store. + * + * @api public + */ + +Transport.prototype.__defineGetter__('store', function () { + return this.manager.store; +}); + +/** + * Handles a request when it's set. + * + * @api private + */ + +Transport.prototype.handleRequest = function (req) { + this.log.debug('setting request', req.method, req.url); + this.req = req; + + if (req.method == 'GET') { + this.socket = req.socket; + this.open = true; + this.drained = true; + this.setHeartbeatInterval(); + + this.setHandlers(); + this.onSocketConnect(); + } +}; + +/** + * Called when a connection is first set. + * + * @api private + */ + +Transport.prototype.onSocketConnect = function () { }; + +/** + * Sets transport handlers + * + * @api private + */ + +Transport.prototype.setHandlers = function () { + var self = this; + + this.bound = { + end: this.onSocketEnd.bind(this) + , close: this.onSocketClose.bind(this) + , error: this.onSocketError.bind(this) + , drain: this.onSocketDrain.bind(this) + }; + + this.socket.on('end', this.bound.end); + this.socket.on('close', this.bound.close); + this.socket.on('error', this.bound.error); + this.socket.on('drain', this.bound.drain); + + this.handlersSet = true; +}; + +/** + * Removes transport handlers + * + * @api private + */ + +Transport.prototype.clearHandlers = function () { + if (this.handlersSet) { + this.socket.removeListener('end', this.bound.end); + this.socket.removeListener('close', this.bound.close); + this.socket.removeListener('error', this.bound.error); + this.socket.removeListener('drain', this.bound.drain); + } +}; + +/** + * Called when the connection dies + * + * @api private + */ + +Transport.prototype.onSocketEnd = function () { + this.end('socket end'); +}; + +/** + * Called when the connection dies + * + * @api private + */ + +Transport.prototype.onSocketClose = function (error) { + this.end(error ? 'socket error' : 'socket close'); +}; + +/** + * Called when the connection has an error. + * + * @api private + */ + +Transport.prototype.onSocketError = function (err) { + if (this.open) { + this.socket.destroy(); + this.onClose(); + } + + this.log.info('socket error ' + err.stack); +}; + +/** + * Called when the connection is drained. + * + * @api private + */ + +Transport.prototype.onSocketDrain = function () { + this.drained = true; +}; + +/** + * Called upon receiving a heartbeat packet. + * + * @api private + */ + +Transport.prototype.onHeartbeatClear = function () { + this.clearHeartbeatTimeout(); + this.setHeartbeatInterval(); +}; + +/** + * Called upon a forced disconnection. + * + * @api private + */ + +Transport.prototype.onForcedDisconnect = function () { + if (!this.disconnected) { + this.log.info('transport end by forced client disconnection'); + if (this.open) { + this.packet({ type: 'disconnect' }); + } + this.end('booted'); + } +}; + +/** + * Dispatches a packet. + * + * @api private + */ + +Transport.prototype.onDispatch = function (packet, volatile) { + if (volatile) { + this.writeVolatile(packet); + } else { + this.write(packet); + } +}; + +/** + * Sets the close timeout. + */ + +Transport.prototype.setCloseTimeout = function () { + if (!this.closeTimeout) { + var self = this; + + this.closeTimeout = setTimeout(function () { + self.log.debug('fired close timeout for client', self.id); + self.closeTimeout = null; + self.end('close timeout'); + }, this.manager.get('close timeout') * 1000); + + this.log.debug('set close timeout for client', this.id); + } +}; + +/** + * Clears the close timeout. + */ + +Transport.prototype.clearCloseTimeout = function () { + if (this.closeTimeout) { + clearTimeout(this.closeTimeout); + this.closeTimeout = null; + + this.log.debug('cleared close timeout for client', this.id); + } +}; + +/** + * Sets the heartbeat timeout + */ + +Transport.prototype.setHeartbeatTimeout = function () { + if (!this.heartbeatTimeout && this.manager.enabled('heartbeats')) { + var self = this; + + this.heartbeatTimeout = setTimeout(function () { + self.log.debug('fired heartbeat timeout for client', self.id); + self.heartbeatTimeout = null; + self.end('heartbeat timeout'); + }, this.manager.get('heartbeat timeout') * 1000); + + this.log.debug('set heartbeat timeout for client', this.id); + } +}; + +/** + * Clears the heartbeat timeout + * + * @param text + */ + +Transport.prototype.clearHeartbeatTimeout = function () { + if (this.heartbeatTimeout && this.manager.enabled('heartbeats')) { + clearTimeout(this.heartbeatTimeout); + this.heartbeatTimeout = null; + this.log.debug('cleared heartbeat timeout for client', this.id); + } +}; + +/** + * Sets the heartbeat interval. To be called when a connection opens and when + * a heartbeat is received. + * + * @api private + */ + +Transport.prototype.setHeartbeatInterval = function () { + if (!this.heartbeatInterval && this.manager.enabled('heartbeats')) { + var self = this; + + this.heartbeatInterval = setTimeout(function () { + self.heartbeat(); + self.heartbeatInterval = null; + }, this.manager.get('heartbeat interval') * 1000); + + this.log.debug('set heartbeat interval for client', this.id); + } +}; + +/** + * Clears all timeouts. + * + * @api private + */ + +Transport.prototype.clearTimeouts = function () { + this.clearCloseTimeout(); + this.clearHeartbeatTimeout(); + this.clearHeartbeatInterval(); +}; + +/** + * Sends a heartbeat + * + * @api private + */ + +Transport.prototype.heartbeat = function () { + if (this.open) { + this.log.debug('emitting heartbeat for client', this.id); + this.packet({ type: 'heartbeat' }); + this.setHeartbeatTimeout(); + } + + return this; +}; + +/** + * Handles a message. + * + * @param {Object} packet object + * @api private + */ + +Transport.prototype.onMessage = function (packet) { + var current = this.manager.transports[this.id]; + + if ('heartbeat' == packet.type) { + this.log.debug('got heartbeat packet'); + + if (current && current.open) { + current.onHeartbeatClear(); + } else { + this.store.publish('heartbeat-clear', this.id); + } + } else { + if ('disconnect' == packet.type && packet.endpoint == '') { + this.log.debug('got disconnection packet'); + + if (current) { + current.onForcedDisconnect(); + } else { + this.store.publish('disconnect-force', this.id); + } + + return; + } + + if (packet.id && packet.ack != 'data') { + this.log.debug('acknowledging packet automatically'); + + var ack = parser.encodePacket({ + type: 'ack' + , ackId: packet.id + , endpoint: packet.endpoint || '' + }); + + if (current && current.open) { + current.onDispatch(ack); + } else { + this.manager.onClientDispatch(this.id, ack); + this.store.publish('dispatch-remote', this.id, ack); + } + } + + // handle packet locally or publish it + if (current) { + this.manager.onClientMessage(this.id, packet); + } else { + this.store.publish('message-remote', this.id, packet); + } + } +}; + +/** + * Clears the heartbeat interval + * + * @api private + */ + +Transport.prototype.clearHeartbeatInterval = function () { + if (this.heartbeatInterval && this.manager.enabled('heartbeats')) { + clearTimeout(this.heartbeatInterval); + this.heartbeatInterval = null; + this.log.debug('cleared heartbeat interval for client', this.id); + } +}; + +/** + * Finishes the connection and makes sure client doesn't reopen + * + * @api private + */ + +Transport.prototype.disconnect = function (reason) { + this.packet({ type: 'disconnect' }); + this.end(reason); + + return this; +}; + +/** + * Closes the connection. + * + * @api private + */ + +Transport.prototype.close = function () { + if (this.open) { + this.doClose(); + this.onClose(); + } +}; + +/** + * Called upon a connection close. + * + * @api private + */ + +Transport.prototype.onClose = function () { + if (this.open) { + this.setCloseTimeout(); + this.clearHandlers(); + this.open = false; + this.manager.onClose(this.id); + this.store.publish('close', this.id); + } +}; + +/** + * Cleans up the connection, considers the client disconnected. + * + * @api private + */ + +Transport.prototype.end = function (reason) { + if (!this.disconnected) { + this.log.info('transport end (' + reason + ')'); + + var local = this.manager.transports[this.id]; + + this.close(); + this.clearTimeouts(); + this.disconnected = true; + + if (local) { + this.manager.onClientDisconnect(this.id, reason); + } + + this.store.publish('disconnect-remote', this.id, reason); + } +}; + +/** + * Signals that the transport should pause and buffer data. + * + * @api public + */ + +Transport.prototype.discard = function () { + this.log.debug('discarding transport'); + this.discarded = true; + this.clearTimeouts(); + this.clearHandlers(); + + return this; +}; + +/** + * Writes an error packet with the specified reason and advice. + * + * @param {Number} advice + * @param {Number} reason + * @api public + */ + +Transport.prototype.error = function (reason, advice) { + this.packet({ + type: 'error' + , reason: reason + , advice: advice + }); + + this.log.warn(reason, advice ? ('client should ' + advice) : ''); + this.end('error'); +}; + +/** + * Write a packet. + * + * @api public + */ + +Transport.prototype.packet = function (obj) { + return this.write(parser.encodePacket(obj)); +}; + +/** + * Writes a volatile message. + * + * @api private + */ + +Transport.prototype.writeVolatile = function (msg) { + if (this.open) { + if (this.drained) { + this.write(msg); + } else { + this.log.debug('ignoring volatile packet, buffer not drained'); + } + } else { + this.log.debug('ignoring volatile packet, transport not open'); + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/flashsocket.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/flashsocket.js new file mode 100644 index 00000000..dc2d78b4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/flashsocket.js @@ -0,0 +1,129 @@ +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ +var WebSocket = require('./websocket'); + +/** + * Export the constructor. + */ + +exports = module.exports = FlashSocket; + +/** + * The FlashSocket transport is just a proxy + * for WebSocket connections. + * + * @api public + */ + +function FlashSocket (mng, data, req) { + return WebSocket.call(this, mng, data, req); +} + +/** + * Inherits from WebSocket. + */ + +FlashSocket.prototype.__proto__ = WebSocket.prototype; + +/** + * Transport name + * + * @api public + */ + +FlashSocket.prototype.name = 'flashsocket'; + +/** + * Listens for new configuration changes of the Manager + * this way we can enable and disable the flash server. + * + * @param {Manager} Manager instance. + * @api private + */ + + +FlashSocket.init = function (manager) { + var server; + function create () { + + // Drop out immediately if the user has + // disabled the flash policy server + if (!manager.get('flash policy server')) { + return; + } + + server = require('policyfile').createServer({ + log: function(msg){ + manager.log.info(msg); + } + }, manager.get('origins')); + + server.on('close', function (e) { + server = null; + }); + + server.listen(manager.get('flash policy port'), manager.server); + + manager.flashPolicyServer = server; + } + + // listen for origin changes, so we can update the server + manager.on('set:origins', function (value, key) { + if (!server) return; + + // update the origins and compile a new response buffer + server.origins = Array.isArray(value) ? value : [value]; + server.compile(); + }); + + // destory the server and create a new server + manager.on('set:flash policy port', function (value, key) { + var transports = manager.get('transports'); + if (~transports.indexOf('flashsocket')) { + if (server) { + if (server.port === value) return; + // destroy the server and rebuild it on a new port + try { + server.close(); + } + catch (e) { /* ignore exception. could e.g. be that the server isn't started yet */ } + } + create(); + } + }); + + // create or destroy the server + manager.on('set:flash policy server', function (value, key) { + var transports = manager.get('transports'); + if (~transports.indexOf('flashsocket')) { + if (server && !value) { + // destroy the server + try { + server.close(); + } + catch (e) { /* ignore exception. could e.g. be that the server isn't started yet */ } + } + } else if (!server && value) { + // create the server + create(); + } + }); + + // only start the server + manager.on('set:transports', function (value, key){ + if (!server && ~manager.get('transports').indexOf('flashsocket')) { + create(); + } + }); + // check if we need to initialize at start + if (~manager.get('transports').indexOf('flashsocket')){ + create(); + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/htmlfile.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/htmlfile.js new file mode 100644 index 00000000..fce0c0ed --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/htmlfile.js @@ -0,0 +1,83 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var HTTPTransport = require('./http'); + +/** + * Export the constructor. + */ + +exports = module.exports = HTMLFile; + +/** + * HTMLFile transport constructor. + * + * @api public + */ + +function HTMLFile (mng, data, req) { + HTTPTransport.call(this, mng, data, req); +}; + +/** + * Inherits from Transport. + */ + +HTMLFile.prototype.__proto__ = HTTPTransport.prototype; + +/** + * Transport name + * + * @api public + */ + +HTMLFile.prototype.name = 'htmlfile'; + +/** + * Handles the request. + * + * @api private + */ + +HTMLFile.prototype.handleRequest = function (req) { + HTTPTransport.prototype.handleRequest.call(this, req); + + if (req.method == 'GET') { + req.res.writeHead(200, { + 'Content-Type': 'text/html; charset=UTF-8' + , 'Connection': 'keep-alive' + , 'Transfer-Encoding': 'chunked' + }); + + req.res.write( + '' + + '' + + new Array(174).join(' ') + ); + } +}; + +/** + * Performs the write. + * + * @api private + */ + +HTMLFile.prototype.write = function (data) { + // escape all forward slashes. see GH-1251 + data = ''; + + if (this.response.write(data)) { + this.drained = true; + } + + this.log.debug(this.name + ' writing', data); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/http-polling.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/http-polling.js new file mode 100644 index 00000000..89b7e042 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/http-polling.js @@ -0,0 +1,147 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var HTTPTransport = require('./http'); + +/** + * Exports the constructor. + */ + +exports = module.exports = HTTPPolling; + +/** + * HTTP polling constructor. + * + * @api public. + */ + +function HTTPPolling (mng, data, req) { + HTTPTransport.call(this, mng, data, req); +}; + +/** + * Inherits from HTTPTransport. + * + * @api public. + */ + +HTTPPolling.prototype.__proto__ = HTTPTransport.prototype; + +/** + * Transport name + * + * @api public + */ + +HTTPPolling.prototype.name = 'httppolling'; + +/** + * Override setHandlers + * + * @api private + */ + +HTTPPolling.prototype.setHandlers = function () { + HTTPTransport.prototype.setHandlers.call(this); + this.socket.removeListener('end', this.bound.end); + this.socket.removeListener('close', this.bound.close); +}; + +/** + * Removes heartbeat timeouts for polling. + */ + +HTTPPolling.prototype.setHeartbeatInterval = function () { + return this; +}; + +/** + * Handles a request + * + * @api private + */ + +HTTPPolling.prototype.handleRequest = function (req) { + HTTPTransport.prototype.handleRequest.call(this, req); + + if (req.method == 'GET') { + var self = this; + + this.pollTimeout = setTimeout(function () { + self.packet({ type: 'noop' }); + self.log.debug(self.name + ' closed due to exceeded duration'); + }, this.manager.get('polling duration') * 1000); + + this.log.debug('setting poll timeout'); + } +}; + +/** + * Clears polling timeout + * + * @api private + */ + +HTTPPolling.prototype.clearPollTimeout = function () { + if (this.pollTimeout) { + clearTimeout(this.pollTimeout); + this.pollTimeout = null; + this.log.debug('clearing poll timeout'); + } + + return this; +}; + +/** + * Override clear timeouts to clear the poll timeout + * + * @api private + */ + +HTTPPolling.prototype.clearTimeouts = function () { + HTTPTransport.prototype.clearTimeouts.call(this); + + this.clearPollTimeout(); +}; + +/** + * doWrite to clear poll timeout + * + * @api private + */ + +HTTPPolling.prototype.doWrite = function () { + this.clearPollTimeout(); +}; + +/** + * Performs a write. + * + * @api private. + */ + +HTTPPolling.prototype.write = function (data, close) { + this.doWrite(data); + this.response.end(); + this.onClose(); +}; + +/** + * Override end. + * + * @api private + */ + +HTTPPolling.prototype.end = function (reason) { + this.clearPollTimeout(); + return HTTPTransport.prototype.end.call(this, reason); +}; + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/http.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/http.js new file mode 100644 index 00000000..fa94b597 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/http.js @@ -0,0 +1,122 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var Transport = require('../transport') + , parser = require('../parser') + , qs = require('querystring'); + +/** + * Export the constructor. + */ + +exports = module.exports = HTTPTransport; + +/** + * HTTP interface constructor. For all non-websocket transports. + * + * @api public + */ + +function HTTPTransport (mng, data, req) { + Transport.call(this, mng, data, req); +}; + +/** + * Inherits from Transport. + */ + +HTTPTransport.prototype.__proto__ = Transport.prototype; + +/** + * Handles a request. + * + * @api private + */ + +HTTPTransport.prototype.handleRequest = function (req) { + + // Always set the response in case an error is returned to the client + this.response = req.res; + + if (req.method == 'POST') { + var buffer = '' + , res = req.res + , origin = req.headers.origin + , headers = { 'Content-Length': 1, 'Content-Type': 'text/plain; charset=UTF-8' } + , self = this; + + req.on('data', function (data) { + buffer += data; + + if (Buffer.byteLength(buffer) >= self.manager.get('destroy buffer size')) { + buffer = ''; + req.connection.destroy(); + } + }); + + req.on('end', function () { + res.writeHead(200, headers); + res.end('1'); + + self.onData(self.postEncoded ? qs.parse(buffer).d : buffer); + }); + + // prevent memory leaks for uncompleted requests + req.on('close', function () { + buffer = ''; + self.onClose(); + }); + + if (origin) { + // https://developer.mozilla.org/En/HTTP_Access_Control + headers['Access-Control-Allow-Origin'] = origin; + headers['Access-Control-Allow-Credentials'] = 'true'; + headers['X-XSS-Protection'] = '0'; + } + } else { + Transport.prototype.handleRequest.call(this, req); + } +}; + +/** + * Handles data payload. + * + * @api private + */ + +HTTPTransport.prototype.onData = function (data) { + var messages = parser.decodePayload(data); + this.log.debug(this.name + ' received data packet', data); + + for (var i = 0, l = messages.length; i < l; i++) { + this.onMessage(messages[i]); + } +}; + +/** + * Closes the request-response cycle + * + * @api private + */ + +HTTPTransport.prototype.doClose = function () { + this.response.end(); +}; + +/** + * Writes a payload of messages + * + * @api private + */ + +HTTPTransport.prototype.payload = function (msgs) { + this.write(parser.encodePayload(msgs)); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/index.js new file mode 100644 index 00000000..b8655594 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/index.js @@ -0,0 +1,12 @@ + +/** + * Export transports. + */ + +module.exports = { + websocket: require('./websocket') + , flashsocket: require('./flashsocket') + , htmlfile: require('./htmlfile') + , 'xhr-polling': require('./xhr-polling') + , 'jsonp-polling': require('./jsonp-polling') +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/jsonp-polling.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/jsonp-polling.js new file mode 100644 index 00000000..ad7d5aff --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/jsonp-polling.js @@ -0,0 +1,97 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var HTTPPolling = require('./http-polling'); +var jsonpolling_re = /^\d+$/ + +/** + * Export the constructor. + */ + +exports = module.exports = JSONPPolling; + +/** + * JSON-P polling transport. + * + * @api public + */ + +function JSONPPolling (mng, data, req) { + HTTPPolling.call(this, mng, data, req); + + this.head = 'io.j[0]('; + this.foot = ');'; + + if (data.query.i && jsonpolling_re.test(data.query.i)) { + this.head = 'io.j[' + data.query.i + ']('; + } +}; + +/** + * Inherits from Transport. + */ + +JSONPPolling.prototype.__proto__ = HTTPPolling.prototype; + +/** + * Transport name + * + * @api public + */ + +JSONPPolling.prototype.name = 'jsonppolling'; + +/** + * Make sure POST are decoded. + */ + +JSONPPolling.prototype.postEncoded = true; + +/** + * Handles incoming data. + * Due to a bug in \n handling by browsers, we expect a JSONified string. + * + * @api private + */ + +JSONPPolling.prototype.onData = function (data) { + try { + data = JSON.parse(data); + } catch (e) { + this.error('parse', 'reconnect'); + return; + } + + HTTPPolling.prototype.onData.call(this, data); +}; + +/** + * Performs the write. + * + * @api private + */ + +JSONPPolling.prototype.doWrite = function (data) { + HTTPPolling.prototype.doWrite.call(this); + + var data = data === undefined + ? '' : this.head + JSON.stringify(data) + this.foot; + + this.response.writeHead(200, { + 'Content-Type': 'text/javascript; charset=UTF-8' + , 'Content-Length': Buffer.byteLength(data) + , 'Connection': 'Keep-Alive' + , 'X-XSS-Protection': '0' + }); + + this.response.write(data); + this.log.debug(this.name + ' writing', data); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket.js new file mode 100644 index 00000000..78a43043 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket.js @@ -0,0 +1,36 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var protocolVersions = require('./websocket/'); + +/** + * Export the constructor. + */ + +exports = module.exports = WebSocket; + +/** + * HTTP interface constructor. Interface compatible with all transports that + * depend on request-response cycles. + * + * @api public + */ + +function WebSocket (mng, data, req) { + var transport + , version = req.headers['sec-websocket-version']; + if (typeof version !== 'undefined' && typeof protocolVersions[version] !== 'undefined') { + transport = new protocolVersions[version](mng, data, req); + } + else transport = new protocolVersions['default'](mng, data, req); + if (typeof this.name !== 'undefined') transport.name = this.name; + return transport; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/default.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/default.js new file mode 100644 index 00000000..cf3b8afb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/default.js @@ -0,0 +1,376 @@ +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var Transport = require('../../transport') + , EventEmitter = process.EventEmitter + , crypto = require('crypto') + , parser = require('../../parser'); + +/** + * Export the constructor. + */ + +exports = module.exports = WebSocket; + +/** + * HTTP interface constructor. Interface compatible with all transports that + * depend on request-response cycles. + * + * @api public + */ + +function WebSocket (mng, data, req) { + // parser + var self = this; + + this.parser = new Parser({maxBuffer: mng.get('destroy buffer size')}); + this.parser.on('data', function (packet) { + self.log.debug(self.name + ' received data packet', packet); + self.onMessage(parser.decodePacket(packet)); + }); + this.parser.on('close', function () { + self.end(); + }); + this.parser.on('error', function () { + self.end(); + }); + this.parser.on('kick', function (reason) { + self.log.warn(self.name + ' parser forced user kick: ' + reason); + self.onMessage({type: 'disconnect', endpoint: ''}); + self.end(); + }); + + Transport.call(this, mng, data, req); +}; + +/** + * Inherits from Transport. + */ + +WebSocket.prototype.__proto__ = Transport.prototype; + +/** + * Transport name + * + * @api public + */ + +WebSocket.prototype.name = 'websocket'; + +/** + * Websocket draft version + * + * @api public + */ + +WebSocket.prototype.protocolVersion = 'hixie-76'; + +/** + * Called when the socket connects. + * + * @api private + */ + +WebSocket.prototype.onSocketConnect = function () { + var self = this; + + this.socket.setNoDelay(true); + + this.buffer = true; + this.buffered = []; + + if (this.req.headers.upgrade !== 'WebSocket') { + this.log.warn(this.name + ' connection invalid'); + this.end(); + return; + } + + var origin = this.req.headers['origin'] + , waitingForNonce = false; + if(this.manager.settings['match origin protocol']){ + location = (origin.indexOf('https')>-1 ? 'wss' : 'ws') + '://' + this.req.headers.host + this.req.url; + }else if(this.socket.encrypted){ + location = 'wss://' + this.req.headers.host + this.req.url; + }else{ + location = 'ws://' + this.req.headers.host + this.req.url; + } + + if (this.req.headers['sec-websocket-key1']) { + // If we don't have the nonce yet, wait for it (HAProxy compatibility). + if (! (this.req.head && this.req.head.length >= 8)) { + waitingForNonce = true; + } + + var headers = [ + 'HTTP/1.1 101 WebSocket Protocol Handshake' + , 'Upgrade: WebSocket' + , 'Connection: Upgrade' + , 'Sec-WebSocket-Origin: ' + origin + , 'Sec-WebSocket-Location: ' + location + ]; + + if (this.req.headers['sec-websocket-protocol']){ + headers.push('Sec-WebSocket-Protocol: ' + + this.req.headers['sec-websocket-protocol']); + } + } else { + var headers = [ + 'HTTP/1.1 101 Web Socket Protocol Handshake' + , 'Upgrade: WebSocket' + , 'Connection: Upgrade' + , 'WebSocket-Origin: ' + origin + , 'WebSocket-Location: ' + location + ]; + } + + try { + this.socket.write(headers.concat('', '').join('\r\n')); + this.socket.setTimeout(0); + this.socket.setNoDelay(true); + this.socket.setEncoding('utf8'); + } catch (e) { + this.end(); + return; + } + + if (waitingForNonce) { + this.socket.setEncoding('binary'); + } else if (this.proveReception(headers)) { + self.flush(); + } + + var headBuffer = ''; + + this.socket.on('data', function (data) { + if (waitingForNonce) { + headBuffer += data; + + if (headBuffer.length < 8) { + return; + } + + // Restore the connection to utf8 encoding after receiving the nonce + self.socket.setEncoding('utf8'); + waitingForNonce = false; + + // Stuff the nonce into the location where it's expected to be + self.req.head = headBuffer.substr(0, 8); + headBuffer = ''; + + if (self.proveReception(headers)) { + self.flush(); + } + + return; + } + + self.parser.add(data); + }); +}; + +/** + * Writes to the socket. + * + * @api private + */ + +WebSocket.prototype.write = function (data) { + if (this.open) { + this.drained = false; + + if (this.buffer) { + this.buffered.push(data); + return this; + } + + var length = Buffer.byteLength(data) + , buffer = new Buffer(2 + length); + + buffer.write('\x00', 'binary'); + buffer.write(data, 1, 'utf8'); + buffer.write('\xff', 1 + length, 'binary'); + + try { + if (this.socket.write(buffer)) { + this.drained = true; + } + } catch (e) { + this.end(); + } + + this.log.debug(this.name + ' writing', data); + } +}; + +/** + * Flushes the internal buffer + * + * @api private + */ + +WebSocket.prototype.flush = function () { + this.buffer = false; + + for (var i = 0, l = this.buffered.length; i < l; i++) { + this.write(this.buffered.splice(0, 1)[0]); + } +}; + +/** + * Finishes the handshake. + * + * @api private + */ + +WebSocket.prototype.proveReception = function (headers) { + var self = this + , k1 = this.req.headers['sec-websocket-key1'] + , k2 = this.req.headers['sec-websocket-key2']; + + if (k1 && k2){ + var md5 = crypto.createHash('md5'); + + [k1, k2].forEach(function (k) { + var n = parseInt(k.replace(/[^\d]/g, '')) + , spaces = k.replace(/[^ ]/g, '').length; + + if (spaces === 0 || n % spaces !== 0){ + self.log.warn('Invalid ' + self.name + ' key: "' + k + '".'); + self.end(); + return false; + } + + n /= spaces; + + md5.update(String.fromCharCode( + n >> 24 & 0xFF, + n >> 16 & 0xFF, + n >> 8 & 0xFF, + n & 0xFF)); + }); + + md5.update(this.req.head.toString('binary')); + + try { + this.socket.write(md5.digest('binary'), 'binary'); + } catch (e) { + this.end(); + } + } + + return true; +}; + +/** + * Writes a payload. + * + * @api private + */ + +WebSocket.prototype.payload = function (msgs) { + for (var i = 0, l = msgs.length; i < l; i++) { + this.write(msgs[i]); + } + + return this; +}; + +/** + * Closes the connection. + * + * @api private + */ + +WebSocket.prototype.doClose = function () { + this.socket.end(); +}; + +/** + * WebSocket parser + * + * @api public + */ + +function Parser (opts) { + this._maxBuffer = (opts && opts.maxBuffer) || 10E7; + this._dataLength = 0; + this.buffer = ''; + this.i = 0; +}; + +/** + * Inherits from EventEmitter. + */ + +Parser.prototype.__proto__ = EventEmitter.prototype; + +/** + * Adds data to the buffer. + * + * @api public + */ + +Parser.prototype.add = function (data) { + this._dataLength += data.length; + if(this._dataLength > this._maxBuffer) { + this.buffer = ''; //Clear buffer + this.emit('kick', 'max buffer size reached'); + return; + } + + this.buffer += data; + this.parse(); +}; + +/** + * Parses the buffer. + * + * @api private + */ + +Parser.prototype.parse = function () { + for (var i = this.i, chr, l = this.buffer.length; i < l; i++){ + chr = this.buffer[i]; + + if (this.buffer.length == 2 && this.buffer[1] == '\u0000') { + this.emit('close'); + this.buffer = ''; + this.i = 0; + return; + } + + if (i === 0){ + if (chr != '\u0000') + this.error('Bad framing. Expected null byte as first frame'); + else + continue; + } + + if (chr == '\ufffd'){ + this.emit('data', this.buffer.substr(1, i - 1)); + this.buffer = this.buffer.substr(i + 1); + this.i = 0; + return this.parse(); + } + } +}; + +/** + * Handles an error + * + * @api private + */ + +Parser.prototype.error = function (reason) { + this.buffer = ''; + this.i = 0; + this.emit('error', reason); + return this; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js new file mode 100644 index 00000000..8f0759db --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/hybi-07-12.js @@ -0,0 +1,642 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var Transport = require('../../transport') + , EventEmitter = process.EventEmitter + , crypto = require('crypto') + , url = require('url') + , parser = require('../../parser') + , util = require('../../util'); + +/** + * Export the constructor. + */ + +exports = module.exports = WebSocket; +exports.Parser = Parser; + +/** + * HTTP interface constructor. Interface compatible with all transports that + * depend on request-response cycles. + * + * @api public + */ + +function WebSocket (mng, data, req) { + // parser + var self = this; + + this.manager = mng; + this.parser = new Parser({maxBuffer: mng.get('destroy buffer size')}); + this.parser.on('data', function (packet) { + self.onMessage(parser.decodePacket(packet)); + }); + this.parser.on('ping', function () { + // version 8 ping => pong + try { + self.socket.write('\u008a\u0000'); + } + catch (e) { + self.end(); + return; + } + }); + this.parser.on('close', function () { + self.end(); + }); + this.parser.on('error', function (reason) { + self.log.warn(self.name + ' parser error: ' + reason); + self.end(); + }); + this.parser.on('kick', function (reason) { + self.log.warn(self.name + ' parser forced user kick: ' + reason); + self.onMessage({type: 'disconnect', endpoint: ''}); + self.end(); + }); + + Transport.call(this, mng, data, req); +}; + +/** + * Inherits from Transport. + */ + +WebSocket.prototype.__proto__ = Transport.prototype; + +/** + * Transport name + * + * @api public + */ + +WebSocket.prototype.name = 'websocket'; + +/** + * Websocket draft version + * + * @api public + */ + +WebSocket.prototype.protocolVersion = '07-12'; + +/** + * Called when the socket connects. + * + * @api private + */ + +WebSocket.prototype.onSocketConnect = function () { + var self = this; + + if (typeof this.req.headers.upgrade === 'undefined' || + this.req.headers.upgrade.toLowerCase() !== 'websocket') { + this.log.warn(this.name + ' connection invalid'); + this.end(); + return; + } + + var origin = this.req.headers['sec-websocket-origin'] + , location = ((this.manager.settings['match origin protocol'] ? + origin.match(/^https/) : this.socket.encrypted) ? + 'wss' : 'ws') + + '://' + this.req.headers.host + this.req.url; + + if (!this.verifyOrigin(origin)) { + this.log.warn(this.name + ' connection invalid: origin mismatch'); + this.end(); + return; + } + + if (!this.req.headers['sec-websocket-key']) { + this.log.warn(this.name + ' connection invalid: received no key'); + this.end(); + return; + } + + // calc key + var key = this.req.headers['sec-websocket-key']; + var shasum = crypto.createHash('sha1'); + shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); + key = shasum.digest('base64'); + + var headers = [ + 'HTTP/1.1 101 Switching Protocols' + , 'Upgrade: websocket' + , 'Connection: Upgrade' + , 'Sec-WebSocket-Accept: ' + key + ]; + + try { + this.socket.write(headers.concat('', '').join('\r\n')); + this.socket.setTimeout(0); + this.socket.setNoDelay(true); + } catch (e) { + this.end(); + return; + } + + this.socket.on('data', function (data) { + self.parser.add(data); + }); +}; + +/** + * Verifies the origin of a request. + * + * @api private + */ + +WebSocket.prototype.verifyOrigin = function (origin) { + var origins = this.manager.get('origins'); + + if (origin === 'null') origin = '*'; + + if (origins.indexOf('*:*') !== -1) { + return true; + } + + if (origin) { + try { + var parts = url.parse(origin); + parts.port = parts.port || 80; + var ok = + ~origins.indexOf(parts.hostname + ':' + parts.port) || + ~origins.indexOf(parts.hostname + ':*') || + ~origins.indexOf('*:' + parts.port); + if (!ok) this.log.warn('illegal origin: ' + origin); + return ok; + } catch (ex) { + this.log.warn('error parsing origin'); + } + } + else { + this.log.warn('origin missing from websocket call, yet required by config'); + } + return false; +}; + +/** + * Writes to the socket. + * + * @api private + */ + +WebSocket.prototype.write = function (data) { + if (this.open) { + var buf = this.frame(0x81, data); + try { + this.socket.write(buf, 'binary'); + } + catch (e) { + this.end(); + return; + } + this.log.debug(this.name + ' writing', data); + } +}; + +/** + * Writes a payload. + * + * @api private + */ + +WebSocket.prototype.payload = function (msgs) { + for (var i = 0, l = msgs.length; i < l; i++) { + this.write(msgs[i]); + } + + return this; +}; + +/** + * Frame server-to-client output as a text packet. + * + * @api private + */ + +WebSocket.prototype.frame = function (opcode, str) { + var dataBuffer = new Buffer(str) + , dataLength = dataBuffer.length + , startOffset = 2 + , secondByte = dataLength; + if (dataLength > 65536) { + startOffset = 10; + secondByte = 127; + } + else if (dataLength > 125) { + startOffset = 4; + secondByte = 126; + } + var outputBuffer = new Buffer(dataLength + startOffset); + outputBuffer[0] = opcode; + outputBuffer[1] = secondByte; + dataBuffer.copy(outputBuffer, startOffset); + switch (secondByte) { + case 126: + outputBuffer[2] = dataLength >>> 8; + outputBuffer[3] = dataLength % 256; + break; + case 127: + var l = dataLength; + for (var i = 1; i <= 8; ++i) { + outputBuffer[startOffset - i] = l & 0xff; + l >>>= 8; + } + } + return outputBuffer; +}; + +/** + * Closes the connection. + * + * @api private + */ + +WebSocket.prototype.doClose = function () { + this.socket.end(); +}; + +/** + * WebSocket parser + * + * @api public + */ + +function Parser (opts) { + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0 + }; + this.overflow = null; + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.currentMessage = ''; + this._maxBuffer = (opts && opts.maxBuffer) || 10E7; + this._dataLength = 0; + + var self = this; + this.opcodeHandlers = { + // text + '1': function(data) { + var finish = function(mask, data) { + self.currentMessage += self.unmask(mask, data); + if (self.state.lastFragment) { + self.emit('data', self.currentMessage); + self.currentMessage = ''; + } + self.endPacket(); + } + + var expectData = function(length) { + if (self.state.masked) { + self.expect('Mask', 4, function(data) { + var mask = data; + self.expect('Data', length, function(data) { + finish(mask, data); + }); + }); + } + else { + self.expect('Data', length, function(data) { + finish(null, data); + }); + } + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + expectData(firstLength); + } + else if (firstLength == 126) { + self.expect('Length', 2, function(data) { + expectData(util.unpack(data)); + }); + } + else if (firstLength == 127) { + self.expect('Length', 8, function(data) { + if (util.unpack(data.slice(0, 4)) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported'); + return; + } + var lengthBytes = data.slice(4); // note: cap to 32 bit length + expectData(util.unpack(data)); + }); + } + }, + // binary + '2': function(data) { + var finish = function(mask, data) { + if (typeof self.currentMessage == 'string') self.currentMessage = []; // build a buffer list + self.currentMessage.push(self.unmask(mask, data, true)); + if (self.state.lastFragment) { + self.emit('binary', self.concatBuffers(self.currentMessage)); + self.currentMessage = ''; + } + self.endPacket(); + } + + var expectData = function(length) { + if (self.state.masked) { + self.expect('Mask', 4, function(data) { + var mask = data; + self.expect('Data', length, function(data) { + finish(mask, data); + }); + }); + } + else { + self.expect('Data', length, function(data) { + finish(null, data); + }); + } + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + expectData(firstLength); + } + else if (firstLength == 126) { + self.expect('Length', 2, function(data) { + expectData(util.unpack(data)); + }); + } + else if (firstLength == 127) { + self.expect('Length', 8, function(data) { + if (util.unpack(data.slice(0, 4)) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported'); + return; + } + var lengthBytes = data.slice(4); // note: cap to 32 bit length + expectData(util.unpack(data)); + }); + } + }, + // close + '8': function(data) { + self.emit('close'); + self.reset(); + }, + // ping + '9': function(data) { + if (self.state.lastFragment == false) { + self.error('fragmented ping is not supported'); + return; + } + + var finish = function(mask, data) { + self.emit('ping', self.unmask(mask, data)); + self.endPacket(); + } + + var expectData = function(length) { + if (self.state.masked) { + self.expect('Mask', 4, function(data) { + var mask = data; + self.expect('Data', length, function(data) { + finish(mask, data); + }); + }); + } + else { + self.expect('Data', length, function(data) { + finish(null, data); + }); + } + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength == 0) { + finish(null, null); + } + else if (firstLength < 126) { + expectData(firstLength); + } + else if (firstLength == 126) { + self.expect('Length', 2, function(data) { + expectData(util.unpack(data)); + }); + } + else if (firstLength == 127) { + self.expect('Length', 8, function(data) { + expectData(util.unpack(data)); + }); + } + } + } + + this.expect('Opcode', 2, this.processPacket); +}; + +/** + * Inherits from EventEmitter. + */ + +Parser.prototype.__proto__ = EventEmitter.prototype; + +/** + * Add new data to the parser. + * + * @api public + */ + +Parser.prototype.add = function(data) { + this._dataLength += data.length; + if (this._dataLength > this._maxBuffer) { + // Clear data + this.overflow = null; + this.expectBuffer = null; + // Kick client + this.emit('kick', 'max buffer size reached'); + return; + } + if (this.expectBuffer == null) { + this.addToOverflow(data); + return; + } + var toRead = Math.min(data.length, this.expectBuffer.length - this.expectOffset); + data.copy(this.expectBuffer, this.expectOffset, 0, toRead); + this.expectOffset += toRead; + if (toRead < data.length) { + // at this point the overflow buffer shouldn't at all exist + this.overflow = new Buffer(data.length - toRead); + data.copy(this.overflow, 0, toRead, toRead + this.overflow.length); + } + if (this.expectOffset == this.expectBuffer.length) { + var bufferForHandler = this.expectBuffer; + this.expectBuffer = null; + this.expectOffset = 0; + this.expectHandler.call(this, bufferForHandler); + } +} + +/** + * Adds a piece of data to the overflow. + * + * @api private + */ + +Parser.prototype.addToOverflow = function(data) { + if (this.overflow == null) this.overflow = data; + else { + var prevOverflow = this.overflow; + this.overflow = new Buffer(this.overflow.length + data.length); + prevOverflow.copy(this.overflow, 0); + data.copy(this.overflow, prevOverflow.length); + } +} + +/** + * Waits for a certain amount of bytes to be available, then fires a callback. + * + * @api private + */ + +Parser.prototype.expect = function(what, length, handler) { + if (length > this._maxBuffer) { + this.emit('kick', 'expected input larger than max buffer'); + return; + } + this.expectBuffer = new Buffer(length); + this.expectOffset = 0; + this.expectHandler = handler; + if (this.overflow != null) { + var toOverflow = this.overflow; + this.overflow = null; + this.add(toOverflow); + } +} + +/** + * Start processing a new packet. + * + * @api private + */ + +Parser.prototype.processPacket = function (data) { + if ((data[0] & 0x70) != 0) { + this.error('reserved fields must be empty'); + } + this.state.lastFragment = (data[0] & 0x80) == 0x80; + this.state.masked = (data[1] & 0x80) == 0x80; + var opcode = data[0] & 0xf; + if (opcode == 0) { + // continuation frame + this.state.opcode = this.state.activeFragmentedOperation; + if (!(this.state.opcode == 1 || this.state.opcode == 2)) { + this.error('continuation frame cannot follow current opcode') + return; + } + } + else { + this.state.opcode = opcode; + if (this.state.lastFragment === false) { + this.state.activeFragmentedOperation = opcode; + } + } + var handler = this.opcodeHandlers[this.state.opcode]; + if (typeof handler == 'undefined') this.error('no handler for opcode ' + this.state.opcode); + else handler(data); +} + +/** + * Endprocessing a packet. + * + * @api private + */ + +Parser.prototype.endPacket = function() { + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + if (this.state.lastFragment && this.state.opcode == this.state.activeFragmentedOperation) { + // end current fragmented operation + this.state.activeFragmentedOperation = null; + } + this.state.lastFragment = false; + this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0; + this.state.masked = false; + this.expect('Opcode', 2, this.processPacket); +} + +/** + * Reset the parser state. + * + * @api private + */ + +Parser.prototype.reset = function() { + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0 + }; + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.overflow = null; + this.currentMessage = ''; +} + +/** + * Unmask received data. + * + * @api private + */ + +Parser.prototype.unmask = function (mask, buf, binary) { + if (mask != null) { + for (var i = 0, ll = buf.length; i < ll; i++) { + buf[i] ^= mask[i % 4]; + } + } + if (binary) return buf; + return buf != null ? buf.toString('utf8') : ''; +} + +/** + * Concatenates a list of buffers. + * + * @api private + */ + +Parser.prototype.concatBuffers = function(buffers) { + var length = 0; + for (var i = 0, l = buffers.length; i < l; ++i) { + length += buffers[i].length; + } + var mergedBuffer = new Buffer(length); + var offset = 0; + for (var i = 0, l = buffers.length; i < l; ++i) { + buffers[i].copy(mergedBuffer, offset); + offset += buffers[i].length; + } + return mergedBuffer; +} + +/** + * Handles an error + * + * @api private + */ + +Parser.prototype.error = function (reason) { + this.reset(); + this.emit('error', reason); + return this; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/hybi-16.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/hybi-16.js new file mode 100644 index 00000000..2074fa16 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/hybi-16.js @@ -0,0 +1,642 @@ +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var Transport = require('../../transport') + , EventEmitter = process.EventEmitter + , crypto = require('crypto') + , url = require('url') + , parser = require('../../parser') + , util = require('../../util'); + +/** + * Export the constructor. + */ + +exports = module.exports = WebSocket; +exports.Parser = Parser; + +/** + * HTTP interface constructor. Interface compatible with all transports that + * depend on request-response cycles. + * + * @api public + */ + +function WebSocket (mng, data, req) { + // parser + var self = this; + + this.manager = mng; + this.parser = new Parser({maxBuffer: mng.get('destroy buffer size')}); + this.parser.on('data', function (packet) { + self.onMessage(parser.decodePacket(packet)); + }); + this.parser.on('ping', function () { + // version 8 ping => pong + try { + self.socket.write('\u008a\u0000'); + } + catch (e) { + self.end(); + return; + } + }); + this.parser.on('close', function () { + self.end(); + }); + this.parser.on('error', function (reason) { + self.log.warn(self.name + ' parser error: ' + reason); + self.end(); + }); + this.parser.on('kick', function (reason) { + self.log.warn(self.name + ' parser forced user kick: ' + reason); + self.onMessage({type: 'disconnect', endpoint: ''}); + self.end(); + }); + + Transport.call(this, mng, data, req); +}; + +/** + * Inherits from Transport. + */ + +WebSocket.prototype.__proto__ = Transport.prototype; + +/** + * Transport name + * + * @api public + */ + +WebSocket.prototype.name = 'websocket'; + +/** + * Websocket draft version + * + * @api public + */ + +WebSocket.prototype.protocolVersion = '16'; + +/** + * Called when the socket connects. + * + * @api private + */ + +WebSocket.prototype.onSocketConnect = function () { + var self = this; + + if (typeof this.req.headers.upgrade === 'undefined' || + this.req.headers.upgrade.toLowerCase() !== 'websocket') { + this.log.warn(this.name + ' connection invalid'); + this.end(); + return; + } + + var origin = this.req.headers['origin'] || '' + , location = ((this.manager.settings['match origin protocol'] ? + origin.match(/^https/) : this.socket.encrypted) ? + 'wss' : 'ws') + + '://' + this.req.headers.host + this.req.url; + + if (!this.verifyOrigin(origin)) { + this.log.warn(this.name + ' connection invalid: origin mismatch'); + this.end(); + return; + } + + if (!this.req.headers['sec-websocket-key']) { + this.log.warn(this.name + ' connection invalid: received no key'); + this.end(); + return; + } + + // calc key + var key = this.req.headers['sec-websocket-key']; + var shasum = crypto.createHash('sha1'); + shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); + key = shasum.digest('base64'); + + var headers = [ + 'HTTP/1.1 101 Switching Protocols' + , 'Upgrade: websocket' + , 'Connection: Upgrade' + , 'Sec-WebSocket-Accept: ' + key + ]; + + try { + this.socket.write(headers.concat('', '').join('\r\n')); + this.socket.setTimeout(0); + this.socket.setNoDelay(true); + } catch (e) { + this.end(); + return; + } + + this.socket.on('data', function (data) { + self.parser.add(data); + }); +}; + +/** + * Verifies the origin of a request. + * + * @api private + */ + +WebSocket.prototype.verifyOrigin = function (origin) { + var origins = this.manager.get('origins'); + + if (origin === 'null') origin = '*'; + + if (origins.indexOf('*:*') !== -1) { + return true; + } + + if (origin) { + try { + var parts = url.parse(origin); + parts.port = parts.port || 80; + var ok = + ~origins.indexOf(parts.hostname + ':' + parts.port) || + ~origins.indexOf(parts.hostname + ':*') || + ~origins.indexOf('*:' + parts.port); + if (!ok) this.log.warn('illegal origin: ' + origin); + return ok; + } catch (ex) { + this.log.warn('error parsing origin'); + } + } + else { + this.log.warn('origin missing from websocket call, yet required by config'); + } + return false; +}; + +/** + * Writes to the socket. + * + * @api private + */ + +WebSocket.prototype.write = function (data) { + if (this.open) { + var buf = this.frame(0x81, data); + try { + this.socket.write(buf, 'binary'); + } + catch (e) { + this.end(); + return; + } + this.log.debug(this.name + ' writing', data); + } +}; + +/** + * Writes a payload. + * + * @api private + */ + +WebSocket.prototype.payload = function (msgs) { + for (var i = 0, l = msgs.length; i < l; i++) { + this.write(msgs[i]); + } + + return this; +}; + +/** + * Frame server-to-client output as a text packet. + * + * @api private + */ + +WebSocket.prototype.frame = function (opcode, str) { + var dataBuffer = new Buffer(str) + , dataLength = dataBuffer.length + , startOffset = 2 + , secondByte = dataLength; + if (dataLength > 65536) { + startOffset = 10; + secondByte = 127; + } + else if (dataLength > 125) { + startOffset = 4; + secondByte = 126; + } + var outputBuffer = new Buffer(dataLength + startOffset); + outputBuffer[0] = opcode; + outputBuffer[1] = secondByte; + dataBuffer.copy(outputBuffer, startOffset); + switch (secondByte) { + case 126: + outputBuffer[2] = dataLength >>> 8; + outputBuffer[3] = dataLength % 256; + break; + case 127: + var l = dataLength; + for (var i = 1; i <= 8; ++i) { + outputBuffer[startOffset - i] = l & 0xff; + l >>>= 8; + } + } + return outputBuffer; +}; + +/** + * Closes the connection. + * + * @api private + */ + +WebSocket.prototype.doClose = function () { + this.socket.end(); +}; + +/** + * WebSocket parser + * + * @api public + */ + +function Parser (opts) { + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0 + }; + this.overflow = null; + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.currentMessage = ''; + this._maxBuffer = (opts && opts.maxBuffer) || 10E7; + this._dataLength = 0; + + var self = this; + this.opcodeHandlers = { + // text + '1': function(data) { + var finish = function(mask, data) { + self.currentMessage += self.unmask(mask, data); + if (self.state.lastFragment) { + self.emit('data', self.currentMessage); + self.currentMessage = ''; + } + self.endPacket(); + } + + var expectData = function(length) { + if (self.state.masked) { + self.expect('Mask', 4, function(data) { + var mask = data; + self.expect('Data', length, function(data) { + finish(mask, data); + }); + }); + } + else { + self.expect('Data', length, function(data) { + finish(null, data); + }); + } + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + expectData(firstLength); + } + else if (firstLength == 126) { + self.expect('Length', 2, function(data) { + expectData(util.unpack(data)); + }); + } + else if (firstLength == 127) { + self.expect('Length', 8, function(data) { + if (util.unpack(data.slice(0, 4)) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported'); + return; + } + var lengthBytes = data.slice(4); // note: cap to 32 bit length + expectData(util.unpack(data)); + }); + } + }, + // binary + '2': function(data) { + var finish = function(mask, data) { + if (typeof self.currentMessage == 'string') self.currentMessage = []; // build a buffer list + self.currentMessage.push(self.unmask(mask, data, true)); + if (self.state.lastFragment) { + self.emit('binary', self.concatBuffers(self.currentMessage)); + self.currentMessage = ''; + } + self.endPacket(); + } + + var expectData = function(length) { + if (self.state.masked) { + self.expect('Mask', 4, function(data) { + var mask = data; + self.expect('Data', length, function(data) { + finish(mask, data); + }); + }); + } + else { + self.expect('Data', length, function(data) { + finish(null, data); + }); + } + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + expectData(firstLength); + } + else if (firstLength == 126) { + self.expect('Length', 2, function(data) { + expectData(util.unpack(data)); + }); + } + else if (firstLength == 127) { + self.expect('Length', 8, function(data) { + if (util.unpack(data.slice(0, 4)) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported'); + return; + } + var lengthBytes = data.slice(4); // note: cap to 32 bit length + expectData(util.unpack(data)); + }); + } + }, + // close + '8': function(data) { + self.emit('close'); + self.reset(); + }, + // ping + '9': function(data) { + if (self.state.lastFragment == false) { + self.error('fragmented ping is not supported'); + return; + } + + var finish = function(mask, data) { + self.emit('ping', self.unmask(mask, data)); + self.endPacket(); + } + + var expectData = function(length) { + if (self.state.masked) { + self.expect('Mask', 4, function(data) { + var mask = data; + self.expect('Data', length, function(data) { + finish(mask, data); + }); + }); + } + else { + self.expect('Data', length, function(data) { + finish(null, data); + }); + } + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength == 0) { + finish(null, null); + } + else if (firstLength < 126) { + expectData(firstLength); + } + else if (firstLength == 126) { + self.expect('Length', 2, function(data) { + expectData(util.unpack(data)); + }); + } + else if (firstLength == 127) { + self.expect('Length', 8, function(data) { + expectData(util.unpack(data)); + }); + } + } + } + + this.expect('Opcode', 2, this.processPacket); +}; + +/** + * Inherits from EventEmitter. + */ + +Parser.prototype.__proto__ = EventEmitter.prototype; + +/** + * Add new data to the parser. + * + * @api public + */ + +Parser.prototype.add = function(data) { + this._dataLength += data.length; + if (this._dataLength > this._maxBuffer) { + // Clear data + this.overflow = null; + this.expectBuffer = null; + // Kick client + this.emit('kick', 'max buffer size reached'); + return; + } + if (this.expectBuffer == null) { + this.addToOverflow(data); + return; + } + var toRead = Math.min(data.length, this.expectBuffer.length - this.expectOffset); + data.copy(this.expectBuffer, this.expectOffset, 0, toRead); + this.expectOffset += toRead; + if (toRead < data.length) { + // at this point the overflow buffer shouldn't at all exist + this.overflow = new Buffer(data.length - toRead); + data.copy(this.overflow, 0, toRead, toRead + this.overflow.length); + } + if (this.expectOffset == this.expectBuffer.length) { + var bufferForHandler = this.expectBuffer; + this.expectBuffer = null; + this.expectOffset = 0; + this.expectHandler.call(this, bufferForHandler); + } +} + +/** + * Adds a piece of data to the overflow. + * + * @api private + */ + +Parser.prototype.addToOverflow = function(data) { + if (this.overflow == null) this.overflow = data; + else { + var prevOverflow = this.overflow; + this.overflow = new Buffer(this.overflow.length + data.length); + prevOverflow.copy(this.overflow, 0); + data.copy(this.overflow, prevOverflow.length); + } +} + +/** + * Waits for a certain amount of bytes to be available, then fires a callback. + * + * @api private + */ + +Parser.prototype.expect = function(what, length, handler) { + if (length > this._maxBuffer) { + this.emit('kick', 'expected input larger than max buffer'); + return; + } + this.expectBuffer = new Buffer(length); + this.expectOffset = 0; + this.expectHandler = handler; + if (this.overflow != null) { + var toOverflow = this.overflow; + this.overflow = null; + this.add(toOverflow); + } +} + +/** + * Start processing a new packet. + * + * @api private + */ + +Parser.prototype.processPacket = function (data) { + if ((data[0] & 0x70) != 0) { + this.error('reserved fields must be empty'); + return; + } + this.state.lastFragment = (data[0] & 0x80) == 0x80; + this.state.masked = (data[1] & 0x80) == 0x80; + var opcode = data[0] & 0xf; + if (opcode == 0) { + // continuation frame + this.state.opcode = this.state.activeFragmentedOperation; + if (!(this.state.opcode == 1 || this.state.opcode == 2)) { + this.error('continuation frame cannot follow current opcode') + return; + } + } + else { + this.state.opcode = opcode; + if (this.state.lastFragment === false) { + this.state.activeFragmentedOperation = opcode; + } + } + var handler = this.opcodeHandlers[this.state.opcode]; + if (typeof handler == 'undefined') this.error('no handler for opcode ' + this.state.opcode); + else handler(data); +} + +/** + * Endprocessing a packet. + * + * @api private + */ + +Parser.prototype.endPacket = function() { + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + if (this.state.lastFragment && this.state.opcode == this.state.activeFragmentedOperation) { + // end current fragmented operation + this.state.activeFragmentedOperation = null; + } + this.state.lastFragment = false; + this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0; + this.state.masked = false; + this.expect('Opcode', 2, this.processPacket); +} + +/** + * Reset the parser state. + * + * @api private + */ + +Parser.prototype.reset = function() { + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0 + }; + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.overflow = null; + this.currentMessage = ''; +} + +/** + * Unmask received data. + * + * @api private + */ + +Parser.prototype.unmask = function (mask, buf, binary) { + if (mask != null) { + for (var i = 0, ll = buf.length; i < ll; i++) { + buf[i] ^= mask[i % 4]; + } + } + if (binary) return buf; + return buf != null ? buf.toString('utf8') : ''; +} + +/** + * Concatenates a list of buffers. + * + * @api private + */ + +Parser.prototype.concatBuffers = function(buffers) { + var length = 0; + for (var i = 0, l = buffers.length; i < l; ++i) { + length += buffers[i].length; + } + var mergedBuffer = new Buffer(length); + var offset = 0; + for (var i = 0, l = buffers.length; i < l; ++i) { + buffers[i].copy(mergedBuffer, offset); + offset += buffers[i].length; + } + return mergedBuffer; +} + +/** + * Handles an error + * + * @api private + */ + +Parser.prototype.error = function (reason) { + this.reset(); + this.emit('error', reason); + return this; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/index.js new file mode 100644 index 00000000..3a952b75 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/websocket/index.js @@ -0,0 +1,11 @@ + +/** + * Export websocket versions. + */ + +module.exports = { + 7: require('./hybi-07-12'), + 8: require('./hybi-07-12'), + 13: require('./hybi-16'), + default: require('./default') +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/xhr-polling.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/xhr-polling.js new file mode 100644 index 00000000..1db5aeee --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/transports/xhr-polling.js @@ -0,0 +1,69 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module requirements. + */ + +var HTTPPolling = require('./http-polling'); + +/** + * Export the constructor. + */ + +exports = module.exports = XHRPolling; + +/** + * Ajax polling transport. + * + * @api public + */ + +function XHRPolling (mng, data, req) { + HTTPPolling.call(this, mng, data, req); +}; + +/** + * Inherits from Transport. + */ + +XHRPolling.prototype.__proto__ = HTTPPolling.prototype; + +/** + * Transport name + * + * @api public + */ + +XHRPolling.prototype.name = 'xhr-polling'; + +/** + * Frames data prior to write. + * + * @api private + */ + +XHRPolling.prototype.doWrite = function (data) { + HTTPPolling.prototype.doWrite.call(this); + + var origin = this.req.headers.origin + , headers = { + 'Content-Type': 'text/plain; charset=UTF-8' + , 'Content-Length': data === undefined ? 0 : Buffer.byteLength(data) + , 'Connection': 'Keep-Alive' + }; + + if (origin) { + // https://developer.mozilla.org/En/HTTP_Access_Control + headers['Access-Control-Allow-Origin'] = origin; + headers['Access-Control-Allow-Credentials'] = 'true'; + } + + this.response.writeHead(200, headers); + this.response.write(data); + this.log.debug(this.name + ' writing', data); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/util.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/util.js new file mode 100644 index 00000000..f7d9f2b4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/lib/util.js @@ -0,0 +1,50 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +/** + * Converts an enumerable to an array. + * + * @api public + */ + +exports.toArray = function (enu) { + var arr = []; + + for (var i = 0, l = enu.length; i < l; i++) + arr.push(enu[i]); + + return arr; +}; + +/** + * Unpacks a buffer to a number. + * + * @api public + */ + +exports.unpack = function (buffer) { + var n = 0; + for (var i = 0; i < buffer.length; ++i) { + n = (i == 0) ? buffer[i] : (n * 256) + buffer[i]; + } + return n; +} + +/** + * Left pads a string. + * + * @api public + */ + +exports.padl = function (s,n,c) { + return new Array(1 + n - s.length).join(c) + s; +} + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/.npmignore new file mode 100644 index 00000000..39e9864f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/.npmignore @@ -0,0 +1,3 @@ +support +test +examples diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/README.md new file mode 100644 index 00000000..b4361c15 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/README.md @@ -0,0 +1,18 @@ +base64id +======== + +Node.js module that generates a base64 id. + +Uses crypto.randomBytes when available, falls back to unsafe methods for node.js <= 0.4. + +To increase performance, random bytes are buffered to minimize the number of synchronous calls to crypto.randomBytes. + +## Installation + + $ npm install mongoose + +## Usage + + var base64id = require('base64id'); + + var id = base64id.generateId(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/lib/base64id.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/lib/base64id.js new file mode 100644 index 00000000..f6881597 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/lib/base64id.js @@ -0,0 +1,103 @@ +/*! + * base64id v0.1.0 + */ + +/** + * Module dependencies + */ + +var crypto = require('crypto'); + +/** + * Constructor + */ + +var Base64Id = function() { }; + +/** + * Get random bytes + * + * Uses a buffer if available, falls back to crypto.randomBytes + */ + +Base64Id.prototype.getRandomBytes = function(bytes) { + + var BUFFER_SIZE = 4096 + var self = this; + + bytes = bytes || 12; + + if (bytes > BUFFER_SIZE) { + return crypto.randomBytes(bytes); + } + + var bytesInBuffer = parseInt(BUFFER_SIZE/bytes); + var threshold = parseInt(bytesInBuffer*0.85); + + if (!threshold) { + return crypto.randomBytes(bytes); + } + + if (this.bytesBufferIndex == null) { + this.bytesBufferIndex = -1; + } + + if (this.bytesBufferIndex == bytesInBuffer) { + this.bytesBuffer = null; + this.bytesBufferIndex = -1; + } + + // No buffered bytes available or index above threshold + if (this.bytesBufferIndex == -1 || this.bytesBufferIndex > threshold) { + + if (!this.isGeneratingBytes) { + this.isGeneratingBytes = true; + crypto.randomBytes(BUFFER_SIZE, function(err, bytes) { + self.bytesBuffer = bytes; + self.bytesBufferIndex = 0; + self.isGeneratingBytes = false; + }); + } + + // Fall back to sync call when no buffered bytes are available + if (this.bytesBufferIndex == -1) { + return crypto.randomBytes(bytes); + } + } + + var result = this.bytesBuffer.slice(bytes*this.bytesBufferIndex, bytes*(this.bytesBufferIndex+1)); + this.bytesBufferIndex++; + + return result; +} + +/** + * Generates a base64 id + * + * (Original version from socket.io ) + */ + +Base64Id.prototype.generateId = function () { + var rand = new Buffer(15); // multiple of 3 for base64 + if (!rand.writeInt32BE) { + return Math.abs(Math.random() * Math.random() * Date.now() | 0).toString() + + Math.abs(Math.random() * Math.random() * Date.now() | 0).toString(); + } + this.sequenceNumber = (this.sequenceNumber + 1) | 0; + rand.writeInt32BE(this.sequenceNumber, 11); + if (crypto.randomBytes) { + this.getRandomBytes(12).copy(rand); + } else { + // not secure for node 0.4 + [0, 4, 8].forEach(function(i) { + rand.writeInt32BE(Math.random() * Math.pow(2, 32) | 0, i); + }); + } + return rand.toString('base64').replace(/\//g, '_').replace(/\+/g, '-'); +}; + +/** + * Export + */ + +exports = module.exports = new Base64Id(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/package.json new file mode 100644 index 00000000..e4321f5b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/base64id/package.json @@ -0,0 +1,48 @@ +{ + "name": "base64id", + "version": "0.1.0", + "description": "Generates a base64 id", + "author": { + "name": "Kristian Faeldt", + "email": "faeldt_kristian@cyberagent.co.jp" + }, + "repository": { + "type": "git", + "url": "git://github.com/faeldt/base64id.git" + }, + "main": "./lib/base64id.js", + "engines": { + "node": ">= 0.4.0" + }, + "_npmUser": { + "name": "faeldt_kristian", + "email": "faeldt_kristian@cyberagent.co.jp" + }, + "_id": "base64id@0.1.0", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.1.16", + "_nodeVersion": "v0.6.15", + "_defaultsLoaded": true, + "dist": { + "shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f", + "tarball": "http://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz" + }, + "maintainers": [ + { + "name": "faeldt_kristian", + "email": "faeldt_kristian@cyberagent.co.jp" + } + ], + "directories": {}, + "_shasum": "02ce0fdeee0cef4f40080e1e73e834f0b1bfce3f", + "_resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz", + "_from": "base64id@0.1.0", + "bugs": { + "url": "https://github.com/faeldt/base64id/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/faeldt/base64id#readme" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/.npmignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/.npmignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/LICENSE new file mode 100644 index 00000000..bdb8f617 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011 Arnout Kazemier,3rd-Eden + +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. \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/Makefile new file mode 100644 index 00000000..1362d66a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/Makefile @@ -0,0 +1,7 @@ +doc: + dox --title "FlashPolicyFileServer" lib/* > doc/index.html + +test: + expresso -I lib $(TESTFLAGS) tests/*.test.js + +.PHONY: test doc \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/README.md new file mode 100644 index 00000000..527921ee --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/README.md @@ -0,0 +1,98 @@ +## LOL, WUT? +It basically allows you to allow or disallow Flash Player sockets from accessing your site. + +## Installation + +```bash +npm install policyfile +``` +## Usage + +The server is based on the regular and know `net` and `http` server patterns. So it you can just listen +for all the events that a `net` based server emits etc. But there is one extra event, the `connect_failed` +event. This event is triggered when we are unable to listen on the supplied port number. + +### createServer +Creates a new server instance and accepts 2 optional arguments: + +- `options` **Object** Options to configure the server instance + - `log` **Boolean** Enable logging to STDOUT and STDERR (defaults to true) +- `origins` **Array** An Array of origins that are allowed by the server (defaults to *:*) + +```js +var pf = require('policyfile'); +pf.createServer(); +pf.listen(); +``` + +#### server.listen +Start listening on the server and it takes 3 optional arguments + +- `port` **Number** On which port number should we listen? (defaults to 843, which is the first port number the FlashPlayer checks) +- `server` **Server** A http server, if we are unable to accept requests or run the server we can also answer the policy requests inline over the supplied HTTP server. +- `callback` **Function** A callback function that is called when listening to the server was successful. + +```js +var pf = require('policyfile'); +pf.createServer(); +pf.listen(1337, function(){ + console.log(':3 yay') +}); +``` + +Changing port numbers can be handy if you do not want to run your server as root and have port 843 forward to a non root port number (aka a number above 1024). + +```js +var pf = require('policyfile') + , http = require('http'); + +server = http.createServer(function(q,r){r.writeHead(200);r.end('hello world')}); +server.listen(80); + +pf.createServer(); +pf.listen(1337, server, function(){ + console.log(':3 yay') +}); +``` + +Support for serving inline requests over a existing HTTP connection as the FlashPlayer will first check port 843, but if it's unable to get a response there it will send a policy file request over port 80, which is usually your http server. + +#### server.add +Adds more origins to the policy file you can add as many arguments as you like. + +```js +var pf = require('policyfile'); +pf.createServer(['google.com:80']); +pf.listen(); +pf.add('blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080'); // now has 3 origins +``` + +#### server.add +Adds more origins to the policy file you can add as many arguments as you like. + +```js +var pf = require('policyfile'); +pf.createServer(['blog.3rd-Eden.com:80', 'blog.3rd-Eden.com:8080']); +pf.listen(); +pf.remove('blog.3rd-Eden.com:8080'); // only contains the :80 version now +``` + +#### server.close +Shuts down the server + +```js +var pf = require('policyfile'); +pf.createServer(); +pf.listen(); +pf.close(); // OH NVM. +``` + +## API +http://3rd-eden.com/FlashPolicyFileServer/ + +## Examples +See https://github.com/3rd-Eden/FlashPolicyFileServer/tree/master/examples for examples + +## Licence + +MIT see LICENSE file in the repository \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/doc/index.html b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/doc/index.html new file mode 100644 index 00000000..743fcdaf --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/doc/index.html @@ -0,0 +1,375 @@ + + + FlashPolicyFileServer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

FlashPolicyFileServer

server

lib/server.js
+

Module dependencies and cached references. +

+
+
var slice = Array.prototype.slice
+  , net = require('net');
+
+

The server that does the Policy File severing

+ +

Options

+ +
  • log false or a function that can output log information, defaults to console.log?
+ +

+ +
  • param: Object options Options to customize the servers functionality.

  • param: Array origins The origins that are allowed on this server, defaults to *:*.

  • api: public

+
+
function Server(options, origins){
+  var me = this;
+  
+  this.origins = origins || ['*:*'];
+  this.port = 843;
+  this.log = console.log;
+  
+  // merge `this` with the options
+  Object.keys(options).forEach(function(key){
+    me[key] &amp;&amp; (me[key] = options[key])
+  });
+  
+  // create the net server
+  this.socket = net.createServer(function createServer(socket){
+    socket.on('error', function socketError(){ me.responder.call(me, socket) });
+    me.responder.call(me, socket);
+  });
+  
+  // Listen for errors as the port might be blocked because we do not have root priv.
+  this.socket.on('error', function serverError(err){
+    // Special and common case error handling
+    if (err.errno == 13){
+      me.log &amp;&amp; me.log(
+        'Unable to listen to port `' + me.port + '` as your Node.js instance does not have root privileges. ' +
+        (
+          me.server
+          ? 'The Flash Policy file will now be served inline over the supplied HTTP server, Flash Policy files request will suffer.'
+          : 'No fallback server supplied.'
+        )
+      );
+      
+      me.socket.removeAllListeners();
+      delete me.socket;
+
+      me.emit('connect_failed', err);
+    } else {
+      me.log &amp;&amp; me.log('FlashPolicyFileServer received a error event:\n' + (err.message ? err.message : err));
+    }
+  });
+  
+  this.socket.on('timeout', function serverTimeout(){});
+  this.socket.on('close', function serverClosed(err){
+    err &amp;&amp; me.log &amp;&amp; me.log('Server closing due to an error: \n' + (err.message ? err.message : err));
+    
+    if (me.server){
+      // not online anymore
+      delete me.server.online;
+      
+      // Remove the inline policy listener if we close down
+      // but only when the server was `online` (see listen prototype)
+      if( me.server['@'] &amp;&amp; me.server.online){
+        me.server.removeListener('connection', me.server['@']);
+      }
+    }
+    me.log &amp;&amp; me.log('Shutting down FlashPolicyFileServer');
+  });
+  
+  // Compile the initial `buffer`
+  this.compile();
+}
+
+

Start listening for requests

+ +

+ +
  • param: Number port The port number it should be listening to.

  • param: Server server A HTTP server instance, this will be used to listen for inline requests

  • param: Function cb The callback needs to be called once server is ready

  • api: public

+
+
Server.prototype.listen = function listen(port, server, cb){
+  var me = this
+    , args = slice.call(arguments, 0)
+    , callback;
+  
+  // assign the correct vars, for flexible arguments
+  args.forEach(function args(arg){
+    var type = typeof arg;
+    
+    if (type === 'number') me.port = arg;
+    if (type === 'function') callback = arg;
+    if (type === 'object') me.server = arg;
+  });
+  
+  if (this.server){
+    
+    // no one in their right mind would ever create a `@` prototype, so Im just gonna store
+    // my function on the server, so I can remove it later again once the server(s) closes
+    this.server['@'] = function connection(socket){
+      socket.once('data', function requestData(data){
+        // if it's a Flash policy request, and we can write to the 
+        if (
+             data
+          &amp;&amp; data[0] === 60
+          &amp;&amp; data.toString() === '<policy-file-request/>\0'
+          &amp;&amp; socket
+          &amp;&amp; (socket.readyState === 'open' || socket.readyState === 'writeOnly')
+        ){
+          // send the buffer
+          socket.end(me.buffer);
+        }
+      });
+    };
+    // attach it
+    this.server.on('connection', this.server['@']);
+  }
+  
+  // We add a callback method, so we can set a flag for when the server is `enabled` or `online`.
+  // this flag is needed because if a error occurs and the we cannot boot up the server the
+  // fallback functionality should not be removed during the `close` event
+  this.socket.listen(this.port, function serverListening(){
+   me.socket.online = true;
+   
+   if (callback) callback(), callback = undefined;
+   
+  });
+  
+  return this;
+};
+
+

Adds a new origin to the Flash Policy File.

+ +

+ +
  • param: Arguments The origins that need to be added.

  • api: public

+
+
Server.prototype.add = function add(){
+  var args = slice.call(arguments, 0)
+    , i = args.length;
+  
+  // flag duplicates
+  while (i--){
+    if (this.origins.indexOf(args[i]) &gt;= 0){
+      args[i] = null;
+    }
+  }
+  
+  // Add all the arguments to the array
+  // but first we want to remove all `falsy` values from the args
+  Array.prototype.push.apply(
+    this.origins
+  , args.filter(function(value){ return !!value })
+  );
+  
+  this.compile();
+  return this;
+};
+
+

Removes a origin from the Flash Policy File.

+ +

+ +
  • param: String origin The origin that needs to be removed from the server

  • api: public

+
+
Server.prototype.remove = function remove(origin){
+  var position = this.origins.indexOf(origin);
+  
+  // only remove and recompile if we have a match
+  if (position &gt; 0){
+    this.origins.splice(position,1);
+    this.compile();
+  }
+  
+  return this;
+};
+
+

Closes and cleans up the server

+ +
  • api: public

+
+
Server.prototype.close = function close(){
+  this.socket.removeAllListeners();
+  this.socket.close();
+  
+  return this;
+};
+
+

Proxy the event listener requests to the created Net server +

+
+
Object.keys(process.EventEmitter.prototype).forEach(function proxy(key){
+  Server.prototype[key] = Server.prototype[key] || function (){
+    if (this.socket) this.socket[key].apply(this.socket, arguments);
+    return this;
+  };
+});
+
+

Creates a new server instance.

+ +

+ +
  • param: Object options A options object to override the default config

  • param: Array origins The origins that should be allowed by the server

  • api: public

+
+
exports.createServer = function createServer(options, origins){
+  origins = Array.isArray(origins) ? origins : (Array.isArray(options) ? options : false);
+  options = !Array.isArray(options) &amp;&amp; options ? options : {};
+  
+  return new Server(options, origins);
+};
+
+

Provide a hook to the original server, so it can be extended if needed. +

+
+
exports.Server = Server;
+
+

Module version +

+
+
exports.version = '0.0.2';
+
+
\ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/examples/basic.fallback.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/examples/basic.fallback.js new file mode 100644 index 00000000..b439449a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/examples/basic.fallback.js @@ -0,0 +1,8 @@ +var http = require('http') + , fspfs = require('../'); + +var server = http.createServer(function(q,r){ r.writeHead(200); r.end(':3') }) + , flash = fspfs.createServer(); + +server.listen(8080); +flash.listen(8081,server); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/examples/basic.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/examples/basic.js new file mode 100644 index 00000000..5e2290f7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/examples/basic.js @@ -0,0 +1,5 @@ +var http = require('http') + , fspfs = require('../'); + +var flash = fspfs.createServer(); +flash.listen(); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/index.js new file mode 100644 index 00000000..60cf2989 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/index.js @@ -0,0 +1 @@ +module.exports = require('./lib/server.js'); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/lib/server.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/lib/server.js new file mode 100644 index 00000000..a525772b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/lib/server.js @@ -0,0 +1,289 @@ +/** + * Module dependencies and cached references. + */ + +var slice = Array.prototype.slice + , net = require('net'); + +/** + * The server that does the Policy File severing + * + * Options: + * - `log` false or a function that can output log information, defaults to console.log? + * + * @param {Object} options Options to customize the servers functionality. + * @param {Array} origins The origins that are allowed on this server, defaults to `*:*`. + * @api public + */ + +function Server (options, origins) { + var me = this; + + this.origins = origins || ['*:*']; + this.port = 843; + this.log = console.log; + + // merge `this` with the options + Object.keys(options).forEach(function (key) { + me[key] && (me[key] = options[key]) + }); + + // create the net server + this.socket = net.createServer(function createServer (socket) { + socket.on('error', function socketError () { + me.responder.call(me, socket); + }); + + me.responder.call(me, socket); + }); + + // Listen for errors as the port might be blocked because we do not have root priv. + this.socket.on('error', function serverError (err) { + // Special and common case error handling + if (err.errno == 13) { + me.log && me.log( + 'Unable to listen to port `' + me.port + '` as your Node.js instance does not have root privileges. ' + + ( + me.server + ? 'The Flash Policy File requests will only be served inline over the supplied HTTP server. Inline serving is slower than a dedicated server instance.' + : 'No fallback server supplied, we will be unable to answer Flash Policy File requests.' + ) + ); + + me.emit('connect_failed', err); + me.socket.removeAllListeners(); + delete me.socket; + } else { + me.log && me.log('FlashPolicyFileServer received an error event:\n' + (err.message ? err.message : err)); + } + }); + + this.socket.on('timeout', function serverTimeout () {}); + this.socket.on('close', function serverClosed (err) { + err && me.log && me.log('Server closing due to an error: \n' + (err.message ? err.message : err)); + + if (me.server) { + // Remove the inline policy listener if we close down + // but only when the server was `online` (see listen prototype) + if (me.server['@'] && me.server.online) { + me.server.removeListener('connection', me.server['@']); + } + + // not online anymore + delete me.server.online; + } + }); + + // Compile the initial `buffer` + this.compile(); +} + +/** + * Start listening for requests + * + * @param {Number} port The port number it should be listening to. + * @param {Server} server A HTTP server instance, this will be used to listen for inline requests + * @param {Function} cb The callback needs to be called once server is ready + * @api public + */ + +Server.prototype.listen = function listen (port, server, cb){ + var me = this + , args = slice.call(arguments, 0) + , callback; + + // assign the correct vars, for flexible arguments + args.forEach(function args (arg){ + var type = typeof arg; + + if (type === 'number') me.port = arg; + if (type === 'function') callback = arg; + if (type === 'object') me.server = arg; + }); + + if (this.server) { + + // no one in their right mind would ever create a `@` prototype, so Im just gonna store + // my function on the server, so I can remove it later again once the server(s) closes + this.server['@'] = function connection (socket) { + socket.once('data', function requestData (data) { + // if it's a Flash policy request, and we can write to the + if ( + data + && data[0] === 60 + && data.toString() === '\0' + && socket + && (socket.readyState === 'open' || socket.readyState === 'writeOnly') + ){ + // send the buffer + try { + socket.end(me.buffer); + } catch (e) {} + } + }); + }; + + // attach it + this.server.on('connection', this.server['@']); + } + + // We add a callback method, so we can set a flag for when the server is `enabled` or `online`. + // this flag is needed because if a error occurs and the we cannot boot up the server the + // fallback functionality should not be removed during the `close` event + this.port >= 0 && this.socket.listen(this.port, function serverListening () { + me.socket.online = true; + if (callback) { + callback.call(me); + callback = undefined; + } + }); + + return this; +}; + +/** + * Responds to socket connects and writes the compile policy file. + * + * @param {net.Socket} socket The socket that needs to receive the message + * @api private + */ + +Server.prototype.responder = function responder (socket){ + if (socket && socket.readyState == 'open' && socket.end) { + try { + socket.end(this.buffer); + } catch (e) {} + } +}; + +/** + * Compiles the supplied origins to a Flash Policy File format and stores it in a Node.js Buffer + * this way it can be send over the wire without any performance loss. + * + * @api private + */ + +Server.prototype.compile = function compile (){ + var xml = [ + '' + , '' + , '' + ]; + + // add the allow access element + this.origins.forEach(function origin (origin){ + var parts = origin.split(':'); + xml.push(''); + }); + + xml.push(''); + + // store the result in a buffer so we don't have to re-generate it all the time + this.buffer = new Buffer(xml.join(''), 'utf8'); + + return this; +}; + +/** + * Adds a new origin to the Flash Policy File. + * + * @param {Arguments} The origins that need to be added. + * @api public + */ + +Server.prototype.add = function add(){ + var args = slice.call(arguments, 0) + , i = args.length; + + // flag duplicates + while (i--) { + if (this.origins.indexOf(args[i]) >= 0){ + args[i] = null; + } + } + + // Add all the arguments to the array + // but first we want to remove all `falsy` values from the args + Array.prototype.push.apply( + this.origins + , args.filter(function filter (value) { + return !!value; + }) + ); + + this.compile(); + return this; +}; + +/** + * Removes a origin from the Flash Policy File. + * + * @param {String} origin The origin that needs to be removed from the server + * @api public + */ + +Server.prototype.remove = function remove (origin){ + var position = this.origins.indexOf(origin); + + // only remove and recompile if we have a match + if (position > 0) { + this.origins.splice(position,1); + this.compile(); + } + + return this; +}; + +/** + * Closes and cleans up the server + * + * @api public + */ + +Server.prototype.close = function close () { + this.socket.removeAllListeners(); + this.socket.close(); + + return this; +}; + +/** + * Proxy the event listener requests to the created Net server + */ + +Object.keys(process.EventEmitter.prototype).forEach(function proxy (key){ + Server.prototype[key] = Server.prototype[key] || function () { + if (this.socket) { + this.socket[key].apply(this.socket, arguments); + } + + return this; + }; +}); + +/** + * Creates a new server instance. + * + * @param {Object} options A options object to override the default config + * @param {Array} origins The origins that should be allowed by the server + * @api public + */ + +exports.createServer = function createServer(options, origins){ + origins = Array.isArray(origins) ? origins : (Array.isArray(options) ? options : false); + options = !Array.isArray(options) && options ? options : {}; + + return new Server(options, origins); +}; + +/** + * Provide a hook to the original server, so it can be extended if needed. + */ + +exports.Server = Server; + +/** + * Module version + */ + +exports.version = '0.0.4'; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/package.json new file mode 100644 index 00000000..49a2a3e9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/package.json @@ -0,0 +1,67 @@ +{ + "name": "policyfile", + "version": "0.0.4", + "author": { + "name": "Arnout Kazemier" + }, + "description": "Flash Socket Policy File Server. A server to respond to Flash Socket Policy requests, both inline and through a dedicated server instance.", + "main": "index", + "keywords": [ + "flash", + "socket", + "policy", + "file", + "server", + "Flash Socket Policy File Server", + "cross domain" + ], + "directories": { + "lib": "./lib" + }, + "maintainers": [ + { + "name": "Arnout Kazemier", + "email": "info@3rd-Eden.com", + "url": "http://blog.3rd-Eden.com" + } + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/3rd-Eden/FlashPolicyFileServer/blob/master/LICENSE" + } + ], + "repositories": [ + { + "type": "git", + "url": "git+https://github.com/3rd-Eden/FlashPolicyFileServer.git" + } + ], + "_id": "policyfile@0.0.4", + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "1.0.12", + "_nodeVersion": "v0.4.8", + "_defaultsLoaded": true, + "dist": { + "shasum": "d6b82ead98ae79ebe228e2daf5903311ec982e4d", + "tarball": "http://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz" + }, + "scripts": {}, + "_shasum": "d6b82ead98ae79ebe228e2daf5903311ec982e4d", + "_resolved": "https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz", + "_from": "policyfile@0.0.4", + "repository": { + "type": "git", + "url": "git+https://github.com/3rd-Eden/FlashPolicyFileServer.git" + }, + "bugs": { + "url": "https://github.com/3rd-Eden/FlashPolicyFileServer/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/3rd-Eden/FlashPolicyFileServer#readme" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/ssl/ssl.crt b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/ssl/ssl.crt new file mode 100644 index 00000000..5883cd44 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/ssl/ssl.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDXTCCAkWgAwIBAgIJAMUSOvlaeyQHMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQwHhcNMTAxMTE2MDkzMjQ5WhcNMTMxMTE1MDkzMjQ5WjBF +MQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50 +ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEVwfPQQp4X +wtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+1FAE0c5o +exPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404WthquTqg +S7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy25IyBK3QJ +c+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWAQsqW+COL +0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABo1AwTjAdBgNVHQ4EFgQUDnV4d6mD +tOnluLoCjkUHTX/n4agwHwYDVR0jBBgwFoAUDnV4d6mDtOnluLoCjkUHTX/n4agw +DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAFwV4MQfTo+qMv9JMiyno +IEiqfOz4RgtmBqRnXUffcjS2dhc7/z+FPZnM79Kej8eLHoVfxCyWRHFlzm93vEdv +wxOCrD13EDOi08OOZfxWyIlCa6Bg8cMAKqQzd2OvQOWqlRWBTThBJIhWflU33izX +Qn5GdmYqhfpc+9ZHHGhvXNydtRQkdxVK2dZNzLBvBlLlRmtoClU7xm3A+/5dddeP +AQHEPtyFlUw49VYtZ3ru6KqPms7MKvcRhYLsy9rwSfuuniMlx4d0bDR7TOkw0QQS +A0N8MGQRQpzl4mw4jLzyM5d5QtuGBh2P6hPGa0YQxtI3RPT/p6ENzzBiAKXiSfzo +xw== +-----END CERTIFICATE----- diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/ssl/ssl.private.key b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/ssl/ssl.private.key new file mode 100644 index 00000000..f31ff3d9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/ssl/ssl.private.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAz+LXZOjcQCJq3+ZKUFabj71oo/ex/XsBcFqtBThjjTw9CVEV +wfPQQp4XwtPiB204vnYXwQ1/R2NdTQqCZu47l79LssL/u2a5Y9+0NEU3nQA5qdt+ +1FAE0c5oexPimXOrR3GWfKz7PmZ2O0117IeCUUXPG5U8umhDe/4mDF4ZNJiKc404 +WthquTqgS7rLQZHhZ6D0EnGnOkzlmxJMYPNHSOY1/6ivdNUUcC87awNEA3lgfhy2 +5IyBK3QJc+aYKNTbt70Lery3bu2wWLFGtmNiGlQTS4JsxImRsECTI727ObS7/FWA +QsqW+COL0Sa5BuMFrFIpjPrEe0ih7vRRbdmXRwIDAQABAoIBAGe4+9VqZfJN+dsq +8Osyuz01uQ8OmC0sAWTIqUlQgENIyf9rCJsUBlYmwR5BT6Z69XP6QhHdpSK+TiAR +XUz0EqG9HYzcxHIBaACP7j6iRoQ8R4kbbiWKo0z3WqQGIOqFjvD/mKEuQdE5mEYw +eOUCG6BnX1WY2Yr8WKd2AA/tp0/Y4d8z04u9eodMpSTbHTzYMJb5SbBN1vo6FY7q +8zSuO0BMzXlAxUsCwHsk1GQHFr8Oh3zIR7bQGtMBouI+6Lhh7sjFYsfxJboqMTBV +IKaA216M6ggHG7MU1/jeKcMGDmEfqQLQoyWp29rMK6TklUgipME2L3UD7vTyAVzz +xbVOpZkCgYEA8CXW4sZBBrSSrLR5SB+Ubu9qNTggLowOsC/kVKB2WJ4+xooc5HQo +mFhq1v/WxPQoWIxdYsfg2odlL+JclK5Qcy6vXmRSdAQ5lK9gBDKxZSYc3NwAw2HA +zyHCTK+I0n8PBYQ+yGcrxu0WqTGnlLW+Otk4CejO34WlgHwbH9bbY5UCgYEA3ZvT +C4+OoMHXlmICSt29zUrYiL33IWsR3/MaONxTEDuvgkOSXXQOl/8Ebd6Nu+3WbsSN +bjiPC/JyL1YCVmijdvFpl4gjtgvfJifs4G+QHvO6YfsYoVANk4u6g6rUuBIOwNK4 +RwYxwDc0oysp+g7tPxoSgDHReEVKJNzGBe9NGGsCgYEA4O4QP4gCEA3B9BF2J5+s +n9uPVxmiyvZUK6Iv8zP4pThTBBMIzNIf09G9AHPQ7djikU2nioY8jXKTzC3xGTHM +GJZ5m6fLsu7iH+nDvSreDSeNkTBfZqGAvoGYQ8uGE+L+ZuRfCcXYsxIOT5s6o4c3 +Dle2rVFpsuKzCY00urW796ECgYBn3go75+xEwrYGQSer6WR1nTgCV29GVYXKPooy +zmmMOT1Yw80NSkEw0pFD4cTyqVYREsTrPU0mn1sPfrOXxnGfZSVFpcR/Je9QVfQ7 +eW7GYxwfom335aqHVj10SxRqteP+UoWWnHujCPz94VRKZMakBddYCIGSan+G6YdS +7sdmwwKBgBc2qj0wvGXDF2kCLwSGfWoMf8CS1+5fIiUIdT1e/+7MfDdbmLMIFVjF +QKS3zVViXCbrG5SY6wS9hxoc57f6E2A8vcaX6zy2xkZlGHQCpWRtEM5R01OWJQaH +HsHMmQZGUQVoDm1oRkDhrTFK4K3ukc3rAxzeTZ96utOQN8/KJsTv +-----END RSA PRIVATE KEY----- diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/unit.test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/unit.test.js new file mode 100644 index 00000000..932b3c14 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/policyfile/tests/unit.test.js @@ -0,0 +1,231 @@ +var fspfs = require('../') + , fs = require('fs') + , http = require('http') + , https = require('https') + , net = require('net') + , should = require('should') + , assert = require('assert'); + +module.exports = { + // Library version should be Semver compatible + 'Library version': function(){ + fspfs.version.should.match(/^\d+\.\d+\.\d+$/); + } + + // Creating a server instace should not cause any problems + // either using the new Server or createServer method. +, 'Create Server instance': function(){ + var server = fspfs.createServer() + , server2 = new fspfs.Server({log:false}, ['blog.3rd-Eden.com:1337']); + + // server 2 options test + server2.log.should.be.false; + server2.origins.length.should.equal(1); + server2.origins[0].should.equal('blog.3rd-Eden.com:1337'); + + // server defaults + (typeof server.log).should.be.equal('function'); + server.origins.length.should.equal(1); + server.origins[0].should.equal('*:*'); + + // instance checking, sanity check + assert.ok(server instanceof fspfs.Server); + assert.ok(!!server.buffer); + + // more options testing + server = fspfs.createServer(['blog.3rd-Eden.com:80']); + server.origins.length.should.equal(1); + server.origins[0].should.equal('blog.3rd-Eden.com:80'); + + server = fspfs.createServer({log:false},['blog.3rd-Eden.com:80']); + server.log.should.be.false; + server.origins.length.should.equal(1); + server.origins[0].should.equal('blog.3rd-Eden.com:80'); + + } + +, 'Add origin': function(){ + var server = fspfs.createServer(); + server.add('google.com:80', 'blog.3rd-Eden.com:1337'); + + server.origins.length.should.equal(3); + server.origins.indexOf('google.com:80').should.be.above(0); + + // don't allow duplicates + server.add('google.com:80', 'google.com:80'); + + var i = server.origins.length + , count = 0; + + while(i--){ + if (server.origins[i] === 'google.com:80'){ + count++; + } + } + + count.should.equal(1); + } + +, 'Remove origin': function(){ + var server = fspfs.createServer(); + server.add('google.com:80', 'blog.3rd-Eden.com:1337'); + server.origins.length.should.equal(3); + + server.remove('google.com:80'); + server.origins.length.should.equal(2); + server.origins.indexOf('google.com:80').should.equal(-1); + } + +, 'Buffer': function(){ + var server = fspfs.createServer(); + + Buffer.isBuffer(server.buffer).should.be.true; + server.buffer.toString().indexOf('to-ports="*"').should.be.above(0); + server.buffer.toString().indexOf('domain="*"').should.be.above(0); + server.buffer.toString().indexOf('domain="google.com"').should.equal(-1); + + // The buffers should be rebuild when new origins are added + server.add('google.com:80'); + server.buffer.toString().indexOf('to-ports="80"').should.be.above(0); + server.buffer.toString().indexOf('domain="google.com"').should.be.above(0); + + server.remove('google.com:80'); + server.buffer.toString().indexOf('to-ports="80"').should.equal(-1); + server.buffer.toString().indexOf('domain="google.com"').should.equal(-1); + } + +, 'Responder': function(){ + var server = fspfs.createServer() + , calls = 0 + // dummy socket to emulate a `real` socket + , dummySocket = { + readyState: 'open' + , end: function(buffer){ + calls++; + Buffer.isBuffer(buffer).should.be.true; + buffer.toString().should.equal(server.buffer.toString()); + } + }; + + server.responder(dummySocket); + calls.should.equal(1); + } + +, 'Event proxy': function(){ + var server = fspfs.createServer() + , calls = 0; + + Object.keys(process.EventEmitter.prototype).forEach(function proxy(key){ + assert.ok(!!server[key] && typeof server[key] === 'function'); + }); + + // test if it works by calling a none default event + server.on('pew', function(){ + calls++; + }); + + server.emit('pew'); + calls.should.equal(1); + } + +, 'inline response http': function(){ + var port = 1335 + , httpserver = http.createServer(function(q,r){r.writeHead(200);r.end(':3')}) + , server = fspfs.createServer(); + + httpserver.listen(port, function(){ + server.listen(port + 1, httpserver, function(){ + var client = net.createConnection(port); + client.write('\0'); + client.on('error', function(err){ + assert.ok(!err, err) + }); + client.on('data', function(data){ + + var response = data.toString(); + console.log(response); + + response.indexOf('to-ports="*"').should.be.above(0); + response.indexOf('domain="*"').should.be.above(0); + response.indexOf('domain="google.com"').should.equal(-1); + + // clean up + client.destroy(); + server.close(); + httpserver.close(); + }); + }); + }); + } + +, 'server response': function(){ + var port = 1340 + , server = fspfs.createServer(); + + server.listen(port, function(){ + var client = net.createConnection(port); + client.write('\0'); + client.on('error', function(err){ + assert.ok(!err, err) + }); + client.on('data', function(data){ + + var response = data.toString(); + + response.indexOf('to-ports="*"').should.be.above(0); + response.indexOf('domain="*"').should.be.above(0); + response.indexOf('domain="google.com"').should.equal(-1); + + // clean up + client.destroy(); + server.close(); + }); + }); + } + +, 'inline response https': function(){ + var port = 1345 + , ssl = { + key: fs.readFileSync(__dirname + '/ssl/ssl.private.key').toString() + , cert: fs.readFileSync(__dirname + '/ssl/ssl.crt').toString() + } + , httpserver = https.createServer(ssl, function(q,r){r.writeHead(200);r.end(':3')}) + , server = fspfs.createServer(); + + httpserver.listen(port, function(){ + server.listen(port + 1, httpserver, function(){ + var client = net.createConnection(port); + client.write('\0'); + client.on('error', function(err){ + assert.ok(!err, err) + }); + client.on('data', function(data){ + + var response = data.toString(); + + response.indexOf('to-ports="*"').should.be.above(0); + response.indexOf('domain="*"').should.be.above(0); + response.indexOf('domain="google.com"').should.equal(-1); + + // clean up + client.destroy(); + server.close(); + httpserver.close(); + }); + }); + }); + } + +, 'connect_failed': function(){ + var server = fspfs.createServer(); + + server.on('connect_failed', function(){ + assert.ok(true); + }); + + server.listen(function(){ + assert.ok(false, 'Run this test without root access'); + server.close(); + }); + } +}; \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/.npmignore new file mode 100644 index 00000000..3c3629e6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/README.md new file mode 100644 index 00000000..46e7018c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/README.md @@ -0,0 +1,691 @@ +redis - a node.js redis client +=========================== + +This is a complete Redis client for node.js. It supports all Redis commands, including many recently added commands like EVAL from +experimental Redis server branches. + + +Install with: + + npm install redis + +Pieter Noordhuis has provided a binding to the official `hiredis` C library, which is non-blocking and fast. To use `hiredis`, do: + + npm install hiredis redis + +If `hiredis` is installed, `node_redis` will use it by default. Otherwise, a pure JavaScript parser will be used. + +If you use `hiredis`, be sure to rebuild it whenever you upgrade your version of node. There are mysterious failures that can +happen between node and native code modules after a node upgrade. + + +## Usage + +Simple example, included as `examples/simple.js`: + +```js + var redis = require("redis"), + client = redis.createClient(); + + // if you'd like to select database 3, instead of 0 (default), call + // client.select(3, function() { /* ... */ }); + + client.on("error", function (err) { + console.log("Error " + err); + }); + + client.set("string key", "string val", redis.print); + client.hset("hash key", "hashtest 1", "some value", redis.print); + client.hset(["hash key", "hashtest 2", "some other value"], redis.print); + client.hkeys("hash key", function (err, replies) { + console.log(replies.length + " replies:"); + replies.forEach(function (reply, i) { + console.log(" " + i + ": " + reply); + }); + client.quit(); + }); +``` + +This will display: + + mjr:~/work/node_redis (master)$ node example.js + Reply: OK + Reply: 0 + Reply: 0 + 2 replies: + 0: hashtest 1 + 1: hashtest 2 + mjr:~/work/node_redis (master)$ + + +## Performance + +Here are typical results of `multi_bench.js` which is similar to `redis-benchmark` from the Redis distribution. +It uses 50 concurrent connections with no pipelining. + +JavaScript parser: + + PING: 20000 ops 42283.30 ops/sec 0/5/1.182 + SET: 20000 ops 32948.93 ops/sec 1/7/1.515 + GET: 20000 ops 28694.40 ops/sec 0/9/1.740 + INCR: 20000 ops 39370.08 ops/sec 0/8/1.269 + LPUSH: 20000 ops 36429.87 ops/sec 0/8/1.370 + LRANGE (10 elements): 20000 ops 9891.20 ops/sec 1/9/5.048 + LRANGE (100 elements): 20000 ops 1384.56 ops/sec 10/91/36.072 + +hiredis parser: + + PING: 20000 ops 46189.38 ops/sec 1/4/1.082 + SET: 20000 ops 41237.11 ops/sec 0/6/1.210 + GET: 20000 ops 39682.54 ops/sec 1/7/1.257 + INCR: 20000 ops 40080.16 ops/sec 0/8/1.242 + LPUSH: 20000 ops 41152.26 ops/sec 0/3/1.212 + LRANGE (10 elements): 20000 ops 36563.07 ops/sec 1/8/1.363 + LRANGE (100 elements): 20000 ops 21834.06 ops/sec 0/9/2.287 + +The performance of `node_redis` improves dramatically with pipelining, which happens automatically in most normal programs. + + +### Sending Commands + +Each Redis command is exposed as a function on the `client` object. +All functions take either an `args` Array plus optional `callback` Function or +a variable number of individual arguments followed by an optional callback. +Here is an example of passing an array of arguments and a callback: + + client.mset(["test keys 1", "test val 1", "test keys 2", "test val 2"], function (err, res) {}); + +Here is that same call in the second style: + + client.mset("test keys 1", "test val 1", "test keys 2", "test val 2", function (err, res) {}); + +Note that in either form the `callback` is optional: + + client.set("some key", "some val"); + client.set(["some other key", "some val"]); + +If the key is missing, reply will be null (probably): + + client.get("missingkey", function(err, reply) { + // reply is null when the key is missing + console.log(reply); + }); + +For a list of Redis commands, see [Redis Command Reference](http://redis.io/commands) + +The commands can be specified in uppercase or lowercase for convenience. `client.get()` is the same as `client.GET()`. + +Minimal parsing is done on the replies. Commands that return a single line reply return JavaScript Strings, +integer replies return JavaScript Numbers, "bulk" replies return node Buffers, and "multi bulk" replies return a +JavaScript Array of node Buffers. `HGETALL` returns an Object with Buffers keyed by the hash keys. + +# API + +## Connection Events + +`client` will emit some events about the state of the connection to the Redis server. + +### "ready" + +`client` will emit `ready` a connection is established to the Redis server and the server reports +that it is ready to receive commands. Commands issued before the `ready` event are queued, +then replayed just before this event is emitted. + +### "connect" + +`client` will emit `connect` at the same time as it emits `ready` unless `client.options.no_ready_check` +is set. If this options is set, `connect` will be emitted when the stream is connected, and then +you are free to try to send commands. + +### "error" + +`client` will emit `error` when encountering an error connecting to the Redis server. + +Note that "error" is a special event type in node. If there are no listeners for an +"error" event, node will exit. This is usually what you want, but it can lead to some +cryptic error messages like this: + + mjr:~/work/node_redis (master)$ node example.js + + node.js:50 + throw e; + ^ + Error: ECONNREFUSED, Connection refused + at IOWatcher.callback (net:870:22) + at node.js:607:9 + +Not very useful in diagnosing the problem, but if your program isn't ready to handle this, +it is probably the right thing to just exit. + +`client` will also emit `error` if an exception is thrown inside of `node_redis` for whatever reason. +It would be nice to distinguish these two cases. + +### "end" + +`client` will emit `end` when an established Redis server connection has closed. + +### "drain" + +`client` will emit `drain` when the TCP connection to the Redis server has been buffering, but is now +writable. This event can be used to stream commands in to Redis and adapt to backpressure. Right now, +you need to check `client.command_queue.length` to decide when to reduce your send rate. Then you can +resume sending when you get `drain`. + +### "idle" + +`client` will emit `idle` when there are no outstanding commands that are awaiting a response. + +## redis.createClient(port, host, options) + +Create a new client connection. `port` defaults to `6379` and `host` defaults +to `127.0.0.1`. If you have `redis-server` running on the same computer as node, then the defaults for +port and host are probably fine. `options` in an object with the following possible properties: + +* `parser`: which Redis protocol reply parser to use. Defaults to `hiredis` if that module is installed. +This may also be set to `javascript`. +* `return_buffers`: defaults to `false`. If set to `true`, then all replies will be sent to callbacks as node Buffer +objects instead of JavaScript Strings. +* `detect_buffers`: default to `false`. If set to `true`, then replies will be sent to callbacks as node Buffer objects +if any of the input arguments to the original command were Buffer objects. +This option lets you switch between Buffers and Strings on a per-command basis, whereas `return_buffers` applies to +every command on a client. +* `socket_nodelay`: defaults to `true`. Whether to call setNoDelay() on the TCP stream, which disables the +Nagle algorithm on the underlying socket. Setting this option to `false` can result in additional throughput at the +cost of more latency. Most applications will want this set to `true`. +* `no_ready_check`: defaults to `false`. When a connection is established to the Redis server, the server might still +be loading the database from disk. While loading, the server not respond to any commands. To work around this, +`node_redis` has a "ready check" which sends the `INFO` command to the server. The response from the `INFO` command +indicates whether the server is ready for more commands. When ready, `node_redis` emits a `ready` event. +Setting `no_ready_check` to `true` will inhibit this check. +* `enable_offline_queue`: defaults to `true`. By default, if there is no active +connection to the redis server, commands are added to a queue and are executed +once the connection has been established. Setting `enable_offline_queue` to +`false` will disable this feature and the callback will be execute immediately +with an error, or an error will be thrown if no callback is specified. + +```js + var redis = require("redis"), + client = redis.createClient(null, null, {detect_buffers: true}); + + client.set("foo_rand000000000000", "OK"); + + // This will return a JavaScript String + client.get("foo_rand000000000000", function (err, reply) { + console.log(reply.toString()); // Will print `OK` + }); + + // This will return a Buffer since original key is specified as a Buffer + client.get(new Buffer("foo_rand000000000000"), function (err, reply) { + console.log(reply.toString()); // Will print `` + }); + client.end(); +``` + +`createClient()` returns a `RedisClient` object that is named `client` in all of the examples here. + +## client.auth(password, callback) + +When connecting to Redis servers that require authentication, the `AUTH` command must be sent as the +first command after connecting. This can be tricky to coordinate with reconnections, the ready check, +etc. To make this easier, `client.auth()` stashes `password` and will send it after each connection, +including reconnections. `callback` is invoked only once, after the response to the very first +`AUTH` command sent. +NOTE: Your call to `client.auth()` should not be inside the ready handler. If +you are doing this wrong, `client` will emit an error that looks +something like this `Error: Ready check failed: ERR operation not permitted`. + +## client.end() + +Forcibly close the connection to the Redis server. Note that this does not wait until all replies have been parsed. +If you want to exit cleanly, call `client.quit()` to send the `QUIT` command after you have handled all replies. + +This example closes the connection to the Redis server before the replies have been read. You probably don't +want to do this: + +```js + var redis = require("redis"), + client = redis.createClient(); + + client.set("foo_rand000000000000", "some fantastic value"); + client.get("foo_rand000000000000", function (err, reply) { + console.log(reply.toString()); + }); + client.end(); +``` + +`client.end()` is useful for timeout cases where something is stuck or taking too long and you want +to start over. + +## Friendlier hash commands + +Most Redis commands take a single String or an Array of Strings as arguments, and replies are sent back as a single String or an Array of Strings. +When dealing with hash values, there are a couple of useful exceptions to this. + +### client.hgetall(hash) + +The reply from an HGETALL command will be converted into a JavaScript Object by `node_redis`. That way you can interact +with the responses using JavaScript syntax. + +Example: + + client.hmset("hosts", "mjr", "1", "another", "23", "home", "1234"); + client.hgetall("hosts", function (err, obj) { + console.dir(obj); + }); + +Output: + + { mjr: '1', another: '23', home: '1234' } + +### client.hmset(hash, obj, [callback]) + +Multiple values in a hash can be set by supplying an object: + + client.HMSET(key2, { + "0123456789": "abcdefghij", // NOTE: the key and value must both be strings + "some manner of key": "a type of value" + }); + +The properties and values of this Object will be set as keys and values in the Redis hash. + +### client.hmset(hash, key1, val1, ... keyn, valn, [callback]) + +Multiple values may also be set by supplying a list: + + client.HMSET(key1, "0123456789", "abcdefghij", "some manner of key", "a type of value"); + + +## Publish / Subscribe + +Here is a simple example of the API for publish / subscribe. This program opens two +client connections, subscribes to a channel on one of them, and publishes to that +channel on the other: + +```js + var redis = require("redis"), + client1 = redis.createClient(), client2 = redis.createClient(), + msg_count = 0; + + client1.on("subscribe", function (channel, count) { + client2.publish("a nice channel", "I am sending a message."); + client2.publish("a nice channel", "I am sending a second message."); + client2.publish("a nice channel", "I am sending my last message."); + }); + + client1.on("message", function (channel, message) { + console.log("client1 channel " + channel + ": " + message); + msg_count += 1; + if (msg_count === 3) { + client1.unsubscribe(); + client1.end(); + client2.end(); + } + }); + + client1.incr("did a thing"); + client1.subscribe("a nice channel"); +``` + +When a client issues a `SUBSCRIBE` or `PSUBSCRIBE`, that connection is put into "pub/sub" mode. +At that point, only commands that modify the subscription set are valid. When the subscription +set is empty, the connection is put back into regular mode. + +If you need to send regular commands to Redis while in pub/sub mode, just open another connection. + +## Pub / Sub Events + +If a client has subscriptions active, it may emit these events: + +### "message" (channel, message) + +Client will emit `message` for every message received that matches an active subscription. +Listeners are passed the channel name as `channel` and the message Buffer as `message`. + +### "pmessage" (pattern, channel, message) + +Client will emit `pmessage` for every message received that matches an active subscription pattern. +Listeners are passed the original pattern used with `PSUBSCRIBE` as `pattern`, the sending channel +name as `channel`, and the message Buffer as `message`. + +### "subscribe" (channel, count) + +Client will emit `subscribe` in response to a `SUBSCRIBE` command. Listeners are passed the +channel name as `channel` and the new count of subscriptions for this client as `count`. + +### "psubscribe" (pattern, count) + +Client will emit `psubscribe` in response to a `PSUBSCRIBE` command. Listeners are passed the +original pattern as `pattern`, and the new count of subscriptions for this client as `count`. + +### "unsubscribe" (channel, count) + +Client will emit `unsubscribe` in response to a `UNSUBSCRIBE` command. Listeners are passed the +channel name as `channel` and the new count of subscriptions for this client as `count`. When +`count` is 0, this client has left pub/sub mode and no more pub/sub events will be emitted. + +### "punsubscribe" (pattern, count) + +Client will emit `punsubscribe` in response to a `PUNSUBSCRIBE` command. Listeners are passed the +channel name as `channel` and the new count of subscriptions for this client as `count`. When +`count` is 0, this client has left pub/sub mode and no more pub/sub events will be emitted. + +## client.multi([commands]) + +`MULTI` commands are queued up until an `EXEC` is issued, and then all commands are run atomically by +Redis. The interface in `node_redis` is to return an individual `Multi` object by calling `client.multi()`. + +```js + var redis = require("./index"), + client = redis.createClient(), set_size = 20; + + client.sadd("bigset", "a member"); + client.sadd("bigset", "another member"); + + while (set_size > 0) { + client.sadd("bigset", "member " + set_size); + set_size -= 1; + } + + // multi chain with an individual callback + client.multi() + .scard("bigset") + .smembers("bigset") + .keys("*", function (err, replies) { + // NOTE: code in this callback is NOT atomic + // this only happens after the the .exec call finishes. + client.mget(replies, redis.print); + }) + .dbsize() + .exec(function (err, replies) { + console.log("MULTI got " + replies.length + " replies"); + replies.forEach(function (reply, index) { + console.log("Reply " + index + ": " + reply.toString()); + }); + }); +``` + +`client.multi()` is a constructor that returns a `Multi` object. `Multi` objects share all of the +same command methods as `client` objects do. Commands are queued up inside the `Multi` object +until `Multi.exec()` is invoked. + +You can either chain together `MULTI` commands as in the above example, or you can queue individual +commands while still sending regular client command as in this example: + +```js + var redis = require("redis"), + client = redis.createClient(), multi; + + // start a separate multi command queue + multi = client.multi(); + multi.incr("incr thing", redis.print); + multi.incr("incr other thing", redis.print); + + // runs immediately + client.mset("incr thing", 100, "incr other thing", 1, redis.print); + + // drains multi queue and runs atomically + multi.exec(function (err, replies) { + console.log(replies); // 101, 2 + }); + + // you can re-run the same transaction if you like + multi.exec(function (err, replies) { + console.log(replies); // 102, 3 + client.quit(); + }); +``` + +In addition to adding commands to the `MULTI` queue individually, you can also pass an array +of commands and arguments to the constructor: + +```js + var redis = require("redis"), + client = redis.createClient(), multi; + + client.multi([ + ["mget", "multifoo", "multibar", redis.print], + ["incr", "multifoo"], + ["incr", "multibar"] + ]).exec(function (err, replies) { + console.log(replies); + }); +``` + + +## Monitor mode + +Redis supports the `MONITOR` command, which lets you see all commands received by the Redis server +across all client connections, including from other client libraries and other computers. + +After you send the `MONITOR` command, no other commands are valid on that connection. `node_redis` +will emit a `monitor` event for every new monitor message that comes across. The callback for the +`monitor` event takes a timestamp from the Redis server and an array of command arguments. + +Here is a simple example: + +```js + var client = require("redis").createClient(), + util = require("util"); + + client.monitor(function (err, res) { + console.log("Entering monitoring mode."); + }); + + client.on("monitor", function (time, args) { + console.log(time + ": " + util.inspect(args)); + }); +``` + +# Extras + +Some other things you might like to know about. + +## client.server_info + +After the ready probe completes, the results from the INFO command are saved in the `client.server_info` +object. + +The `versions` key contains an array of the elements of the version string for easy comparison. + + > client.server_info.redis_version + '2.3.0' + > client.server_info.versions + [ 2, 3, 0 ] + +## redis.print() + +A handy callback function for displaying return values when testing. Example: + +```js + var redis = require("redis"), + client = redis.createClient(); + + client.on("connect", function () { + client.set("foo_rand000000000000", "some fantastic value", redis.print); + client.get("foo_rand000000000000", redis.print); + }); +``` + +This will print: + + Reply: OK + Reply: some fantastic value + +Note that this program will not exit cleanly because the client is still connected. + +## redis.debug_mode + +Boolean to enable debug mode and protocol tracing. + +```js + var redis = require("redis"), + client = redis.createClient(); + + redis.debug_mode = true; + + client.on("connect", function () { + client.set("foo_rand000000000000", "some fantastic value"); + }); +``` + +This will display: + + mjr:~/work/node_redis (master)$ node ~/example.js + send command: *3 + $3 + SET + $20 + foo_rand000000000000 + $20 + some fantastic value + + on_data: +OK + +`send command` is data sent into Redis and `on_data` is data received from Redis. + +## client.send_command(command_name, args, callback) + +Used internally to send commands to Redis. For convenience, nearly all commands that are published on the Redis +Wiki have been added to the `client` object. However, if I missed any, or if new commands are introduced before +this library is updated, you can use `send_command()` to send arbitrary commands to Redis. + +All commands are sent as multi-bulk commands. `args` can either be an Array of arguments, or omitted. + +## client.connected + +Boolean tracking the state of the connection to the Redis server. + +## client.command_queue.length + +The number of commands that have been sent to the Redis server but not yet replied to. You can use this to +enforce some kind of maximum queue depth for commands while connected. + +Don't mess with `client.command_queue` though unless you really know what you are doing. + +## client.offline_queue.length + +The number of commands that have been queued up for a future connection. You can use this to enforce +some kind of maximum queue depth for pre-connection commands. + +## client.retry_delay + +Current delay in milliseconds before a connection retry will be attempted. This starts at `250`. + +## client.retry_backoff + +Multiplier for future retry timeouts. This should be larger than 1 to add more time between retries. +Defaults to 1.7. The default initial connection retry is 250, so the second retry will be 425, followed by 723.5, etc. + +### Commands with Optional and Keyword arguments + +This applies to anything that uses an optional `[WITHSCORES]` or `[LIMIT offset count]` in the [redis.io/commands](http://redis.io/commands) documentation. + +Example: +```js +var args = [ 'myzset', 1, 'one', 2, 'two', 3, 'three', 99, 'ninety-nine' ]; +client.zadd(args, function (err, response) { + if (err) throw err; + console.log('added '+response+' items.'); + + // -Infinity and +Infinity also work + var args1 = [ 'myzset', '+inf', '-inf' ]; + client.zrevrangebyscore(args1, function (err, response) { + if (err) throw err; + console.log('example1', response); + // write your code here + }); + + var max = 3, min = 1, offset = 1, count = 2; + var args2 = [ 'myzset', max, min, 'WITHSCORES', 'LIMIT', offset, count ]; + client.zrevrangebyscore(args2, function (err, response) { + if (err) throw err; + console.log('example2', response); + // write your code here + }); +}); +``` + +## TODO + +Better tests for auth, disconnect/reconnect, and all combinations thereof. + +Stream large set/get values into and out of Redis. Otherwise the entire value must be in node's memory. + +Performance can be better for very large values. + +I think there are more performance improvements left in there for smaller values, especially for large lists of small values. + +## How to Contribute +- open a pull request and then wait for feedback (if + [DTrejo](http://github.com/dtrejo) does not get back to you within 2 days, + comment again with indignation!) + +## Contributors +Some people have have added features and fixed bugs in `node_redis` other than me. + +Ordered by date of first contribution. +[Auto-generated](http://github.com/dtrejo/node-authors) on Wed Jul 25 2012 19:14:59 GMT-0700 (PDT). + +- [Matt Ranney aka `mranney`](https://github.com/mranney) +- [Tim-Smart aka `tim-smart`](https://github.com/tim-smart) +- [Tj Holowaychuk aka `visionmedia`](https://github.com/visionmedia) +- [rick aka `technoweenie`](https://github.com/technoweenie) +- [Orion Henry aka `orionz`](https://github.com/orionz) +- [Aivo Paas aka `aivopaas`](https://github.com/aivopaas) +- [Hank Sims aka `hanksims`](https://github.com/hanksims) +- [Paul Carey aka `paulcarey`](https://github.com/paulcarey) +- [Pieter Noordhuis aka `pietern`](https://github.com/pietern) +- [nithesh aka `nithesh`](https://github.com/nithesh) +- [Andy Ray aka `andy2ray`](https://github.com/andy2ray) +- [unknown aka `unknowdna`](https://github.com/unknowdna) +- [Dave Hoover aka `redsquirrel`](https://github.com/redsquirrel) +- [Vladimir Dronnikov aka `dvv`](https://github.com/dvv) +- [Umair Siddique aka `umairsiddique`](https://github.com/umairsiddique) +- [Louis-Philippe Perron aka `lp`](https://github.com/lp) +- [Mark Dawson aka `markdaws`](https://github.com/markdaws) +- [Ian Babrou aka `bobrik`](https://github.com/bobrik) +- [Felix Geisendörfer aka `felixge`](https://github.com/felixge) +- [Jean-Hugues Pinson aka `undefined`](https://github.com/undefined) +- [Maksim Lin aka `maks`](https://github.com/maks) +- [Owen Smith aka `orls`](https://github.com/orls) +- [Zachary Scott aka `zzak`](https://github.com/zzak) +- [TEHEK Firefox aka `TEHEK`](https://github.com/TEHEK) +- [Isaac Z. Schlueter aka `isaacs`](https://github.com/isaacs) +- [David Trejo aka `DTrejo`](https://github.com/DTrejo) +- [Brian Noguchi aka `bnoguchi`](https://github.com/bnoguchi) +- [Philip Tellis aka `bluesmoon`](https://github.com/bluesmoon) +- [Marcus Westin aka `marcuswestin2`](https://github.com/marcuswestin2) +- [Jed Schmidt aka `jed`](https://github.com/jed) +- [Dave Peticolas aka `jdavisp3`](https://github.com/jdavisp3) +- [Trae Robrock aka `trobrock`](https://github.com/trobrock) +- [Shankar Karuppiah aka `shankar0306`](https://github.com/shankar0306) +- [Ignacio Burgueño aka `ignacio`](https://github.com/ignacio) + +Thanks. + +## LICENSE - "MIT License" + +Copyright (c) 2010 Matthew Ranney, http://ranney.com/ + +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. + +![spacer](http://ranney.com/1px.gif) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/buffer_bench.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/buffer_bench.js new file mode 100644 index 00000000..a504fbc0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/buffer_bench.js @@ -0,0 +1,89 @@ +var source = new Buffer(100), + dest = new Buffer(100), i, j, k, tmp, count = 1000000, bytes = 100; + +for (i = 99 ; i >= 0 ; i--) { + source[i] = 120; +} + +var str = "This is a nice String.", + buf = new Buffer("This is a lovely Buffer."); + +var start = new Date(); +for (i = count * 100; i > 0 ; i--) { + if (Buffer.isBuffer(str)) {} +} +var end = new Date(); +console.log("Buffer.isBuffer(str) " + (end - start) + " ms"); + +var start = new Date(); +for (i = count * 100; i > 0 ; i--) { + if (Buffer.isBuffer(buf)) {} +} +var end = new Date(); +console.log("Buffer.isBuffer(buf) " + (end - start) + " ms"); + +var start = new Date(); +for (i = count * 100; i > 0 ; i--) { + if (str instanceof Buffer) {} +} +var end = new Date(); +console.log("str instanceof Buffer " + (end - start) + " ms"); + +var start = new Date(); +for (i = count * 100; i > 0 ; i--) { + if (buf instanceof Buffer) {} +} +var end = new Date(); +console.log("buf instanceof Buffer " + (end - start) + " ms"); + +for (i = bytes ; i > 0 ; i --) { + var start = new Date(); + for (j = count ; j > 0; j--) { + tmp = source.toString("ascii", 0, bytes); + } + var end = new Date(); + console.log("toString() " + i + " bytes " + (end - start) + " ms"); +} + +for (i = bytes ; i > 0 ; i --) { + var start = new Date(); + for (j = count ; j > 0; j--) { + tmp = ""; + for (k = 0; k <= i ; k++) { + tmp += String.fromCharCode(source[k]); + } + } + var end = new Date(); + console.log("manual string " + i + " bytes " + (end - start) + " ms"); +} + +for (i = bytes ; i > 0 ; i--) { + var start = new Date(); + for (j = count ; j > 0 ; j--) { + for (k = i ; k > 0 ; k--) { + dest[k] = source[k]; + } + } + var end = new Date(); + console.log("Manual copy " + i + " bytes " + (end - start) + " ms"); +} + +for (i = bytes ; i > 0 ; i--) { + var start = new Date(); + for (j = count ; j > 0 ; j--) { + for (k = i ; k > 0 ; k--) { + dest[k] = 120; + } + } + var end = new Date(); + console.log("Direct assignment " + i + " bytes " + (end - start) + " ms"); +} + +for (i = bytes ; i > 0 ; i--) { + var start = new Date(); + for (j = count ; j > 0 ; j--) { + source.copy(dest, 0, 0, i); + } + var end = new Date(); + console.log("Buffer.copy() " + i + " bytes " + (end - start) + " ms"); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/hiredis_parser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/hiredis_parser.js new file mode 100644 index 00000000..f1515b11 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/hiredis_parser.js @@ -0,0 +1,38 @@ +var Parser = require('../lib/parser/hiredis').Parser; +var assert = require('assert'); + +/* +This test makes sure that exceptions thrown inside of "reply" event handlers +are not trapped and mistakenly emitted as parse errors. +*/ +(function testExecuteDoesNotCatchReplyCallbackExceptions() { + var parser = new Parser(); + var replies = [{}]; + + parser.reader = { + feed: function() {}, + get: function() { + return replies.shift(); + } + }; + + var emittedError = false; + var caughtException = false; + + parser + .on('error', function() { + emittedError = true; + }) + .on('reply', function() { + throw new Error('bad'); + }); + + try { + parser.execute(); + } catch (err) { + caughtException = true; + } + + assert.equal(caughtException, true); + assert.equal(emittedError, false); +})(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/re_sub_test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/re_sub_test.js new file mode 100644 index 00000000..64b8f312 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/re_sub_test.js @@ -0,0 +1,14 @@ +var client = require('../index').createClient() + , client2 = require('../index').createClient() + , assert = require('assert'); + +client.once('subscribe', function (channel, count) { + client.unsubscribe('x'); + client.subscribe('x', function () { + client.quit(); + client2.quit(); + }); + client2.publish('x', 'hi'); +}); + +client.subscribe('x'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/reconnect_test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/reconnect_test.js new file mode 100644 index 00000000..7abdd516 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/reconnect_test.js @@ -0,0 +1,29 @@ +var redis = require("../index").createClient(null, null, { +// max_attempts: 4 +}); + +redis.on("error", function (err) { + console.log("Redis says: " + err); +}); + +redis.on("ready", function () { + console.log("Redis ready."); +}); + +redis.on("reconnecting", function (arg) { + console.log("Redis reconnecting: " + JSON.stringify(arg)); +}); +redis.on("connect", function () { + console.log("Redis connected."); +}); + +setInterval(function () { + var now = Date.now(); + redis.set("now", now, function (err, res) { + if (err) { + console.log(now + " Redis reply error: " + err); + } else { + console.log(now + " Redis reply: " + res); + } + }); +}, 100); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/codec.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/codec.js new file mode 100644 index 00000000..7d764f60 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/codec.js @@ -0,0 +1,16 @@ +var json = { + encode: JSON.stringify, + decode: JSON.parse +}; + +var MsgPack = require('node-msgpack'); +msgpack = { + encode: MsgPack.pack, + decode: function(str) { return MsgPack.unpack(new Buffer(str)); } +}; + +bison = require('bison'); + +module.exports = json; +//module.exports = msgpack; +//module.exports = bison; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js new file mode 100644 index 00000000..0acde7a6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/pub.js @@ -0,0 +1,38 @@ +'use strict'; + +var freemem = require('os').freemem; +var profiler = require('v8-profiler'); +var codec = require('../codec'); + +var sent = 0; + +var pub = require('redis').createClient(null, null, { + //command_queue_high_water: 5, + //command_queue_low_water: 1 +}) +.on('ready', function() { + this.emit('drain'); +}) +.on('drain', function() { + process.nextTick(exec); +}); + +var payload = '1'; for (var i = 0; i < 12; ++i) payload += payload; +console.log('Message payload length', payload.length); + +function exec() { + pub.publish('timeline', codec.encode({ foo: payload })); + ++sent; + if (!pub.should_buffer) { + process.nextTick(exec); + } +} + +profiler.takeSnapshot('s_0'); + +exec(); + +setInterval(function() { + profiler.takeSnapshot('s_' + sent); + console.error('sent', sent, 'free', freemem(), 'cmdqlen', pub.command_queue.length, 'offqlen', pub.offline_queue.length); +}, 2000); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/run b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/run new file mode 100755 index 00000000..bd9ac392 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/run @@ -0,0 +1,10 @@ +#!/bin/sh +node server.js & +node server.js & +node server.js & +node server.js & +node server.js & +node server.js & +node server.js & +node server.js & +node --debug pub.js diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/server.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/server.js new file mode 100644 index 00000000..035e6b74 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/pubsub/server.js @@ -0,0 +1,23 @@ +'use strict'; + +var freemem = require('os').freemem; +var codec = require('../codec'); + +var id = Math.random(); +var recv = 0; + +var sub = require('redis').createClient() + .on('ready', function() { + this.subscribe('timeline'); + }) + .on('message', function(channel, message) { + var self = this; + if (message) { + message = codec.decode(message); + ++recv; + } + }); + +setInterval(function() { + console.error('id', id, 'received', recv, 'free', freemem()); +}, 2000); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/pub.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/pub.js new file mode 100644 index 00000000..9caf1d0b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/pub.js @@ -0,0 +1,49 @@ +'use strict'; + +var freemem = require('os').freemem; +//var profiler = require('v8-profiler'); +var codec = require('../codec'); + +var sent = 0; + +var pub = require('redis').createClient(null, null, { + //command_queue_high_water: 5, + //command_queue_low_water: 1 +}) +.on('ready', function() { + this.del('timeline'); + this.emit('drain'); +}) +.on('drain', function() { + process.nextTick(exec); +}); + +var payload = '1'; for (var i = 0; i < 12; ++i) payload += payload; +console.log('Message payload length', payload.length); + +function exec() { + pub.rpush('timeline', codec.encode({ foo: payload })); + ++sent; + if (!pub.should_buffer) { + process.nextTick(exec); + } +} + +//profiler.takeSnapshot('s_0'); + +exec(); + +setInterval(function() { + //var ss = profiler.takeSnapshot('s_' + sent); + //console.error(ss.stringify()); + pub.llen('timeline', function(err, result) { + console.error('sent', sent, 'free', freemem(), + 'cmdqlen', pub.command_queue.length, 'offqlen', pub.offline_queue.length, + 'llen', result + ); + }); +}, 2000); + +/*setTimeout(function() { + process.exit(); +}, 30000);*/ diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/run b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/run new file mode 100755 index 00000000..8045ae80 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/run @@ -0,0 +1,6 @@ +#!/bin/sh +node server.js & +#node server.js & +#node server.js & +#node server.js & +node --debug pub.js diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/server.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/server.js new file mode 100644 index 00000000..9cbcdd9e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/rpushblpop/server.js @@ -0,0 +1,30 @@ +'use strict'; + +var freemem = require('os').freemem; +var codec = require('../codec'); + +var id = Math.random(); +var recv = 0; + +var cmd = require('redis').createClient(); +var sub = require('redis').createClient() + .on('ready', function() { + this.emit('timeline'); + }) + .on('timeline', function() { + var self = this; + this.blpop('timeline', 0, function(err, result) { + var message = result[1]; + if (message) { + message = codec.decode(message); + ++recv; + } + self.emit('timeline'); + }); + }); + +setInterval(function() { + cmd.llen('timeline', function(err, result) { + console.error('id', id, 'received', recv, 'free', freemem(), 'llen', result); + }); +}, 2000); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/00 b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/00 new file mode 100644 index 00000000..29d7bf7c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/00 @@ -0,0 +1,13 @@ +# size JSON msgpack bison +26602 2151.0170848180414 +25542 ? 2842.589272665782 +24835 ? ? 7280.4538397469805 +6104 6985.234528557929 +5045 ? 7217.461392841478 +4341 ? ? 14261.406335354604 +4180 15864.633685636572 +4143 ? 12954.806235781925 +4141 ? ? 44650.70733912719 +75 114227.07313350472 +40 ? 30162.440062810834 +39 ? ? 119815.66013519121 diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/plot b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/plot new file mode 100755 index 00000000..2563797c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/plot @@ -0,0 +1,13 @@ +#!/bin/sh + +gnuplot >size-rate.jpg << _EOF_ + +set terminal png nocrop enhanced font verdana 12 size 640,480 +set logscale x +set logscale y +set grid +set xlabel 'Serialized object size, octets' +set ylabel 'decode(encode(obj)) rate, 1/sec' +plot '00' using 1:2 title 'json' smooth bezier, '00' using 1:3 title 'msgpack' smooth bezier, '00' using 1:4 title 'bison' smooth bezier + +_EOF_ diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/size-rate.png b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/size-rate.png new file mode 100644 index 00000000..c9c2bee6 Binary files /dev/null and b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/size-rate.png differ diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/speed.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/speed.js new file mode 100644 index 00000000..8e43cbc0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/stress/speed/speed.js @@ -0,0 +1,84 @@ +var msgpack = require('node-msgpack'); +var bison = require('bison'); +var codec = { + JSON: { + encode: JSON.stringify, + decode: JSON.parse + }, + msgpack: { + encode: msgpack.pack, + decode: msgpack.unpack + }, + bison: bison +}; + +var obj, l; + +var s = '0'; +for (var i = 0; i < 12; ++i) s += s; + +obj = { + foo: s, + arrrrrr: [{a:1,b:false,c:null,d:1.0}, 1111, 2222, 33333333], + rand: [], + a: s, + ccc: s, + b: s + s + s +}; +for (i = 0; i < 100; ++i) obj.rand.push(Math.random()); +forObj(obj); + +obj = { + foo: s, + arrrrrr: [{a:1,b:false,c:null,d:1.0}, 1111, 2222, 33333333], + rand: [] +}; +for (i = 0; i < 100; ++i) obj.rand.push(Math.random()); +forObj(obj); + +obj = { + foo: s, + arrrrrr: [{a:1,b:false,c:null,d:1.0}, 1111, 2222, 33333333], + rand: [] +}; +forObj(obj); + +obj = { + arrrrrr: [{a:1,b:false,c:null,d:1.0}, 1111, 2222, 33333333], + rand: [] +}; +forObj(obj); + +function run(obj, codec) { + var t1 = Date.now(); + var n = 10000; + for (var i = 0; i < n; ++i) { + codec.decode(l = codec.encode(obj)); + } + var t2 = Date.now(); + //console.log('DONE', n*1000/(t2-t1), 'codecs/sec, length=', l.length); + return [n*1000/(t2-t1), l.length]; +} + +function series(obj, cname, n) { + var rate = 0; + var len = 0; + for (var i = 0; i < n; ++i) { + var r = run(obj, codec[cname]); + rate += r[0]; + len += r[1]; + } + rate /= n; + len /= n; + console.log(cname + ' ' + rate + ' ' + len); + return [rate, len]; +} + +function forObj(obj) { + var r = { + JSON: series(obj, 'JSON', 20), + msgpack: series(obj, 'msgpack', 20), + bison: series(obj, 'bison', 20) + }; + return r; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js new file mode 100644 index 00000000..ad1f4132 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/benches/sub_quit_test.js @@ -0,0 +1,18 @@ +var client = require("redis").createClient(), + client2 = require("redis").createClient(); + +client.subscribe("something"); +client.on("subscribe", function (channel, count) { + console.log("Got sub: " + channel); + client.unsubscribe("something"); +}); + +client.on("unsubscribe", function (channel, count) { + console.log("Got unsub: " + channel + ", quitting"); + client.quit(); +}); + +// exercise unsub before sub +client2.unsubscribe("something"); +client2.subscribe("another thing"); +client2.quit(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/changelog.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/changelog.md new file mode 100644 index 00000000..4248288c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/changelog.md @@ -0,0 +1,219 @@ +Changelog +========= + +## v0.7.2 - April 29, 2012 + +Many contributed fixes. Thank you, contributors. + +* [GH-190] - pub/sub mode fix (Brian Noguchi) +* [GH-165] - parser selection fix (TEHEK) +* numerous documentation and examples updates +* auth errors emit Errors instead of Strings (David Trejo) + +## v0.7.1 - November 15, 2011 + +Fix regression in reconnect logic. + +Very much need automated tests for reconnection and queue logic. + +## v0.7.0 - November 14, 2011 + +Many contributed fixes. Thanks everybody. + +* [GH-127] - properly re-initialize parser on reconnect +* [GH-136] - handle passing undefined as callback (Ian Babrou) +* [GH-139] - properly handle exceptions thrown in pub/sub event handlers (Felix Geisendörfer) +* [GH-141] - detect closing state on stream error (Felix Geisendörfer) +* [GH-142] - re-select database on reconnection (Jean-Hugues Pinson) +* [GH-146] - add sort example (Maksim Lin) + +Some more goodies: + +* Fix bugs with node 0.6 +* Performance improvements +* New version of `multi_bench.js` that tests more realistic scenarios +* [GH-140] - support optional callback for subscribe commands +* Properly flush and error out command queue when connection fails +* Initial work on reconnection thresholds + +## v0.6.7 - July 30, 2011 + +(accidentally skipped v0.6.6) + +Fix and test for [GH-123] + +Passing an Array as as the last argument should expand as users +expect. The old behavior was to coerce the arguments into Strings, +which did surprising things with Arrays. + +## v0.6.5 - July 6, 2011 + +Contributed changes: + +* Support SlowBuffers (Umair Siddique) +* Add Multi to exports (Louis-Philippe Perron) +* Fix for drain event calculation (Vladimir Dronnikov) + +Thanks! + +## v0.6.4 - June 30, 2011 + +Fix bug with optional callbacks for hmset. + +## v0.6.2 - June 30, 2011 + +Bugs fixed: + +* authentication retry while server is loading db (danmaz74) [GH-101] +* command arguments processing issue with arrays + +New features: + +* Auto update of new commands from redis.io (Dave Hoover) +* Performance improvements and backpressure controls. +* Commands now return the true/false value from the underlying socket write(s). +* Implement command_queue high water and low water for more better control of queueing. + +See `examples/backpressure_drain.js` for more information. + +## v0.6.1 - June 29, 2011 + +Add support and tests for Redis scripting through EXEC command. + +Bug fix for monitor mode. (forddg) + +Auto update of new commands from redis.io (Dave Hoover) + +## v0.6.0 - April 21, 2011 + +Lots of bugs fixed. + +* connection error did not properly trigger reconnection logic [GH-85] +* client.hmget(key, [val1, val2]) was not expanding properly [GH-66] +* client.quit() while in pub/sub mode would throw an error [GH-87] +* client.multi(['hmset', 'key', {foo: 'bar'}]) fails [GH-92] +* unsubscribe before subscribe would make things very confused [GH-88] +* Add BRPOPLPUSH [GH-79] + +## v0.5.11 - April 7, 2011 + +Added DISCARD + +I originally didn't think DISCARD would do anything here because of the clever MULTI interface, but somebody +pointed out to me that DISCARD can be used to flush the WATCH set. + +## v0.5.10 - April 6, 2011 + +Added HVALS + +## v0.5.9 - March 14, 2011 + +Fix bug with empty Array arguments - Andy Ray + +## v0.5.8 - March 14, 2011 + +Add `MONITOR` command and special monitor command reply parsing. + +## v0.5.7 - February 27, 2011 + +Add magical auth command. + +Authentication is now remembered by the client and will be automatically sent to the server +on every connection, including any reconnections. + +## v0.5.6 - February 22, 2011 + +Fix bug in ready check with `return_buffers` set to `true`. + +Thanks to Dean Mao and Austin Chau. + +## v0.5.5 - February 16, 2011 + +Add probe for server readiness. + +When a Redis server starts up, it might take a while to load the dataset into memory. +During this time, the server will accept connections, but will return errors for all non-INFO +commands. Now node_redis will send an INFO command whenever it connects to a server. +If the info command indicates that the server is not ready, the client will keep trying until +the server is ready. Once it is ready, the client will emit a "ready" event as well as the +"connect" event. The client will queue up all commands sent before the server is ready, just +like it did before. When the server is ready, all offline/non-ready commands will be replayed. +This should be backward compatible with previous versions. + +To disable this ready check behavior, set `options.no_ready_check` when creating the client. + +As a side effect of this change, the key/val params from the info command are available as +`client.server_options`. Further, the version string is decomposed into individual elements +in `client.server_options.versions`. + +## v0.5.4 - February 11, 2011 + +Fix excess memory consumption from Queue backing store. + +Thanks to Gustaf Sjöberg. + +## v0.5.3 - February 5, 2011 + +Fix multi/exec error reply callback logic. + +Thanks to Stella Laurenzo. + +## v0.5.2 - January 18, 2011 + +Fix bug where unhandled error replies confuse the parser. + +## v0.5.1 - January 18, 2011 + +Fix bug where subscribe commands would not handle redis-server startup error properly. + +## v0.5.0 - December 29, 2010 + +Some bug fixes: + +* An important bug fix in reconnection logic. Previously, reply callbacks would be invoked twice after + a reconnect. +* Changed error callback argument to be an actual Error object. + +New feature: + +* Add friendly syntax for HMSET using an object. + +## v0.4.1 - December 8, 2010 + +Remove warning about missing hiredis. You probably do want it though. + +## v0.4.0 - December 5, 2010 + +Support for multiple response parsers and hiredis C library from Pieter Noordhuis. +Return Strings instead of Buffers by default. +Empty nested mb reply bug fix. + +## v0.3.9 - November 30, 2010 + +Fix parser bug on failed EXECs. + +## v0.3.8 - November 10, 2010 + +Fix for null MULTI response when WATCH condition fails. + +## v0.3.7 - November 9, 2010 + +Add "drain" and "idle" events. + +## v0.3.6 - November 3, 2010 + +Add all known Redis commands from Redis master, even ones that are coming in 2.2 and beyond. + +Send a friendlier "error" event message on stream errors like connection refused / reset. + +## v0.3.5 - October 21, 2010 + +A few bug fixes. + +* Fixed bug with `nil` multi-bulk reply lengths that showed up with `BLPOP` timeouts. +* Only emit `end` once when connection goes away. +* Fixed bug in `test.js` where driver finished before all tests completed. + +## unversioned wasteland + +See the git history for what happened before. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/diff_multi_bench_output.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/diff_multi_bench_output.js new file mode 100755 index 00000000..99fdf4df --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/diff_multi_bench_output.js @@ -0,0 +1,87 @@ +#!/usr/bin/env node + +var colors = require('colors'), + fs = require('fs'), + _ = require('underscore'), + metrics = require('metrics'), + + // `node diff_multi_bench_output.js before.txt after.txt` + before = process.argv[2], + after = process.argv[3]; + +if (!before || !after) { + console.log('Please supply two file arguments:'); + var n = __filename; + n = n.substring(n.lastIndexOf('/', n.length)); + console.log(' ./' + n + ' multiBenchBefore.txt multiBenchAfter.txt'); + console.log('To generate multiBenchBefore.txt, run'); + console.log(' node multi_bench.js > multiBenchBefore.txt'); + console.log('Thank you for benchmarking responsibly.'); + return; +} + +var before_lines = fs.readFileSync(before, 'utf8').split('\n'), + after_lines = fs.readFileSync(after, 'utf8').split('\n'); + +console.log('Comparing before,', before.green, '(', before_lines.length, + 'lines)', 'to after,', after.green, '(', after_lines.length, 'lines)'); + +var total_ops = new metrics.Histogram.createUniformHistogram(); + +before_lines.forEach(function(b, i) { + var a = after_lines[i]; + if (!a || !b || !b.trim() || !a.trim()) { + // console.log('#ignored#', '>'+a+'<', '>'+b+'<'); + return; + } + + b_words = b.split(' ').filter(is_whitespace); + a_words = a.split(' ').filter(is_whitespace); + + var ops = + [b_words, a_words] + .map(function(words) { + // console.log(words); + return parseInt10(words.slice(-2, -1)); + }).filter(function(num) { + var isNaN = !num && num !== 0; + return !isNaN; + }); + if (ops.length != 2) return + + var delta = ops[1] - ops[0]; + + total_ops.update(delta); + + delta = humanize_diff(delta); + console.log( + // name of test + command_name(a_words) == command_name(b_words) + ? command_name(a_words) + ':' + : '404:', + // results of test + ops.join(' -> '), 'ops/sec (∆', delta, ')'); +}); + +console.log('Mean difference in ops/sec:', humanize_diff(total_ops.mean())); + +function is_whitespace(s) { + return !!s.trim(); +} + +function parseInt10(s) { + return parseInt(s, 10); +} + +// green if greater than 0, red otherwise +function humanize_diff(num) { + if (num > 0) { + return ('+' + num).green; + } + return ('' + num).red; +} + +function command_name(words) { + var line = words.join(' '); + return line.substr(0, line.indexOf(',')); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/auth.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/auth.js new file mode 100644 index 00000000..6c0a563c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/auth.js @@ -0,0 +1,5 @@ +var redis = require("redis"), + client = redis.createClient(); + +// This command is magical. Client stashes the password and will issue on every connect. +client.auth("somepass"); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js new file mode 100644 index 00000000..3488ef4d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/backpressure_drain.js @@ -0,0 +1,33 @@ +var redis = require("../index"), + client = redis.createClient(null, null, { + command_queue_high_water: 5, + command_queue_low_water: 1 + }), + remaining_ops = 100000, paused = false; + +function op() { + if (remaining_ops <= 0) { + console.error("Finished."); + process.exit(0); + } + + remaining_ops--; + if (client.hset("test hash", "val " + remaining_ops, remaining_ops) === false) { + console.log("Pausing at " + remaining_ops); + paused = true; + } else { + process.nextTick(op); + } +} + +client.on("drain", function () { + if (paused) { + console.log("Resuming at " + remaining_ops); + paused = false; + process.nextTick(op); + } else { + console.log("Got drain while not paused at " + remaining_ops); + } +}); + +op(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/eval.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/eval.js new file mode 100644 index 00000000..c1fbf8a5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/eval.js @@ -0,0 +1,9 @@ +var redis = require("./index"), + client = redis.createClient(); + +redis.debug_mode = true; + +client.eval("return 100.5", 0, function (err, res) { + console.dir(err); + console.dir(res); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/extend.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/extend.js new file mode 100644 index 00000000..488b8c2d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/extend.js @@ -0,0 +1,24 @@ +var redis = require("redis"), + client = redis.createClient(); + +// Extend the RedisClient prototype to add a custom method +// This one converts the results from "INFO" into a JavaScript Object + +redis.RedisClient.prototype.parse_info = function (callback) { + this.info(function (err, res) { + var lines = res.toString().split("\r\n").sort(); + var obj = {}; + lines.forEach(function (line) { + var parts = line.split(':'); + if (parts[1]) { + obj[parts[0]] = parts[1]; + } + }); + callback(obj) + }); +}; + +client.parse_info(function (info) { + console.dir(info); + client.quit(); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/file.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/file.js new file mode 100644 index 00000000..4d2b5d1c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/file.js @@ -0,0 +1,32 @@ +// Read a file from disk, store it in Redis, then read it back from Redis. + +var redis = require("redis"), + client = redis.createClient(), + fs = require("fs"), + filename = "kids_in_cart.jpg"; + +// Get the file I use for testing like this: +// curl http://ranney.com/kids_in_cart.jpg -o kids_in_cart.jpg +// or just use your own file. + +// Read a file from fs, store it in Redis, get it back from Redis, write it back to fs. +fs.readFile(filename, function (err, data) { + if (err) throw err + console.log("Read " + data.length + " bytes from filesystem."); + + client.set(filename, data, redis.print); // set entire file + client.get(filename, function (err, reply) { // get entire file + if (err) { + console.log("Get error: " + err); + } else { + fs.writeFile("duplicate_" + filename, reply, function (err) { + if (err) { + console.log("Error on write: " + err) + } else { + console.log("File written."); + } + client.end(); + }); + } + }); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/mget.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/mget.js new file mode 100644 index 00000000..936740d3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/mget.js @@ -0,0 +1,5 @@ +var client = require("redis").createClient(); + +client.mget(["sessions started", "sessions started", "foo"], function (err, res) { + console.dir(res); +}); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/monitor.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/monitor.js new file mode 100644 index 00000000..2cb6a4e1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/monitor.js @@ -0,0 +1,10 @@ +var client = require("../index").createClient(), + util = require("util"); + +client.monitor(function (err, res) { + console.log("Entering monitoring mode."); +}); + +client.on("monitor", function (time, args) { + console.log(time + ": " + util.inspect(args)); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/multi.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/multi.js new file mode 100644 index 00000000..35c08e18 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/multi.js @@ -0,0 +1,46 @@ +var redis = require("redis"), + client = redis.createClient(), set_size = 20; + +client.sadd("bigset", "a member"); +client.sadd("bigset", "another member"); + +while (set_size > 0) { + client.sadd("bigset", "member " + set_size); + set_size -= 1; +} + +// multi chain with an individual callback +client.multi() + .scard("bigset") + .smembers("bigset") + .keys("*", function (err, replies) { + client.mget(replies, redis.print); + }) + .dbsize() + .exec(function (err, replies) { + console.log("MULTI got " + replies.length + " replies"); + replies.forEach(function (reply, index) { + console.log("Reply " + index + ": " + reply.toString()); + }); + }); + +client.mset("incr thing", 100, "incr other thing", 1, redis.print); + +// start a separate multi command queue +var multi = client.multi(); +multi.incr("incr thing", redis.print); +multi.incr("incr other thing", redis.print); + +// runs immediately +client.get("incr thing", redis.print); // 100 + +// drains multi queue and runs atomically +multi.exec(function (err, replies) { + console.log(replies); // 101, 2 +}); + +// you can re-run the same transaction if you like +multi.exec(function (err, replies) { + console.log(replies); // 102, 3 + client.quit(); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/multi2.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/multi2.js new file mode 100644 index 00000000..8be4d731 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/multi2.js @@ -0,0 +1,29 @@ +var redis = require("redis"), + client = redis.createClient(), multi; + +// start a separate command queue for multi +multi = client.multi(); +multi.incr("incr thing", redis.print); +multi.incr("incr other thing", redis.print); + +// runs immediately +client.mset("incr thing", 100, "incr other thing", 1, redis.print); + +// drains multi queue and runs atomically +multi.exec(function (err, replies) { + console.log(replies); // 101, 2 +}); + +// you can re-run the same transaction if you like +multi.exec(function (err, replies) { + console.log(replies); // 102, 3 + client.quit(); +}); + +client.multi([ + ["mget", "multifoo", "multibar", redis.print], + ["incr", "multifoo"], + ["incr", "multibar"] +]).exec(function (err, replies) { + console.log(replies.toString()); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/psubscribe.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/psubscribe.js new file mode 100644 index 00000000..c57117b8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/psubscribe.js @@ -0,0 +1,33 @@ +var redis = require("redis"), + client1 = redis.createClient(), + client2 = redis.createClient(), + client3 = redis.createClient(), + client4 = redis.createClient(), + msg_count = 0; + +redis.debug_mode = false; + +client1.on("psubscribe", function (pattern, count) { + console.log("client1 psubscribed to " + pattern + ", " + count + " total subscriptions"); + client2.publish("channeltwo", "Me!"); + client3.publish("channelthree", "Me too!"); + client4.publish("channelfour", "And me too!"); +}); + +client1.on("punsubscribe", function (pattern, count) { + console.log("client1 punsubscribed from " + pattern + ", " + count + " total subscriptions"); + client4.end(); + client3.end(); + client2.end(); + client1.end(); +}); + +client1.on("pmessage", function (pattern, channel, message) { + console.log("("+ pattern +")" + " client1 received message on " + channel + ": " + message); + msg_count += 1; + if (msg_count === 3) { + client1.punsubscribe(); + } +}); + +client1.psubscribe("channel*"); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/pub_sub.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/pub_sub.js new file mode 100644 index 00000000..aa508d6c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/pub_sub.js @@ -0,0 +1,41 @@ +var redis = require("redis"), + client1 = redis.createClient(), msg_count = 0, + client2 = redis.createClient(); + +redis.debug_mode = false; + +// Most clients probably don't do much on "subscribe". This example uses it to coordinate things within one program. +client1.on("subscribe", function (channel, count) { + console.log("client1 subscribed to " + channel + ", " + count + " total subscriptions"); + if (count === 2) { + client2.publish("a nice channel", "I am sending a message."); + client2.publish("another one", "I am sending a second message."); + client2.publish("a nice channel", "I am sending my last message."); + } +}); + +client1.on("unsubscribe", function (channel, count) { + console.log("client1 unsubscribed from " + channel + ", " + count + " total subscriptions"); + if (count === 0) { + client2.end(); + client1.end(); + } +}); + +client1.on("message", function (channel, message) { + console.log("client1 channel " + channel + ": " + message); + msg_count += 1; + if (msg_count === 3) { + client1.unsubscribe(); + } +}); + +client1.on("ready", function () { + // if you need auth, do it here + client1.incr("did a thing"); + client1.subscribe("a nice channel", "another one"); +}); + +client2.on("ready", function () { + // if you need auth, do it here +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/simple.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/simple.js new file mode 100644 index 00000000..f1f2e320 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/simple.js @@ -0,0 +1,24 @@ +var redis = require("redis"), + client = redis.createClient(); + +client.on("error", function (err) { + console.log("error event - " + client.host + ":" + client.port + " - " + err); +}); + +client.set("string key", "string val", redis.print); +client.hset("hash key", "hashtest 1", "some value", redis.print); +client.hset(["hash key", "hashtest 2", "some other value"], redis.print); +client.hkeys("hash key", function (err, replies) { + if (err) { + return console.error("error response - " + err); + } + + console.log(replies.length + " replies:"); + replies.forEach(function (reply, i) { + console.log(" " + i + ": " + reply); + }); +}); + +client.quit(function (err, res) { + console.log("Exiting from quit command."); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/sort.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/sort.js new file mode 100644 index 00000000..e7c6249e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/sort.js @@ -0,0 +1,17 @@ +var redis = require("redis"), + client = redis.createClient(); + +client.sadd("mylist", 1); +client.sadd("mylist", 2); +client.sadd("mylist", 3); + +client.set("weight_1", 5); +client.set("weight_2", 500); +client.set("weight_3", 1); + +client.set("object_1", "foo"); +client.set("object_2", "bar"); +client.set("object_3", "qux"); + +client.sort("mylist", "by", "weight_*", "get", "object_*", redis.print); +// Prints Reply: qux,foo,bar \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/subqueries.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/subqueries.js new file mode 100644 index 00000000..560db240 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/subqueries.js @@ -0,0 +1,15 @@ +// Sending commands in response to other commands. +// This example runs "type" against every key in the database +// +var client = require("redis").createClient(); + +client.keys("*", function (err, keys) { + keys.forEach(function (key, pos) { + client.type(key, function (err, keytype) { + console.log(key + " is " + keytype); + if (pos === (keys.length - 1)) { + client.quit(); + } + }); + }); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/subquery.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/subquery.js new file mode 100644 index 00000000..861657e1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/subquery.js @@ -0,0 +1,19 @@ +var client = require("redis").createClient(); + +function print_results(obj) { + console.dir(obj); +} + +// build a map of all keys and their types +client.keys("*", function (err, all_keys) { + var key_types = {}; + + all_keys.forEach(function (key, pos) { // use second arg of forEach to get pos + client.type(key, function (err, type) { + key_types[key] = type; + if (pos === all_keys.length - 1) { // callbacks all run in order + print_results(key_types); + } + }); + }); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/unix_socket.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/unix_socket.js new file mode 100644 index 00000000..4a5e0bb0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/unix_socket.js @@ -0,0 +1,29 @@ +var redis = require("redis"), + client = redis.createClient("/tmp/redis.sock"), + profiler = require("v8-profiler"); + +client.on("connect", function () { + console.log("Got Unix socket connection.") +}); + +client.on("error", function (err) { + console.log(err.message); +}); + +client.set("space chars", "space value"); + +setInterval(function () { + client.get("space chars"); +}, 100); + +function done() { + client.info(function (err, reply) { + console.log(reply.toString()); + client.quit(); + }); +} + +setTimeout(function () { + console.log("Taking snapshot."); + var snap = profiler.takeSnapshot(); +}, 5000); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/web_server.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/web_server.js new file mode 100644 index 00000000..9fd85923 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/examples/web_server.js @@ -0,0 +1,31 @@ +// A simple web server that generates dyanmic content based on responses from Redis + +var http = require("http"), server, + redis_client = require("redis").createClient(); + +server = http.createServer(function (request, response) { + response.writeHead(200, { + "Content-Type": "text/plain" + }); + + var redis_info, total_requests; + + redis_client.info(function (err, reply) { + redis_info = reply; // stash response in outer scope + }); + redis_client.incr("requests", function (err, reply) { + total_requests = reply; // stash response in outer scope + }); + redis_client.hincrby("ip", request.connection.remoteAddress, 1); + redis_client.hgetall("ip", function (err, reply) { + // This is the last reply, so all of the previous replies must have completed already + response.write("This page was generated after talking to redis.\n\n" + + "Redis info:\n" + redis_info + "\n" + + "Total requests: " + total_requests + "\n\n" + + "IP count: \n"); + Object.keys(reply).forEach(function (ip) { + response.write(" " + ip + ": " + reply[ip] + "\n"); + }); + response.end(); + }); +}).listen(80); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/generate_commands.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/generate_commands.js new file mode 100644 index 00000000..e6949d3a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/generate_commands.js @@ -0,0 +1,39 @@ +var http = require("http"), + fs = require("fs"); + +function prettyCurrentTime() { + var date = new Date(); + return date.toLocaleString(); +} + +function write_file(commands, path) { + var file_contents, out_commands; + + console.log("Writing " + Object.keys(commands).length + " commands to " + path); + + file_contents = "// This file was generated by ./generate_commands.js on " + prettyCurrentTime() + "\n"; + + out_commands = Object.keys(commands).map(function (key) { + return key.toLowerCase(); + }); + + file_contents += "module.exports = " + JSON.stringify(out_commands, null, " ") + ";\n"; + + fs.writeFile(path, file_contents); +} + +http.get({host: "redis.io", path: "/commands.json"}, function (res) { + var body = ""; + + console.log("Response from redis.io/commands.json: " + res.statusCode); + + res.on('data', function (chunk) { + body += chunk; + }); + + res.on('end', function () { + write_file(JSON.parse(body), "lib/commands.js"); + }); +}).on('error', function (e) { + console.log("Error fetching command list from redis.io: " + e.message); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/index.js new file mode 100644 index 00000000..61cb4e91 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/index.js @@ -0,0 +1,1113 @@ +/*global Buffer require exports console setTimeout */ + +var net = require("net"), + util = require("./lib/util"), + Queue = require("./lib/queue"), + to_array = require("./lib/to_array"), + events = require("events"), + crypto = require("crypto"), + parsers = [], commands, + connection_id = 0, + default_port = 6379, + default_host = "127.0.0.1"; + +// can set this to true to enable for all connections +exports.debug_mode = false; + +// hiredis might not be installed +try { + require("./lib/parser/hiredis"); + parsers.push(require("./lib/parser/hiredis")); +} catch (err) { + if (exports.debug_mode) { + console.warn("hiredis parser not installed."); + } +} + +parsers.push(require("./lib/parser/javascript")); + +function RedisClient(stream, options) { + this.stream = stream; + this.options = options = options || {}; + + this.connection_id = ++connection_id; + this.connected = false; + this.ready = false; + this.connections = 0; + if (this.options.socket_nodelay === undefined) { + this.options.socket_nodelay = true; + } + this.should_buffer = false; + this.command_queue_high_water = this.options.command_queue_high_water || 1000; + this.command_queue_low_water = this.options.command_queue_low_water || 0; + this.max_attempts = null; + if (options.max_attempts && !isNaN(options.max_attempts) && options.max_attempts > 0) { + this.max_attempts = +options.max_attempts; + } + this.command_queue = new Queue(); // holds sent commands to de-pipeline them + this.offline_queue = new Queue(); // holds commands issued but not able to be sent + this.commands_sent = 0; + this.connect_timeout = false; + if (options.connect_timeout && !isNaN(options.connect_timeout) && options.connect_timeout > 0) { + this.connect_timeout = +options.connect_timeout; + } + + this.enable_offline_queue = true; + if (typeof this.options.enable_offline_queue === "boolean") { + this.enable_offline_queue = this.options.enable_offline_queue; + } + + this.initialize_retry_vars(); + this.pub_sub_mode = false; + this.subscription_set = {}; + this.monitoring = false; + this.closing = false; + this.server_info = {}; + this.auth_pass = null; + this.parser_module = null; + this.selected_db = null; // save the selected db here, used when reconnecting + + this.old_state = null; + + var self = this; + + this.stream.on("connect", function () { + self.on_connect(); + }); + + this.stream.on("data", function (buffer_from_socket) { + self.on_data(buffer_from_socket); + }); + + this.stream.on("error", function (msg) { + self.on_error(msg.message); + }); + + this.stream.on("close", function () { + self.connection_gone("close"); + }); + + this.stream.on("end", function () { + self.connection_gone("end"); + }); + + this.stream.on("drain", function () { + self.should_buffer = false; + self.emit("drain"); + }); + + events.EventEmitter.call(this); +} +util.inherits(RedisClient, events.EventEmitter); +exports.RedisClient = RedisClient; + +RedisClient.prototype.initialize_retry_vars = function () { + this.retry_timer = null; + this.retry_totaltime = 0; + this.retry_delay = 150; + this.retry_backoff = 1.7; + this.attempts = 1; +}; + +// flush offline_queue and command_queue, erroring any items with a callback first +RedisClient.prototype.flush_and_error = function (message) { + var command_obj; + while (this.offline_queue.length > 0) { + command_obj = this.offline_queue.shift(); + if (typeof command_obj.callback === "function") { + command_obj.callback(message); + } + } + this.offline_queue = new Queue(); + + while (this.command_queue.length > 0) { + command_obj = this.command_queue.shift(); + if (typeof command_obj.callback === "function") { + command_obj.callback(message); + } + } + this.command_queue = new Queue(); +}; + +RedisClient.prototype.on_error = function (msg) { + var message = "Redis connection to " + this.host + ":" + this.port + " failed - " + msg, + self = this, command_obj; + + if (this.closing) { + return; + } + + if (exports.debug_mode) { + console.warn(message); + } + + this.flush_and_error(message); + + this.connected = false; + this.ready = false; + + this.emit("error", new Error(message)); + // "error" events get turned into exceptions if they aren't listened for. If the user handled this error + // then we should try to reconnect. + this.connection_gone("error"); +}; + +RedisClient.prototype.do_auth = function () { + var self = this; + + if (exports.debug_mode) { + console.log("Sending auth to " + self.host + ":" + self.port + " id " + self.connection_id); + } + self.send_anyway = true; + self.send_command("auth", [this.auth_pass], function (err, res) { + if (err) { + if (err.toString().match("LOADING")) { + // if redis is still loading the db, it will not authenticate and everything else will fail + console.log("Redis still loading, trying to authenticate later"); + setTimeout(function () { + self.do_auth(); + }, 2000); // TODO - magic number alert + return; + } else { + return self.emit("error", new Error("Auth error: " + err.message)); + } + } + if (res.toString() !== "OK") { + return self.emit("error", new Error("Auth failed: " + res.toString())); + } + if (exports.debug_mode) { + console.log("Auth succeeded " + self.host + ":" + self.port + " id " + self.connection_id); + } + if (self.auth_callback) { + self.auth_callback(err, res); + self.auth_callback = null; + } + + // now we are really connected + self.emit("connect"); + if (self.options.no_ready_check) { + self.on_ready(); + } else { + self.ready_check(); + } + }); + self.send_anyway = false; +}; + +RedisClient.prototype.on_connect = function () { + if (exports.debug_mode) { + console.log("Stream connected " + this.host + ":" + this.port + " id " + this.connection_id); + } + var self = this; + + this.connected = true; + this.ready = false; + this.attempts = 0; + this.connections += 1; + this.command_queue = new Queue(); + this.emitted_end = false; + this.initialize_retry_vars(); + if (this.options.socket_nodelay) { + this.stream.setNoDelay(); + } + this.stream.setTimeout(0); + + this.init_parser(); + + if (this.auth_pass) { + this.do_auth(); + } else { + this.emit("connect"); + + if (this.options.no_ready_check) { + this.on_ready(); + } else { + this.ready_check(); + } + } +}; + +RedisClient.prototype.init_parser = function () { + var self = this; + + if (this.options.parser) { + if (! parsers.some(function (parser) { + if (parser.name === self.options.parser) { + self.parser_module = parser; + if (exports.debug_mode) { + console.log("Using parser module: " + self.parser_module.name); + } + return true; + } + })) { + throw new Error("Couldn't find named parser " + self.options.parser + " on this system"); + } + } else { + if (exports.debug_mode) { + console.log("Using default parser module: " + parsers[0].name); + } + this.parser_module = parsers[0]; + } + + this.parser_module.debug_mode = exports.debug_mode; + + // return_buffers sends back Buffers from parser to callback. detect_buffers sends back Buffers from parser, but + // converts to Strings if the input arguments are not Buffers. + this.reply_parser = new this.parser_module.Parser({ + return_buffers: self.options.return_buffers || self.options.detect_buffers || false + }); + + // "reply error" is an error sent back by Redis + this.reply_parser.on("reply error", function (reply) { + self.return_error(new Error(reply)); + }); + this.reply_parser.on("reply", function (reply) { + self.return_reply(reply); + }); + // "error" is bad. Somehow the parser got confused. It'll try to reset and continue. + this.reply_parser.on("error", function (err) { + self.emit("error", new Error("Redis reply parser error: " + err.stack)); + }); +}; + +RedisClient.prototype.on_ready = function () { + var self = this; + + this.ready = true; + + if (this.old_state !== null) { + this.monitoring = this.old_state.monitoring; + this.pub_sub_mode = this.old_state.pub_sub_mode; + this.selected_db = this.old_state.selected_db; + this.old_state = null; + } + + // magically restore any modal commands from a previous connection + if (this.selected_db !== null) { + this.send_command('select', [this.selected_db]); + } + if (this.pub_sub_mode === true) { + // only emit "ready" when all subscriptions were made again + var callback_count = 0; + var callback = function() { + callback_count--; + if (callback_count == 0) { + self.emit("ready"); + } + } + Object.keys(this.subscription_set).forEach(function (key) { + var parts = key.split(" "); + if (exports.debug_mode) { + console.warn("sending pub/sub on_ready " + parts[0] + ", " + parts[1]); + } + callback_count++; + self.send_command(parts[0] + "scribe", [parts[1]], callback); + }); + return; + } else if (this.monitoring) { + this.send_command("monitor"); + } else { + this.send_offline_queue(); + } + this.emit("ready"); +}; + +RedisClient.prototype.on_info_cmd = function (err, res) { + var self = this, obj = {}, lines, retry_time; + + if (err) { + return self.emit("error", new Error("Ready check failed: " + err.message)); + } + + lines = res.toString().split("\r\n"); + + lines.forEach(function (line) { + var parts = line.split(':'); + if (parts[1]) { + obj[parts[0]] = parts[1]; + } + }); + + obj.versions = []; + obj.redis_version.split('.').forEach(function (num) { + obj.versions.push(+num); + }); + + // expose info key/vals to users + this.server_info = obj; + + if (!obj.loading || (obj.loading && obj.loading === "0")) { + if (exports.debug_mode) { + console.log("Redis server ready."); + } + this.on_ready(); + } else { + retry_time = obj.loading_eta_seconds * 1000; + if (retry_time > 1000) { + retry_time = 1000; + } + if (exports.debug_mode) { + console.log("Redis server still loading, trying again in " + retry_time); + } + setTimeout(function () { + self.ready_check(); + }, retry_time); + } +}; + +RedisClient.prototype.ready_check = function () { + var self = this; + + if (exports.debug_mode) { + console.log("checking server ready state..."); + } + + this.send_anyway = true; // secret flag to send_command to send something even if not "ready" + this.info(function (err, res) { + self.on_info_cmd(err, res); + }); + this.send_anyway = false; +}; + +RedisClient.prototype.send_offline_queue = function () { + var command_obj, buffered_writes = 0; + + while (this.offline_queue.length > 0) { + command_obj = this.offline_queue.shift(); + if (exports.debug_mode) { + console.log("Sending offline command: " + command_obj.command); + } + buffered_writes += !this.send_command(command_obj.command, command_obj.args, command_obj.callback); + } + this.offline_queue = new Queue(); + // Even though items were shifted off, Queue backing store still uses memory until next add, so just get a new Queue + + if (!buffered_writes) { + this.should_buffer = false; + this.emit("drain"); + } +}; + +RedisClient.prototype.connection_gone = function (why) { + var self = this, message; + + // If a retry is already in progress, just let that happen + if (this.retry_timer) { + return; + } + + if (exports.debug_mode) { + console.warn("Redis connection is gone from " + why + " event."); + } + this.connected = false; + this.ready = false; + + if (this.old_state === null) { + var state = { + monitoring: this.monitoring, + pub_sub_mode: this.pub_sub_mode, + selected_db: this.selected_db + }; + this.old_state = state; + this.monitoring = false; + this.pub_sub_mode = false; + this.selected_db = null; + } + + // since we are collapsing end and close, users don't expect to be called twice + if (! this.emitted_end) { + this.emit("end"); + this.emitted_end = true; + } + + this.flush_and_error("Redis connection gone from " + why + " event."); + + // If this is a requested shutdown, then don't retry + if (this.closing) { + this.retry_timer = null; + if (exports.debug_mode) { + console.warn("connection ended from quit command, not retrying."); + } + return; + } + + this.retry_delay = Math.floor(this.retry_delay * this.retry_backoff); + + if (exports.debug_mode) { + console.log("Retry connection in " + this.current_retry_delay + " ms"); + } + + if (this.max_attempts && this.attempts >= this.max_attempts) { + this.retry_timer = null; + // TODO - some people need a "Redis is Broken mode" for future commands that errors immediately, and others + // want the program to exit. Right now, we just log, which doesn't really help in either case. + console.error("node_redis: Couldn't get Redis connection after " + this.max_attempts + " attempts."); + return; + } + + this.attempts += 1; + this.emit("reconnecting", { + delay: self.retry_delay, + attempt: self.attempts + }); + this.retry_timer = setTimeout(function () { + if (exports.debug_mode) { + console.log("Retrying connection..."); + } + + self.retry_totaltime += self.current_retry_delay; + + if (self.connect_timeout && self.retry_totaltime >= self.connect_timeout) { + self.retry_timer = null; + // TODO - engage Redis is Broken mode for future commands, or whatever + console.error("node_redis: Couldn't get Redis connection after " + self.retry_totaltime + "ms."); + return; + } + + self.stream.connect(self.port, self.host); + self.retry_timer = null; + }, this.retry_delay); +}; + +RedisClient.prototype.on_data = function (data) { + if (exports.debug_mode) { + console.log("net read " + this.host + ":" + this.port + " id " + this.connection_id + ": " + data.toString()); + } + + try { + this.reply_parser.execute(data); + } catch (err) { + // This is an unexpected parser problem, an exception that came from the parser code itself. + // Parser should emit "error" events if it notices things are out of whack. + // Callbacks that throw exceptions will land in return_reply(), below. + // TODO - it might be nice to have a different "error" event for different types of errors + this.emit("error", err); + } +}; + +RedisClient.prototype.return_error = function (err) { + var command_obj = this.command_queue.shift(), queue_len = this.command_queue.getLength(); + + if (this.pub_sub_mode === false && queue_len === 0) { + this.emit("idle"); + this.command_queue = new Queue(); + } + if (this.should_buffer && queue_len <= this.command_queue_low_water) { + this.emit("drain"); + this.should_buffer = false; + } + + if (command_obj && typeof command_obj.callback === "function") { + try { + command_obj.callback(err); + } catch (callback_err) { + // if a callback throws an exception, re-throw it on a new stack so the parser can keep going + process.nextTick(function () { + throw callback_err; + }); + } + } else { + console.log("node_redis: no callback to send error: " + err.message); + // this will probably not make it anywhere useful, but we might as well throw + process.nextTick(function () { + throw err; + }); + } +}; + +// if a callback throws an exception, re-throw it on a new stack so the parser can keep going. +// put this try/catch in its own function because V8 doesn't optimize this well yet. +function try_callback(callback, reply) { + try { + callback(null, reply); + } catch (err) { + process.nextTick(function () { + throw err; + }); + } +} + +// hgetall converts its replies to an Object. If the reply is empty, null is returned. +function reply_to_object(reply) { + var obj = {}, j, jl, key, val; + + if (reply.length === 0) { + return null; + } + + for (j = 0, jl = reply.length; j < jl; j += 2) { + key = reply[j].toString(); + val = reply[j + 1]; + obj[key] = val; + } + + return obj; +} + +function reply_to_strings(reply) { + var i; + + if (Buffer.isBuffer(reply)) { + return reply.toString(); + } + + if (Array.isArray(reply)) { + for (i = 0; i < reply.length; i++) { + reply[i] = reply[i].toString(); + } + return reply; + } + + return reply; +} + +RedisClient.prototype.return_reply = function (reply) { + var command_obj, obj, i, len, type, timestamp, argindex, args, queue_len; + + command_obj = this.command_queue.shift(), + queue_len = this.command_queue.getLength(); + + if (this.pub_sub_mode === false && queue_len === 0) { + this.emit("idle"); + this.command_queue = new Queue(); // explicitly reclaim storage from old Queue + } + if (this.should_buffer && queue_len <= this.command_queue_low_water) { + this.emit("drain"); + this.should_buffer = false; + } + + if (command_obj && !command_obj.sub_command) { + if (typeof command_obj.callback === "function") { + if (this.options.detect_buffers && command_obj.buffer_args === false) { + // If detect_buffers option was specified, then the reply from the parser will be Buffers. + // If this command did not use Buffer arguments, then convert the reply to Strings here. + reply = reply_to_strings(reply); + } + + // TODO - confusing and error-prone that hgetall is special cased in two places + if (reply && 'hgetall' === command_obj.command.toLowerCase()) { + reply = reply_to_object(reply); + } + + try_callback(command_obj.callback, reply); + } else if (exports.debug_mode) { + console.log("no callback for reply: " + (reply && reply.toString && reply.toString())); + } + } else if (this.pub_sub_mode || (command_obj && command_obj.sub_command)) { + if (Array.isArray(reply)) { + type = reply[0].toString(); + + if (type === "message") { + this.emit("message", reply[1].toString(), reply[2]); // channel, message + } else if (type === "pmessage") { + this.emit("pmessage", reply[1].toString(), reply[2].toString(), reply[3]); // pattern, channel, message + } else if (type === "subscribe" || type === "unsubscribe" || type === "psubscribe" || type === "punsubscribe") { + if (reply[2] === 0) { + this.pub_sub_mode = false; + if (this.debug_mode) { + console.log("All subscriptions removed, exiting pub/sub mode"); + } + } else { + this.pub_sub_mode = true; + } + // subscribe commands take an optional callback and also emit an event, but only the first response is included in the callback + // TODO - document this or fix it so it works in a more obvious way + if (command_obj && typeof command_obj.callback === "function") { + try_callback(command_obj.callback, reply[1].toString()); + } + this.emit(type, reply[1].toString(), reply[2]); // channel, count + } else { + throw new Error("subscriptions are active but got unknown reply type " + type); + } + } else if (! this.closing) { + throw new Error("subscriptions are active but got an invalid reply: " + reply); + } + } else if (this.monitoring) { + len = reply.indexOf(" "); + timestamp = reply.slice(0, len); + argindex = reply.indexOf('"'); + args = reply.slice(argindex + 1, -1).split('" "').map(function (elem) { + return elem.replace(/\\"/g, '"'); + }); + this.emit("monitor", timestamp, args); + } else { + throw new Error("node_redis command queue state error. If you can reproduce this, please report it."); + } +}; + +// This Command constructor is ever so slightly faster than using an object literal, but more importantly, using +// a named constructor helps it show up meaningfully in the V8 CPU profiler and in heap snapshots. +function Command(command, args, sub_command, buffer_args, callback) { + this.command = command; + this.args = args; + this.sub_command = sub_command; + this.buffer_args = buffer_args; + this.callback = callback; +} + +RedisClient.prototype.send_command = function (command, args, callback) { + var arg, this_args, command_obj, i, il, elem_count, buffer_args, stream = this.stream, command_str = "", buffered_writes = 0, last_arg_type; + + if (typeof command !== "string") { + throw new Error("First argument to send_command must be the command name string, not " + typeof command); + } + + if (Array.isArray(args)) { + if (typeof callback === "function") { + // probably the fastest way: + // client.command([arg1, arg2], cb); (straight passthrough) + // send_command(command, [arg1, arg2], cb); + } else if (! callback) { + // most people find this variable argument length form more convenient, but it uses arguments, which is slower + // client.command(arg1, arg2, cb); (wraps up arguments into an array) + // send_command(command, [arg1, arg2, cb]); + // client.command(arg1, arg2); (callback is optional) + // send_command(command, [arg1, arg2]); + // client.command(arg1, arg2, undefined); (callback is undefined) + // send_command(command, [arg1, arg2, undefined]); + last_arg_type = typeof args[args.length - 1]; + if (last_arg_type === "function" || last_arg_type === "undefined") { + callback = args.pop(); + } + } else { + throw new Error("send_command: last argument must be a callback or undefined"); + } + } else { + throw new Error("send_command: second argument must be an array"); + } + + // if the last argument is an array and command is sadd, expand it out: + // client.sadd(arg1, [arg2, arg3, arg4], cb); + // converts to: + // client.sadd(arg1, arg2, arg3, arg4, cb); + if ((command === 'sadd' || command === 'SADD') && args.length > 0 && Array.isArray(args[args.length - 1])) { + args = args.slice(0, -1).concat(args[args.length - 1]); + } + + buffer_args = false; + for (i = 0, il = args.length, arg; i < il; i += 1) { + if (Buffer.isBuffer(args[i])) { + buffer_args = true; + } + } + + command_obj = new Command(command, args, false, buffer_args, callback); + + if ((!this.ready && !this.send_anyway) || !stream.writable) { + if (exports.debug_mode) { + if (!stream.writable) { + console.log("send command: stream is not writeable."); + } + } + + if (this.enable_offline_queue) { + if (exports.debug_mode) { + console.log("Queueing " + command + " for next server connection."); + } + this.offline_queue.push(command_obj); + this.should_buffer = true; + } else { + var not_writeable_error = new Error('send_command: stream not writeable. enable_offline_queue is false'); + if (command_obj.callback) { + command_obj.callback(not_writeable_error); + } else { + throw not_writeable_error; + } + } + + return false; + } + + if (command === "subscribe" || command === "psubscribe" || command === "unsubscribe" || command === "punsubscribe") { + this.pub_sub_command(command_obj); + } else if (command === "monitor") { + this.monitoring = true; + } else if (command === "quit") { + this.closing = true; + } else if (this.pub_sub_mode === true) { + throw new Error("Connection in pub/sub mode, only pub/sub commands may be used"); + } + this.command_queue.push(command_obj); + this.commands_sent += 1; + + elem_count = args.length + 1; + + // Always use "Multi bulk commands", but if passed any Buffer args, then do multiple writes, one for each arg. + // This means that using Buffers in commands is going to be slower, so use Strings if you don't already have a Buffer. + + command_str = "*" + elem_count + "\r\n$" + command.length + "\r\n" + command + "\r\n"; + + if (! buffer_args) { // Build up a string and send entire command in one write + for (i = 0, il = args.length, arg; i < il; i += 1) { + arg = args[i]; + if (typeof arg !== "string") { + arg = String(arg); + } + command_str += "$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"; + } + if (exports.debug_mode) { + console.log("send " + this.host + ":" + this.port + " id " + this.connection_id + ": " + command_str); + } + buffered_writes += !stream.write(command_str); + } else { + if (exports.debug_mode) { + console.log("send command (" + command_str + ") has Buffer arguments"); + } + buffered_writes += !stream.write(command_str); + + for (i = 0, il = args.length, arg; i < il; i += 1) { + arg = args[i]; + if (!(Buffer.isBuffer(arg) || arg instanceof String)) { + arg = String(arg); + } + + if (Buffer.isBuffer(arg)) { + if (arg.length === 0) { + if (exports.debug_mode) { + console.log("send_command: using empty string for 0 length buffer"); + } + buffered_writes += !stream.write("$0\r\n\r\n"); + } else { + buffered_writes += !stream.write("$" + arg.length + "\r\n"); + buffered_writes += !stream.write(arg); + buffered_writes += !stream.write("\r\n"); + if (exports.debug_mode) { + console.log("send_command: buffer send " + arg.length + " bytes"); + } + } + } else { + if (exports.debug_mode) { + console.log("send_command: string send " + Buffer.byteLength(arg) + " bytes: " + arg); + } + buffered_writes += !stream.write("$" + Buffer.byteLength(arg) + "\r\n" + arg + "\r\n"); + } + } + } + if (exports.debug_mode) { + console.log("send_command buffered_writes: " + buffered_writes, " should_buffer: " + this.should_buffer); + } + if (buffered_writes || this.command_queue.getLength() >= this.command_queue_high_water) { + this.should_buffer = true; + } + return !this.should_buffer; +}; + +RedisClient.prototype.pub_sub_command = function (command_obj) { + var i, key, command, args; + + if (this.pub_sub_mode === false && exports.debug_mode) { + console.log("Entering pub/sub mode from " + command_obj.command); + } + this.pub_sub_mode = true; + command_obj.sub_command = true; + + command = command_obj.command; + args = command_obj.args; + if (command === "subscribe" || command === "psubscribe") { + if (command === "subscribe") { + key = "sub"; + } else { + key = "psub"; + } + for (i = 0; i < args.length; i++) { + this.subscription_set[key + " " + args[i]] = true; + } + } else { + if (command === "unsubscribe") { + key = "sub"; + } else { + key = "psub"; + } + for (i = 0; i < args.length; i++) { + delete this.subscription_set[key + " " + args[i]]; + } + } +}; + +RedisClient.prototype.end = function () { + this.stream._events = {}; + this.connected = false; + this.ready = false; + return this.stream.end(); +}; + +function Multi(client, args) { + this.client = client; + this.queue = [["MULTI"]]; + if (Array.isArray(args)) { + this.queue = this.queue.concat(args); + } +} + +exports.Multi = Multi; + +// take 2 arrays and return the union of their elements +function set_union(seta, setb) { + var obj = {}; + + seta.forEach(function (val) { + obj[val] = true; + }); + setb.forEach(function (val) { + obj[val] = true; + }); + return Object.keys(obj); +} + +// This static list of commands is updated from time to time. ./lib/commands.js can be updated with generate_commands.js +commands = set_union(["get", "set", "setnx", "setex", "append", "strlen", "del", "exists", "setbit", "getbit", "setrange", "getrange", "substr", + "incr", "decr", "mget", "rpush", "lpush", "rpushx", "lpushx", "linsert", "rpop", "lpop", "brpop", "brpoplpush", "blpop", "llen", "lindex", + "lset", "lrange", "ltrim", "lrem", "rpoplpush", "sadd", "srem", "smove", "sismember", "scard", "spop", "srandmember", "sinter", "sinterstore", + "sunion", "sunionstore", "sdiff", "sdiffstore", "smembers", "zadd", "zincrby", "zrem", "zremrangebyscore", "zremrangebyrank", "zunionstore", + "zinterstore", "zrange", "zrangebyscore", "zrevrangebyscore", "zcount", "zrevrange", "zcard", "zscore", "zrank", "zrevrank", "hset", "hsetnx", + "hget", "hmset", "hmget", "hincrby", "hdel", "hlen", "hkeys", "hvals", "hgetall", "hexists", "incrby", "decrby", "getset", "mset", "msetnx", + "randomkey", "select", "move", "rename", "renamenx", "expire", "expireat", "keys", "dbsize", "auth", "ping", "echo", "save", "bgsave", + "bgrewriteaof", "shutdown", "lastsave", "type", "multi", "exec", "discard", "sync", "flushdb", "flushall", "sort", "info", "monitor", "ttl", + "persist", "slaveof", "debug", "config", "subscribe", "unsubscribe", "psubscribe", "punsubscribe", "publish", "watch", "unwatch", "cluster", + "restore", "migrate", "dump", "object", "client", "eval", "evalsha"], require("./lib/commands")); + +commands.forEach(function (command) { + RedisClient.prototype[command] = function (args, callback) { + if (Array.isArray(args) && typeof callback === "function") { + return this.send_command(command, args, callback); + } else { + return this.send_command(command, to_array(arguments)); + } + }; + RedisClient.prototype[command.toUpperCase()] = RedisClient.prototype[command]; + + Multi.prototype[command] = function () { + this.queue.push([command].concat(to_array(arguments))); + return this; + }; + Multi.prototype[command.toUpperCase()] = Multi.prototype[command]; +}); + +// store db in this.select_db to restore it on reconnect +RedisClient.prototype.select = function (db, callback) { + var self = this; + + this.send_command('select', [db], function (err, res) { + if (err === null) { + self.selected_db = db; + } + if (typeof(callback) === 'function') { + callback(err, res); + } + }); +}; +RedisClient.prototype.SELECT = RedisClient.prototype.select; + +// Stash auth for connect and reconnect. Send immediately if already connected. +RedisClient.prototype.auth = function () { + var args = to_array(arguments); + this.auth_pass = args[0]; + this.auth_callback = args[1]; + if (exports.debug_mode) { + console.log("Saving auth as " + this.auth_pass); + } + + if (this.connected) { + this.send_command("auth", args); + } +}; +RedisClient.prototype.AUTH = RedisClient.prototype.auth; + +RedisClient.prototype.hmget = function (arg1, arg2, arg3) { + if (Array.isArray(arg2) && typeof arg3 === "function") { + return this.send_command("hmget", [arg1].concat(arg2), arg3); + } else if (Array.isArray(arg1) && typeof arg2 === "function") { + return this.send_command("hmget", arg1, arg2); + } else { + return this.send_command("hmget", to_array(arguments)); + } +}; +RedisClient.prototype.HMGET = RedisClient.prototype.hmget; + +RedisClient.prototype.hmset = function (args, callback) { + var tmp_args, tmp_keys, i, il, key; + + if (Array.isArray(args) && typeof callback === "function") { + return this.send_command("hmset", args, callback); + } + + args = to_array(arguments); + if (typeof args[args.length - 1] === "function") { + callback = args[args.length - 1]; + args.length -= 1; + } else { + callback = null; + } + + if (args.length === 2 && typeof args[0] === "string" && typeof args[1] === "object") { + // User does: client.hmset(key, {key1: val1, key2: val2}) + tmp_args = [ args[0] ]; + tmp_keys = Object.keys(args[1]); + for (i = 0, il = tmp_keys.length; i < il ; i++) { + key = tmp_keys[i]; + tmp_args.push(key); + if (typeof args[1][key] !== "string") { + var err = new Error("hmset expected value to be a string", key, ":", args[1][key]); + if (callback) return callback(err); + else throw err; + } + tmp_args.push(args[1][key]); + } + args = tmp_args; + } + + return this.send_command("hmset", args, callback); +}; +RedisClient.prototype.HMSET = RedisClient.prototype.hmset; + +Multi.prototype.hmset = function () { + var args = to_array(arguments), tmp_args; + if (args.length >= 2 && typeof args[0] === "string" && typeof args[1] === "object") { + tmp_args = [ "hmset", args[0] ]; + Object.keys(args[1]).map(function (key) { + tmp_args.push(key); + tmp_args.push(args[1][key]); + }); + if (args[2]) { + tmp_args.push(args[2]); + } + args = tmp_args; + } else { + args.unshift("hmset"); + } + + this.queue.push(args); + return this; +}; +Multi.prototype.HMSET = Multi.prototype.hmset; + +Multi.prototype.exec = function (callback) { + var self = this; + + // drain queue, callback will catch "QUEUED" or error + // TODO - get rid of all of these anonymous functions which are elegant but slow + this.queue.forEach(function (args, index) { + var command = args[0], obj; + if (typeof args[args.length - 1] === "function") { + args = args.slice(1, -1); + } else { + args = args.slice(1); + } + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0]; + } + if (command.toLowerCase() === 'hmset' && typeof args[1] === 'object') { + obj = args.pop(); + Object.keys(obj).forEach(function (key) { + args.push(key); + args.push(obj[key]); + }); + } + this.client.send_command(command, args, function (err, reply) { + if (err) { + var cur = self.queue[index]; + if (typeof cur[cur.length - 1] === "function") { + cur[cur.length - 1](err); + } else { + throw new Error(err); + } + self.queue.splice(index, 1); + } + }); + }, this); + + // TODO - make this callback part of Multi.prototype instead of creating it each time + return this.client.send_command("EXEC", [], function (err, replies) { + if (err) { + if (callback) { + callback(new Error(err)); + return; + } else { + throw new Error(err); + } + } + + var i, il, j, jl, reply, args; + + if (replies) { + for (i = 1, il = self.queue.length; i < il; i += 1) { + reply = replies[i - 1]; + args = self.queue[i]; + + // TODO - confusing and error-prone that hgetall is special cased in two places + if (reply && args[0].toLowerCase() === "hgetall") { + replies[i - 1] = reply = reply_to_object(reply); + } + + if (typeof args[args.length - 1] === "function") { + args[args.length - 1](null, reply); + } + } + } + + if (callback) { + callback(null, replies); + } + }); +}; +Multi.prototype.EXEC = Multi.prototype.exec; + +RedisClient.prototype.multi = function (args) { + return new Multi(this, args); +}; +RedisClient.prototype.MULTI = function (args) { + return new Multi(this, args); +}; + + +// stash original eval method +var eval = RedisClient.prototype.eval; +// hook eval with an attempt to evalsha for cached scripts +RedisClient.prototype.eval = +RedisClient.prototype.EVAL = function () { + var self = this, + args = to_array(arguments), + callback; + + if (typeof args[args.length - 1] === "function") { + callback = args.pop(); + } + + // replace script source with sha value + var source = args[0]; + args[0] = crypto.createHash("sha1").update(source).digest("hex"); + + self.evalsha(args, function (err, reply) { + if (err && /NOSCRIPT/.test(err.message)) { + args[0] = source; + eval.call(self, args, callback); + + } else if (callback) { + callback(err, reply); + } + }); +}; + + +exports.createClient = function (port_arg, host_arg, options) { + var port = port_arg || default_port, + host = host_arg || default_host, + redis_client, net_client; + + net_client = net.createConnection(port, host); + + redis_client = new RedisClient(net_client, options); + + redis_client.port = port; + redis_client.host = host; + + return redis_client; +}; + +exports.print = function (err, reply) { + if (err) { + console.log("Error: " + err); + } else { + console.log("Reply: " + reply); + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/commands.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/commands.js new file mode 100644 index 00000000..f57cca96 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/commands.js @@ -0,0 +1,147 @@ +// This file was generated by ./generate_commands.js on Mon Aug 06 2012 15:04:06 GMT-0700 (PDT) +module.exports = [ + "append", + "auth", + "bgrewriteaof", + "bgsave", + "bitcount", + "bitop", + "blpop", + "brpop", + "brpoplpush", + "client kill", + "client list", + "config get", + "config set", + "config resetstat", + "dbsize", + "debug object", + "debug segfault", + "decr", + "decrby", + "del", + "discard", + "dump", + "echo", + "eval", + "evalsha", + "exec", + "exists", + "expire", + "expireat", + "flushall", + "flushdb", + "get", + "getbit", + "getrange", + "getset", + "hdel", + "hexists", + "hget", + "hgetall", + "hincrby", + "hincrbyfloat", + "hkeys", + "hlen", + "hmget", + "hmset", + "hset", + "hsetnx", + "hvals", + "incr", + "incrby", + "incrbyfloat", + "info", + "keys", + "lastsave", + "lindex", + "linsert", + "llen", + "lpop", + "lpush", + "lpushx", + "lrange", + "lrem", + "lset", + "ltrim", + "mget", + "migrate", + "monitor", + "move", + "mset", + "msetnx", + "multi", + "object", + "persist", + "pexpire", + "pexpireat", + "ping", + "psetex", + "psubscribe", + "pttl", + "publish", + "punsubscribe", + "quit", + "randomkey", + "rename", + "renamenx", + "restore", + "rpop", + "rpoplpush", + "rpush", + "rpushx", + "sadd", + "save", + "scard", + "script exists", + "script flush", + "script kill", + "script load", + "sdiff", + "sdiffstore", + "select", + "set", + "setbit", + "setex", + "setnx", + "setrange", + "shutdown", + "sinter", + "sinterstore", + "sismember", + "slaveof", + "slowlog", + "smembers", + "smove", + "sort", + "spop", + "srandmember", + "srem", + "strlen", + "subscribe", + "sunion", + "sunionstore", + "sync", + "time", + "ttl", + "type", + "unsubscribe", + "unwatch", + "watch", + "zadd", + "zcard", + "zcount", + "zincrby", + "zinterstore", + "zrange", + "zrangebyscore", + "zrank", + "zrem", + "zremrangebyrank", + "zremrangebyscore", + "zrevrange", + "zrevrangebyscore", + "zrevrank", + "zscore", + "zunionstore" +]; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/parser/hiredis.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/parser/hiredis.js new file mode 100644 index 00000000..cbb15ba3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/parser/hiredis.js @@ -0,0 +1,46 @@ +/*global Buffer require exports console setTimeout */ + +var events = require("events"), + util = require("../util"), + hiredis = require("hiredis"); + +exports.debug_mode = false; +exports.name = "hiredis"; + +function HiredisReplyParser(options) { + this.name = exports.name; + this.options = options || {}; + this.reset(); + events.EventEmitter.call(this); +} + +util.inherits(HiredisReplyParser, events.EventEmitter); + +exports.Parser = HiredisReplyParser; + +HiredisReplyParser.prototype.reset = function () { + this.reader = new hiredis.Reader({ + return_buffers: this.options.return_buffers || false + }); +}; + +HiredisReplyParser.prototype.execute = function (data) { + var reply; + this.reader.feed(data); + while (true) { + try { + reply = this.reader.get(); + } catch (err) { + this.emit("error", err); + break; + } + + if (reply === undefined) break; + + if (reply && reply.constructor === Error) { + this.emit("reply error", reply); + } else { + this.emit("reply", reply); + } + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/parser/javascript.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/parser/javascript.js new file mode 100644 index 00000000..b8f5bc68 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/parser/javascript.js @@ -0,0 +1,317 @@ +/*global Buffer require exports console setTimeout */ + +// TODO - incorporate these V8 pro tips: +// pre-allocate Arrays if length is known in advance +// do not use delete +// use numbers for parser state + +var events = require("events"), + util = require("../util"); + +exports.debug_mode = false; +exports.name = "javascript"; + +function RedisReplyParser(options) { + this.name = exports.name; + this.options = options || {}; + this.reset(); + events.EventEmitter.call(this); +} + +util.inherits(RedisReplyParser, events.EventEmitter); + +exports.Parser = RedisReplyParser; + +// Buffer.toString() is quite slow for small strings +function small_toString(buf, len) { + var tmp = "", i; + + for (i = 0; i < len; i += 1) { + tmp += String.fromCharCode(buf[i]); + } + + return tmp; +} + +// Reset parser to it's original state. +RedisReplyParser.prototype.reset = function () { + this.return_buffer = new Buffer(16384); // for holding replies, might grow + this.return_string = ""; + this.tmp_string = ""; // for holding size fields + + this.multi_bulk_length = 0; + this.multi_bulk_replies = null; + this.multi_bulk_pos = 0; + this.multi_bulk_nested_length = 0; + this.multi_bulk_nested_replies = null; + + this.states = { + TYPE: 1, + SINGLE_LINE: 2, + MULTI_BULK_COUNT: 3, + INTEGER_LINE: 4, + BULK_LENGTH: 5, + ERROR_LINE: 6, + BULK_DATA: 7, + UNKNOWN_TYPE: 8, + FINAL_CR: 9, + FINAL_LF: 10, + MULTI_BULK_COUNT_LF: 11, + BULK_LF: 12 + }; + + this.state = this.states.TYPE; +}; + +RedisReplyParser.prototype.parser_error = function (message) { + this.emit("error", message); + this.reset(); +}; + +RedisReplyParser.prototype.execute = function (incoming_buf) { + var pos = 0, bd_tmp, bd_str, i, il, states = this.states; + //, state_times = {}, start_execute = new Date(), start_switch, end_switch, old_state; + //start_switch = new Date(); + + while (pos < incoming_buf.length) { + // old_state = this.state; + // console.log("execute: " + this.state + ", " + pos + "/" + incoming_buf.length + ", " + String.fromCharCode(incoming_buf[pos])); + + switch (this.state) { + case 1: // states.TYPE + this.type = incoming_buf[pos]; + pos += 1; + + switch (this.type) { + case 43: // + + this.state = states.SINGLE_LINE; + this.return_buffer.end = 0; + this.return_string = ""; + break; + case 42: // * + this.state = states.MULTI_BULK_COUNT; + this.tmp_string = ""; + break; + case 58: // : + this.state = states.INTEGER_LINE; + this.return_buffer.end = 0; + this.return_string = ""; + break; + case 36: // $ + this.state = states.BULK_LENGTH; + this.tmp_string = ""; + break; + case 45: // - + this.state = states.ERROR_LINE; + this.return_buffer.end = 0; + this.return_string = ""; + break; + default: + this.state = states.UNKNOWN_TYPE; + } + break; + case 4: // states.INTEGER_LINE + if (incoming_buf[pos] === 13) { + this.send_reply(+small_toString(this.return_buffer, this.return_buffer.end)); + this.state = states.FINAL_LF; + } else { + this.return_buffer[this.return_buffer.end] = incoming_buf[pos]; + this.return_buffer.end += 1; + } + pos += 1; + break; + case 6: // states.ERROR_LINE + if (incoming_buf[pos] === 13) { + this.send_error(this.return_buffer.toString("ascii", 0, this.return_buffer.end)); + this.state = states.FINAL_LF; + } else { + this.return_buffer[this.return_buffer.end] = incoming_buf[pos]; + this.return_buffer.end += 1; + } + pos += 1; + break; + case 2: // states.SINGLE_LINE + if (incoming_buf[pos] === 13) { + this.send_reply(this.return_string); + this.state = states.FINAL_LF; + } else { + this.return_string += String.fromCharCode(incoming_buf[pos]); + } + pos += 1; + break; + case 3: // states.MULTI_BULK_COUNT + if (incoming_buf[pos] === 13) { // \r + this.state = states.MULTI_BULK_COUNT_LF; + } else { + this.tmp_string += String.fromCharCode(incoming_buf[pos]); + } + pos += 1; + break; + case 11: // states.MULTI_BULK_COUNT_LF + if (incoming_buf[pos] === 10) { // \n + if (this.multi_bulk_length) { // nested multi-bulk + this.multi_bulk_nested_length = this.multi_bulk_length; + this.multi_bulk_nested_replies = this.multi_bulk_replies; + this.multi_bulk_nested_pos = this.multi_bulk_pos; + } + this.multi_bulk_length = +this.tmp_string; + this.multi_bulk_pos = 0; + this.state = states.TYPE; + if (this.multi_bulk_length < 0) { + this.send_reply(null); + this.multi_bulk_length = 0; + } else if (this.multi_bulk_length === 0) { + this.multi_bulk_pos = 0; + this.multi_bulk_replies = null; + this.send_reply([]); + } else { + this.multi_bulk_replies = new Array(this.multi_bulk_length); + } + } else { + this.parser_error(new Error("didn't see LF after NL reading multi bulk count")); + return; + } + pos += 1; + break; + case 5: // states.BULK_LENGTH + if (incoming_buf[pos] === 13) { // \r + this.state = states.BULK_LF; + } else { + this.tmp_string += String.fromCharCode(incoming_buf[pos]); + } + pos += 1; + break; + case 12: // states.BULK_LF + if (incoming_buf[pos] === 10) { // \n + this.bulk_length = +this.tmp_string; + if (this.bulk_length === -1) { + this.send_reply(null); + this.state = states.TYPE; + } else if (this.bulk_length === 0) { + this.send_reply(new Buffer("")); + this.state = states.FINAL_CR; + } else { + this.state = states.BULK_DATA; + if (this.bulk_length > this.return_buffer.length) { + if (exports.debug_mode) { + console.log("Growing return_buffer from " + this.return_buffer.length + " to " + this.bulk_length); + } + this.return_buffer = new Buffer(this.bulk_length); + } + this.return_buffer.end = 0; + } + } else { + this.parser_error(new Error("didn't see LF after NL while reading bulk length")); + return; + } + pos += 1; + break; + case 7: // states.BULK_DATA + this.return_buffer[this.return_buffer.end] = incoming_buf[pos]; + this.return_buffer.end += 1; + pos += 1; + if (this.return_buffer.end === this.bulk_length) { + bd_tmp = new Buffer(this.bulk_length); + // When the response is small, Buffer.copy() is a lot slower. + if (this.bulk_length > 10) { + this.return_buffer.copy(bd_tmp, 0, 0, this.bulk_length); + } else { + for (i = 0, il = this.bulk_length; i < il; i += 1) { + bd_tmp[i] = this.return_buffer[i]; + } + } + this.send_reply(bd_tmp); + this.state = states.FINAL_CR; + } + break; + case 9: // states.FINAL_CR + if (incoming_buf[pos] === 13) { // \r + this.state = states.FINAL_LF; + pos += 1; + } else { + this.parser_error(new Error("saw " + incoming_buf[pos] + " when expecting final CR")); + return; + } + break; + case 10: // states.FINAL_LF + if (incoming_buf[pos] === 10) { // \n + this.state = states.TYPE; + pos += 1; + } else { + this.parser_error(new Error("saw " + incoming_buf[pos] + " when expecting final LF")); + return; + } + break; + default: + this.parser_error(new Error("invalid state " + this.state)); + } + // end_switch = new Date(); + // if (state_times[old_state] === undefined) { + // state_times[old_state] = 0; + // } + // state_times[old_state] += (end_switch - start_switch); + // start_switch = end_switch; + } + // console.log("execute ran for " + (Date.now() - start_execute) + " ms, on " + incoming_buf.length + " Bytes. "); + // Object.keys(state_times).forEach(function (state) { + // console.log(" " + state + ": " + state_times[state]); + // }); +}; + +RedisReplyParser.prototype.send_error = function (reply) { + if (this.multi_bulk_length > 0 || this.multi_bulk_nested_length > 0) { + // TODO - can this happen? Seems like maybe not. + this.add_multi_bulk_reply(reply); + } else { + this.emit("reply error", reply); + } +}; + +RedisReplyParser.prototype.send_reply = function (reply) { + if (this.multi_bulk_length > 0 || this.multi_bulk_nested_length > 0) { + if (!this.options.return_buffers && Buffer.isBuffer(reply)) { + this.add_multi_bulk_reply(reply.toString("utf8")); + } else { + this.add_multi_bulk_reply(reply); + } + } else { + if (!this.options.return_buffers && Buffer.isBuffer(reply)) { + this.emit("reply", reply.toString("utf8")); + } else { + this.emit("reply", reply); + } + } +}; + +RedisReplyParser.prototype.add_multi_bulk_reply = function (reply) { + if (this.multi_bulk_replies) { + this.multi_bulk_replies[this.multi_bulk_pos] = reply; + this.multi_bulk_pos += 1; + if (this.multi_bulk_pos < this.multi_bulk_length) { + return; + } + } else { + this.multi_bulk_replies = reply; + } + + if (this.multi_bulk_nested_length > 0) { + this.multi_bulk_nested_replies[this.multi_bulk_nested_pos] = this.multi_bulk_replies; + this.multi_bulk_nested_pos += 1; + + this.multi_bulk_length = 0; + this.multi_bulk_replies = null; + this.multi_bulk_pos = 0; + + if (this.multi_bulk_nested_length === this.multi_bulk_nested_pos) { + this.emit("reply", this.multi_bulk_nested_replies); + this.multi_bulk_nested_length = 0; + this.multi_bulk_nested_pos = 0; + this.multi_bulk_nested_replies = null; + } + } else { + this.emit("reply", this.multi_bulk_replies); + this.multi_bulk_length = 0; + this.multi_bulk_replies = null; + this.multi_bulk_pos = 0; + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/queue.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/queue.js new file mode 100644 index 00000000..56254e1c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/queue.js @@ -0,0 +1,61 @@ +var to_array = require("./to_array"); + +// Queue class adapted from Tim Caswell's pattern library +// http://github.com/creationix/pattern/blob/master/lib/pattern/queue.js + +function Queue() { + this.tail = []; + this.head = []; + this.offset = 0; +} + +Queue.prototype.shift = function () { + if (this.offset === this.head.length) { + var tmp = this.head; + tmp.length = 0; + this.head = this.tail; + this.tail = tmp; + this.offset = 0; + if (this.head.length === 0) { + return; + } + } + return this.head[this.offset++]; // sorry, JSLint +}; + +Queue.prototype.push = function (item) { + return this.tail.push(item); +}; + +Queue.prototype.forEach = function (fn, thisv) { + var array = this.head.slice(this.offset), i, il; + + array.push.apply(array, this.tail); + + if (thisv) { + for (i = 0, il = array.length; i < il; i += 1) { + fn.call(thisv, array[i], i, array); + } + } else { + for (i = 0, il = array.length; i < il; i += 1) { + fn(array[i], i, array); + } + } + + return array; +}; + +Queue.prototype.getLength = function () { + return this.head.length - this.offset + this.tail.length; +}; + +Object.defineProperty(Queue.prototype, 'length', { + get: function () { + return this.getLength(); + } +}); + + +if(typeof module !== 'undefined' && module.exports) { + module.exports = Queue; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/to_array.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/to_array.js new file mode 100644 index 00000000..88a57e18 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/to_array.js @@ -0,0 +1,12 @@ +function to_array(args) { + var len = args.length, + arr = new Array(len), i; + + for (i = 0; i < len; i += 1) { + arr[i] = args[i]; + } + + return arr; +} + +module.exports = to_array; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/util.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/util.js new file mode 100644 index 00000000..fc255ae9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/lib/util.js @@ -0,0 +1,11 @@ +// Support for very old versions of node where the module was called "sys". At some point, we should abandon this. + +var util; + +try { + util = require("util"); +} catch (err) { + util = require("sys"); +} + +module.exports = util; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/mem.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/mem.js new file mode 100644 index 00000000..5144ab28 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/mem.js @@ -0,0 +1,11 @@ +var client = require("redis").createClient(); + +client.set("foo", "barvalskdjlksdjflkdsjflksdjdflkdsjflksdjflksdj", function (err, res) { + if (err) { + console.log("Got an error, please adapt somehow."); + } else { + console.log("Got a result: " + res); + } +}); + +client.quit(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/multi_bench.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/multi_bench.js new file mode 100644 index 00000000..5be2e564 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/multi_bench.js @@ -0,0 +1,225 @@ +var redis = require("./index"), + metrics = require("metrics"), + num_clients = parseInt(process.argv[2], 10) || 5, + num_requests = 20000, + tests = [], + versions_logged = false, + client_options = { + return_buffers: false + }, + small_str, large_str, small_buf, large_buf; + +redis.debug_mode = false; + +function lpad(input, len, chr) { + var str = input.toString(); + chr = chr || " "; + + while (str.length < len) { + str = chr + str; + } + return str; +} + +metrics.Histogram.prototype.print_line = function () { + var obj = this.printObj(); + + return lpad(obj.min, 4) + "/" + lpad(obj.max, 4) + "/" + lpad(obj.mean.toFixed(2), 7) + "/" + lpad(obj.p95.toFixed(2), 7); +}; + +function Test(args) { + var self = this; + + this.args = args; + + this.callback = null; + this.clients = []; + this.clients_ready = 0; + this.commands_sent = 0; + this.commands_completed = 0; + this.max_pipeline = this.args.pipeline || num_requests; + this.client_options = args.client_options || client_options; + + this.connect_latency = new metrics.Histogram(); + this.ready_latency = new metrics.Histogram(); + this.command_latency = new metrics.Histogram(); +} + +Test.prototype.run = function (callback) { + var self = this, i; + + this.callback = callback; + + for (i = 0; i < num_clients ; i++) { + this.new_client(i); + } +}; + +Test.prototype.new_client = function (id) { + var self = this, new_client; + + new_client = redis.createClient(6379, "127.0.0.1", this.client_options); + new_client.create_time = Date.now(); + + new_client.on("connect", function () { + self.connect_latency.update(Date.now() - new_client.create_time); + }); + + new_client.on("ready", function () { + if (! versions_logged) { + console.log("Client count: " + num_clients + ", node version: " + process.versions.node + ", server version: " + + new_client.server_info.redis_version + ", parser: " + new_client.reply_parser.name); + versions_logged = true; + } + self.ready_latency.update(Date.now() - new_client.create_time); + self.clients_ready++; + if (self.clients_ready === self.clients.length) { + self.on_clients_ready(); + } + }); + + self.clients[id] = new_client; +}; + +Test.prototype.on_clients_ready = function () { + process.stdout.write(lpad(this.args.descr, 13) + ", " + lpad(this.args.pipeline, 5) + "/" + this.clients_ready + " "); + this.test_start = Date.now(); + + this.fill_pipeline(); +}; + +Test.prototype.fill_pipeline = function () { + var pipeline = this.commands_sent - this.commands_completed; + + while (this.commands_sent < num_requests && pipeline < this.max_pipeline) { + this.commands_sent++; + pipeline++; + this.send_next(); + } + + if (this.commands_completed === num_requests) { + this.print_stats(); + this.stop_clients(); + } +}; + +Test.prototype.stop_clients = function () { + var self = this; + + this.clients.forEach(function (client, pos) { + if (pos === self.clients.length - 1) { + client.quit(function (err, res) { + self.callback(); + }); + } else { + client.quit(); + } + }); +}; + +Test.prototype.send_next = function () { + var self = this, + cur_client = this.commands_sent % this.clients.length, + command_num = this.commands_sent, + start = Date.now(); + + this.clients[cur_client][this.args.command](this.args.args, function (err, res) { + if (err) { + throw err; + } + self.commands_completed++; + self.command_latency.update(Date.now() - start); + self.fill_pipeline(); + }); +}; + +Test.prototype.print_stats = function () { + var duration = Date.now() - this.test_start; + + console.log("min/max/avg/p95: " + this.command_latency.print_line() + " " + lpad(duration, 6) + "ms total, " + + lpad((num_requests / (duration / 1000)).toFixed(2), 8) + " ops/sec"); +}; + +small_str = "1234"; +small_buf = new Buffer(small_str); +large_str = (new Array(4097).join("-")); +large_buf = new Buffer(large_str); + +tests.push(new Test({descr: "PING", command: "ping", args: [], pipeline: 1})); +tests.push(new Test({descr: "PING", command: "ping", args: [], pipeline: 50})); +tests.push(new Test({descr: "PING", command: "ping", args: [], pipeline: 200})); +tests.push(new Test({descr: "PING", command: "ping", args: [], pipeline: 20000})); + +tests.push(new Test({descr: "SET small str", command: "set", args: ["foo_rand000000000000", small_str], pipeline: 1})); +tests.push(new Test({descr: "SET small str", command: "set", args: ["foo_rand000000000000", small_str], pipeline: 50})); +tests.push(new Test({descr: "SET small str", command: "set", args: ["foo_rand000000000000", small_str], pipeline: 200})); +tests.push(new Test({descr: "SET small str", command: "set", args: ["foo_rand000000000000", small_str], pipeline: 20000})); + +tests.push(new Test({descr: "SET small buf", command: "set", args: ["foo_rand000000000000", small_buf], pipeline: 1})); +tests.push(new Test({descr: "SET small buf", command: "set", args: ["foo_rand000000000000", small_buf], pipeline: 50})); +tests.push(new Test({descr: "SET small buf", command: "set", args: ["foo_rand000000000000", small_buf], pipeline: 200})); +tests.push(new Test({descr: "SET small buf", command: "set", args: ["foo_rand000000000000", small_buf], pipeline: 20000})); + +tests.push(new Test({descr: "GET small str", command: "get", args: ["foo_rand000000000000"], pipeline: 1})); +tests.push(new Test({descr: "GET small str", command: "get", args: ["foo_rand000000000000"], pipeline: 50})); +tests.push(new Test({descr: "GET small str", command: "get", args: ["foo_rand000000000000"], pipeline: 200})); +tests.push(new Test({descr: "GET small str", command: "get", args: ["foo_rand000000000000"], pipeline: 20000})); + +tests.push(new Test({descr: "GET small buf", command: "get", args: ["foo_rand000000000000"], pipeline: 1, client_opts: { return_buffers: true} })); +tests.push(new Test({descr: "GET small buf", command: "get", args: ["foo_rand000000000000"], pipeline: 50, client_opts: { return_buffers: true} })); +tests.push(new Test({descr: "GET small buf", command: "get", args: ["foo_rand000000000000"], pipeline: 200, client_opts: { return_buffers: true} })); +tests.push(new Test({descr: "GET small buf", command: "get", args: ["foo_rand000000000000"], pipeline: 20000, client_opts: { return_buffers: true} })); + +tests.push(new Test({descr: "SET large str", command: "set", args: ["foo_rand000000000001", large_str], pipeline: 1})); +tests.push(new Test({descr: "SET large str", command: "set", args: ["foo_rand000000000001", large_str], pipeline: 50})); +tests.push(new Test({descr: "SET large str", command: "set", args: ["foo_rand000000000001", large_str], pipeline: 200})); +tests.push(new Test({descr: "SET large str", command: "set", args: ["foo_rand000000000001", large_str], pipeline: 20000})); + +tests.push(new Test({descr: "SET large buf", command: "set", args: ["foo_rand000000000001", large_buf], pipeline: 1})); +tests.push(new Test({descr: "SET large buf", command: "set", args: ["foo_rand000000000001", large_buf], pipeline: 50})); +tests.push(new Test({descr: "SET large buf", command: "set", args: ["foo_rand000000000001", large_buf], pipeline: 200})); +tests.push(new Test({descr: "SET large buf", command: "set", args: ["foo_rand000000000001", large_buf], pipeline: 20000})); + +tests.push(new Test({descr: "GET large str", command: "get", args: ["foo_rand000000000001"], pipeline: 1})); +tests.push(new Test({descr: "GET large str", command: "get", args: ["foo_rand000000000001"], pipeline: 50})); +tests.push(new Test({descr: "GET large str", command: "get", args: ["foo_rand000000000001"], pipeline: 200})); +tests.push(new Test({descr: "GET large str", command: "get", args: ["foo_rand000000000001"], pipeline: 20000})); + +tests.push(new Test({descr: "GET large buf", command: "get", args: ["foo_rand000000000001"], pipeline: 1, client_opts: { return_buffers: true} })); +tests.push(new Test({descr: "GET large buf", command: "get", args: ["foo_rand000000000001"], pipeline: 50, client_opts: { return_buffers: true} })); +tests.push(new Test({descr: "GET large buf", command: "get", args: ["foo_rand000000000001"], pipeline: 200, client_opts: { return_buffers: true} })); +tests.push(new Test({descr: "GET large buf", command: "get", args: ["foo_rand000000000001"], pipeline: 20000, client_opts: { return_buffers: true} })); + +tests.push(new Test({descr: "INCR", command: "incr", args: ["counter_rand000000000000"], pipeline: 1})); +tests.push(new Test({descr: "INCR", command: "incr", args: ["counter_rand000000000000"], pipeline: 50})); +tests.push(new Test({descr: "INCR", command: "incr", args: ["counter_rand000000000000"], pipeline: 200})); +tests.push(new Test({descr: "INCR", command: "incr", args: ["counter_rand000000000000"], pipeline: 20000})); + +tests.push(new Test({descr: "LPUSH", command: "lpush", args: ["mylist", small_str], pipeline: 1})); +tests.push(new Test({descr: "LPUSH", command: "lpush", args: ["mylist", small_str], pipeline: 50})); +tests.push(new Test({descr: "LPUSH", command: "lpush", args: ["mylist", small_str], pipeline: 200})); +tests.push(new Test({descr: "LPUSH", command: "lpush", args: ["mylist", small_str], pipeline: 20000})); + +tests.push(new Test({descr: "LRANGE 10", command: "lrange", args: ["mylist", "0", "9"], pipeline: 1})); +tests.push(new Test({descr: "LRANGE 10", command: "lrange", args: ["mylist", "0", "9"], pipeline: 50})); +tests.push(new Test({descr: "LRANGE 10", command: "lrange", args: ["mylist", "0", "9"], pipeline: 200})); +tests.push(new Test({descr: "LRANGE 10", command: "lrange", args: ["mylist", "0", "9"], pipeline: 20000})); + +tests.push(new Test({descr: "LRANGE 100", command: "lrange", args: ["mylist", "0", "99"], pipeline: 1})); +tests.push(new Test({descr: "LRANGE 100", command: "lrange", args: ["mylist", "0", "99"], pipeline: 50})); +tests.push(new Test({descr: "LRANGE 100", command: "lrange", args: ["mylist", "0", "99"], pipeline: 200})); +tests.push(new Test({descr: "LRANGE 100", command: "lrange", args: ["mylist", "0", "99"], pipeline: 20000})); + +function next() { + var test = tests.shift(); + if (test) { + test.run(function () { + next(); + }); + } else { + console.log("End of tests."); + process.exit(0); + } +} + +next(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/package.json new file mode 100644 index 00000000..35040090 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/package.json @@ -0,0 +1,48 @@ +{ + "name": "redis", + "version": "0.7.3", + "description": "Redis client library", + "author": { + "name": "Matt Ranney", + "email": "mjr@ranney.com" + }, + "maintainers": [ + { + "name": "mjr", + "email": "mjr@ranney.com" + } + ], + "main": "./index.js", + "scripts": { + "test": "node ./test.js" + }, + "devDependencies": { + "metrics": ">=0.1.5" + }, + "repository": { + "type": "git", + "url": "git://github.com/mranney/node_redis.git" + }, + "_npmUser": { + "name": "mjr", + "email": "mjr@ranney.com" + }, + "_id": "redis@0.7.3", + "dependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "_engineSupported": true, + "_npmVersion": "1.1.21", + "_nodeVersion": "v0.8.1", + "_defaultsLoaded": true, + "dist": { + "shasum": "ee57b7a44d25ec1594e44365d8165fa7d1d4811a", + "tarball": "http://registry.npmjs.org/redis/-/redis-0.7.3.tgz" + }, + "directories": {}, + "_shasum": "ee57b7a44d25ec1594e44365d8165fa7d1d4811a", + "_resolved": "https://registry.npmjs.org/redis/-/redis-0.7.3.tgz", + "_from": "redis@0.7.3" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/test.js new file mode 100644 index 00000000..0a03375e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/redis/test.js @@ -0,0 +1,1618 @@ +/*global require console setTimeout process Buffer */ +var redis = require("./index"), + client = redis.createClient(), + client2 = redis.createClient(), + client3 = redis.createClient(), + assert = require("assert"), + crypto = require("crypto"), + util = require("./lib/util"), + test_db_num = 15, // this DB will be flushed and used for testing + tests = {}, + connected = false, + ended = false, + next, cur_start, run_next_test, all_tests, all_start, test_count; + +// Set this to truthy to see the wire protocol and other debugging info +redis.debug_mode = process.argv[2]; + +function buffers_to_strings(arr) { + return arr.map(function (val) { + return val.toString(); + }); +} + +function require_number(expected, label) { + return function (err, results) { + assert.strictEqual(null, err, label + " expected " + expected + ", got error: " + err); + assert.strictEqual(expected, results, label + " " + expected + " !== " + results); + assert.strictEqual(typeof results, "number", label); + return true; + }; +} + +function require_number_any(label) { + return function (err, results) { + assert.strictEqual(null, err, label + " expected any number, got error: " + err); + assert.strictEqual(typeof results, "number", label + " " + results + " is not a number"); + return true; + }; +} + +function require_number_pos(label) { + return function (err, results) { + assert.strictEqual(null, err, label + " expected positive number, got error: " + err); + assert.strictEqual(true, (results > 0), label + " " + results + " is not a positive number"); + return true; + }; +} + +function require_string(str, label) { + return function (err, results) { + assert.strictEqual(null, err, label + " expected string '" + str + "', got error: " + err); + assert.equal(str, results, label + " " + str + " does not match " + results); + return true; + }; +} + +function require_null(label) { + return function (err, results) { + assert.strictEqual(null, err, label + " expected null, got error: " + err); + assert.strictEqual(null, results, label + ": " + results + " is not null"); + return true; + }; +} + +function require_error(label) { + return function (err, results) { + assert.notEqual(err, null, label + " err is null, but an error is expected here."); + return true; + }; +} + +function is_empty_array(obj) { + return Array.isArray(obj) && obj.length === 0; +} + +function last(name, fn) { + return function (err, results) { + fn(err, results); + next(name); + }; +} + +next = function next(name) { + console.log(" \x1b[33m" + (Date.now() - cur_start) + "\x1b[0m ms"); + run_next_test(); +}; + +// Tests are run in the order they are defined. So FLUSHDB should be stay first. + +tests.FLUSHDB = function () { + var name = "FLUSHDB"; + client.select(test_db_num, require_string("OK", name)); + client2.select(test_db_num, require_string("OK", name)); + client3.select(test_db_num, require_string("OK", name)); + client.mset("flush keys 1", "flush val 1", "flush keys 2", "flush val 2", require_string("OK", name)); + client.FLUSHDB(require_string("OK", name)); + client.dbsize(last(name, require_number(0, name))); +}; + +tests.MULTI_1 = function () { + var name = "MULTI_1", multi1, multi2; + + // Provoke an error at queue time + multi1 = client.multi(); + multi1.mset("multifoo", "10", "multibar", "20", require_string("OK", name)); + multi1.set("foo2", require_error(name)); + multi1.incr("multifoo", require_number(11, name)); + multi1.incr("multibar", require_number(21, name)); + multi1.exec(); + + // Confirm that the previous command, while containing an error, still worked. + multi2 = client.multi(); + multi2.incr("multibar", require_number(22, name)); + multi2.incr("multifoo", require_number(12, name)); + multi2.exec(function (err, replies) { + assert.strictEqual(22, replies[0]); + assert.strictEqual(12, replies[1]); + next(name); + }); +}; + +tests.MULTI_2 = function () { + var name = "MULTI_2"; + + // test nested multi-bulk replies + client.multi([ + ["mget", "multifoo", "multibar", function (err, res) { + assert.strictEqual(2, res.length, name); + assert.strictEqual("12", res[0].toString(), name); + assert.strictEqual("22", res[1].toString(), name); + }], + ["set", "foo2", require_error(name)], + ["incr", "multifoo", require_number(13, name)], + ["incr", "multibar", require_number(23, name)] + ]).exec(function (err, replies) { + assert.strictEqual(2, replies[0].length, name); + assert.strictEqual("12", replies[0][0].toString(), name); + assert.strictEqual("22", replies[0][1].toString(), name); + + assert.strictEqual("13", replies[1].toString()); + assert.strictEqual("23", replies[2].toString()); + next(name); + }); +}; + +tests.MULTI_3 = function () { + var name = "MULTI_3"; + + client.sadd("some set", "mem 1"); + client.sadd("some set", "mem 2"); + client.sadd("some set", "mem 3"); + client.sadd("some set", "mem 4"); + + // make sure empty mb reply works + client.del("some missing set"); + client.smembers("some missing set", function (err, reply) { + // make sure empty mb reply works + assert.strictEqual(true, is_empty_array(reply), name); + }); + + // test nested multi-bulk replies with empty mb elements. + client.multi([ + ["smembers", "some set"], + ["del", "some set"], + ["smembers", "some set"] + ]) + .scard("some set") + .exec(function (err, replies) { + assert.strictEqual(true, is_empty_array(replies[2]), name); + next(name); + }); +}; + +tests.MULTI_4 = function () { + var name = "MULTI_4"; + + client.multi() + .mset('some', '10', 'keys', '20') + .incr('some') + .incr('keys') + .mget('some', 'keys') + .exec(function (err, replies) { + assert.strictEqual(null, err); + assert.equal('OK', replies[0]); + assert.equal(11, replies[1]); + assert.equal(21, replies[2]); + assert.equal(11, replies[3][0].toString()); + assert.equal(21, replies[3][1].toString()); + next(name); + }); +}; + +tests.MULTI_5 = function () { + var name = "MULTI_5"; + + // test nested multi-bulk replies with nulls. + client.multi([ + ["mget", ["multifoo", "some", "random value", "keys"]], + ["incr", "multifoo"] + ]) + .exec(function (err, replies) { + assert.strictEqual(replies.length, 2, name); + assert.strictEqual(replies[0].length, 4, name); + next(name); + }); +}; + +tests.MULTI_6 = function () { + var name = "MULTI_6"; + + client.multi() + .hmset("multihash", "a", "foo", "b", 1) + .hmset("multihash", { + extra: "fancy", + things: "here" + }) + .hgetall("multihash") + .exec(function (err, replies) { + assert.strictEqual(null, err); + assert.equal("OK", replies[0]); + assert.equal(Object.keys(replies[2]).length, 4); + assert.equal("foo", replies[2].a); + assert.equal("1", replies[2].b); + assert.equal("fancy", replies[2].extra); + assert.equal("here", replies[2].things); + next(name); + }); +}; + +tests.EVAL_1 = function () { + var name = "EVAL_1"; + + if (client.server_info.versions[0] >= 2 && client.server_info.versions[1] >= 5) { + // test {EVAL - Lua integer -> Redis protocol type conversion} + client.eval("return 100.5", 0, require_number(100, name)); + // test {EVAL - Lua string -> Redis protocol type conversion} + client.eval("return 'hello world'", 0, require_string("hello world", name)); + // test {EVAL - Lua true boolean -> Redis protocol type conversion} + client.eval("return true", 0, require_number(1, name)); + // test {EVAL - Lua false boolean -> Redis protocol type conversion} + client.eval("return false", 0, require_null(name)); + // test {EVAL - Lua status code reply -> Redis protocol type conversion} + client.eval("return {ok='fine'}", 0, require_string("fine", name)); + // test {EVAL - Lua error reply -> Redis protocol type conversion} + client.eval("return {err='this is an error'}", 0, require_error(name)); + // test {EVAL - Lua table -> Redis protocol type conversion} + client.eval("return {1,2,3,'ciao',{1,2}}", 0, function (err, res) { + assert.strictEqual(5, res.length, name); + assert.strictEqual(1, res[0], name); + assert.strictEqual(2, res[1], name); + assert.strictEqual(3, res[2], name); + assert.strictEqual("ciao", res[3], name); + assert.strictEqual(2, res[4].length, name); + assert.strictEqual(1, res[4][0], name); + assert.strictEqual(2, res[4][1], name); + }); + // test {EVAL - Are the KEYS and ARGS arrays populated correctly?} + client.eval("return {KEYS[1],KEYS[2],ARGV[1],ARGV[2]}", 2, "a", "b", "c", "d", function (err, res) { + assert.strictEqual(4, res.length, name); + assert.strictEqual("a", res[0], name); + assert.strictEqual("b", res[1], name); + assert.strictEqual("c", res[2], name); + assert.strictEqual("d", res[3], name); + }); + + // prepare sha sum for evalsha cache test + var source = "return redis.call('get', 'sha test')", + sha = crypto.createHash('sha1').update(source).digest('hex'); + + client.set("sha test", "eval get sha test", function (err, res) { + if (err) throw err; + // test {EVAL - is Lua able to call Redis API?} + client.eval(source, 0, function (err, res) { + require_string("eval get sha test", name)(err, res); + // test {EVALSHA - Can we call a SHA1 if already defined?} + client.evalsha(sha, 0, require_string("eval get sha test", name)); + // test {EVALSHA - Do we get an error on non defined SHA1?} + client.evalsha("ffffffffffffffffffffffffffffffffffffffff", 0, require_error(name)); + }); + }); + + // test {EVAL - Redis integer -> Lua type conversion} + client.set("incr key", 0, function (err, reply) { + if (err) throw err; + client.eval("local foo = redis.call('incr','incr key')\n" + "return {type(foo),foo}", 0, function (err, res) { + if (err) throw err; + assert.strictEqual(2, res.length, name); + assert.strictEqual("number", res[0], name); + assert.strictEqual(1, res[1], name); + }); + }); + + client.set("bulk reply key", "bulk reply value", function (err, res) { + // test {EVAL - Redis bulk -> Lua type conversion} + client.eval("local foo = redis.call('get','bulk reply key'); return {type(foo),foo}", 0, function (err, res) { + if (err) throw err; + assert.strictEqual(2, res.length, name); + assert.strictEqual("string", res[0], name); + assert.strictEqual("bulk reply value", res[1], name); + }); + }); + + // test {EVAL - Redis multi bulk -> Lua type conversion} + client.multi() + .del("mylist") + .rpush("mylist", "a") + .rpush("mylist", "b") + .rpush("mylist", "c") + .exec(function (err, replies) { + if (err) throw err; + client.eval("local foo = redis.call('lrange','mylist',0,-1); return {type(foo),foo[1],foo[2],foo[3],# foo}", 0, function (err, res) { + assert.strictEqual(5, res.length, name); + assert.strictEqual("table", res[0], name); + assert.strictEqual("a", res[1], name); + assert.strictEqual("b", res[2], name); + assert.strictEqual("c", res[3], name); + assert.strictEqual(3, res[4], name); + }); + }); + // test {EVAL - Redis status reply -> Lua type conversion} + client.eval("local foo = redis.call('set','mykey','myval'); return {type(foo),foo['ok']}", 0, function (err, res) { + if (err) throw err; + assert.strictEqual(2, res.length, name); + assert.strictEqual("table", res[0], name); + assert.strictEqual("OK", res[1], name); + }); + // test {EVAL - Redis error reply -> Lua type conversion} + client.set("error reply key", "error reply value", function (err, res) { + if (err) throw err; + client.eval("local foo = redis.pcall('incr','error reply key'); return {type(foo),foo['err']}", 0, function (err, res) { + if (err) throw err; + assert.strictEqual(2, res.length, name); + assert.strictEqual("table", res[0], name); + assert.strictEqual("ERR value is not an integer or out of range", res[1], name); + }); + }); + // test {EVAL - Redis nil bulk reply -> Lua type conversion} + client.del("nil reply key", function (err, res) { + if (err) throw err; + client.eval("local foo = redis.call('get','nil reply key'); return {type(foo),foo == false}", 0, function (err, res) { + if (err) throw err; + assert.strictEqual(2, res.length, name); + assert.strictEqual("boolean", res[0], name); + assert.strictEqual(1, res[1], name); + next(name); + }); + }); + } else { + console.log("Skipping " + name + " because server version isn't new enough."); + next(name); + } +}; + +tests.WATCH_MULTI = function () { + var name = 'WATCH_MULTI', multi; + + if (client.server_info.versions[0] >= 2 && client.server_info.versions[1] >= 1) { + client.watch(name); + client.incr(name); + multi = client.multi(); + multi.incr(name); + multi.exec(last(name, require_null(name))); + } else { + console.log("Skipping " + name + " because server version isn't new enough."); + next(name); + } +}; + +tests.detect_buffers = function () { + var name = "detect_buffers", detect_client = redis.createClient(null, null, {detect_buffers: true}); + + detect_client.on("ready", function () { + // single Buffer or String + detect_client.set("string key 1", "string value"); + detect_client.get("string key 1", require_string("string value", name)); + detect_client.get(new Buffer("string key 1"), function (err, reply) { + assert.strictEqual(null, err, name); + assert.strictEqual(true, Buffer.isBuffer(reply), name); + assert.strictEqual("", reply.inspect(), name); + }); + + detect_client.hmset("hash key 2", "key 1", "val 1", "key 2", "val 2"); + // array of Buffers or Strings + detect_client.hmget("hash key 2", "key 1", "key 2", function (err, reply) { + assert.strictEqual(null, err, name); + assert.strictEqual(true, Array.isArray(reply), name); + assert.strictEqual(2, reply.length, name); + assert.strictEqual("val 1", reply[0], name); + assert.strictEqual("val 2", reply[1], name); + }); + detect_client.hmget(new Buffer("hash key 2"), "key 1", "key 2", function (err, reply) { + assert.strictEqual(null, err, name); + assert.strictEqual(true, Array.isArray(reply)); + assert.strictEqual(2, reply.length, name); + assert.strictEqual(true, Buffer.isBuffer(reply[0])); + assert.strictEqual(true, Buffer.isBuffer(reply[1])); + assert.strictEqual("", reply[0].inspect(), name); + assert.strictEqual("", reply[1].inspect(), name); + }); + + // Object of Buffers or Strings + detect_client.hgetall("hash key 2", function (err, reply) { + assert.strictEqual(null, err, name); + assert.strictEqual("object", typeof reply, name); + assert.strictEqual(2, Object.keys(reply).length, name); + assert.strictEqual("val 1", reply["key 1"], name); + assert.strictEqual("val 2", reply["key 2"], name); + }); + detect_client.hgetall(new Buffer("hash key 2"), function (err, reply) { + assert.strictEqual(null, err, name); + assert.strictEqual("object", typeof reply, name); + assert.strictEqual(2, Object.keys(reply).length, name); + assert.strictEqual(true, Buffer.isBuffer(reply["key 1"])); + assert.strictEqual(true, Buffer.isBuffer(reply["key 2"])); + assert.strictEqual("", reply["key 1"].inspect(), name); + assert.strictEqual("", reply["key 2"].inspect(), name); + }); + + detect_client.quit(function (err, res) { + next(name); + }); + }); +}; + +tests.socket_nodelay = function () { + var name = "socket_nodelay", c1, c2, c3, ready_count = 0, quit_count = 0; + + c1 = redis.createClient(null, null, {socket_nodelay: true}); + c2 = redis.createClient(null, null, {socket_nodelay: false}); + c3 = redis.createClient(null, null); + + function quit_check() { + quit_count++; + + if (quit_count === 3) { + next(name); + } + } + + function run() { + assert.strictEqual(true, c1.options.socket_nodelay, name); + assert.strictEqual(false, c2.options.socket_nodelay, name); + assert.strictEqual(true, c3.options.socket_nodelay, name); + + c1.set(["set key 1", "set val"], require_string("OK", name)); + c1.set(["set key 2", "set val"], require_string("OK", name)); + c1.get(["set key 1"], require_string("set val", name)); + c1.get(["set key 2"], require_string("set val", name)); + + c2.set(["set key 3", "set val"], require_string("OK", name)); + c2.set(["set key 4", "set val"], require_string("OK", name)); + c2.get(["set key 3"], require_string("set val", name)); + c2.get(["set key 4"], require_string("set val", name)); + + c3.set(["set key 5", "set val"], require_string("OK", name)); + c3.set(["set key 6", "set val"], require_string("OK", name)); + c3.get(["set key 5"], require_string("set val", name)); + c3.get(["set key 6"], require_string("set val", name)); + + c1.quit(quit_check); + c2.quit(quit_check); + c3.quit(quit_check); + } + + function ready_check() { + ready_count++; + if (ready_count === 3) { + run(); + } + } + + c1.on("ready", ready_check); + c2.on("ready", ready_check); + c3.on("ready", ready_check); +}; + +tests.reconnect = function () { + var name = "reconnect"; + + client.set("recon 1", "one"); + client.set("recon 2", "two", function (err, res) { + // Do not do this in normal programs. This is to simulate the server closing on us. + // For orderly shutdown in normal programs, do client.quit() + client.stream.destroy(); + }); + + client.on("reconnecting", function on_recon(params) { + client.on("connect", function on_connect() { + client.select(test_db_num, require_string("OK", name)); + client.get("recon 1", require_string("one", name)); + client.get("recon 1", require_string("one", name)); + client.get("recon 2", require_string("two", name)); + client.get("recon 2", require_string("two", name)); + client.removeListener("connect", on_connect); + client.removeListener("reconnecting", on_recon); + next(name); + }); + }); +}; + +tests.idle = function () { + var name = "idle"; + + client.on("idle", function on_idle() { + client.removeListener("idle", on_idle); + next(name); + }); + + client.set("idle", "test"); +}; + +tests.HSET = function () { + var key = "test hash", + field1 = new Buffer("0123456789"), + value1 = new Buffer("abcdefghij"), + field2 = new Buffer(0), + value2 = new Buffer(0), + name = "HSET"; + + client.HSET(key, field1, value1, require_number(1, name)); + client.HGET(key, field1, require_string(value1.toString(), name)); + + // Empty value + client.HSET(key, field1, value2, require_number(0, name)); + client.HGET([key, field1], require_string("", name)); + + // Empty key, empty value + client.HSET([key, field2, value1], require_number(1, name)); + client.HSET(key, field2, value2, last(name, require_number(0, name))); +}; + +tests.HLEN = function () { + var key = "test hash", + field1 = new Buffer("0123456789"), + value1 = new Buffer("abcdefghij"), + field2 = new Buffer(0), + value2 = new Buffer(0), + name = "HSET", + timeout = 1000; + + client.HSET(key, field1, value1, function (err, results) { + client.HLEN(key, function (err, len) { + assert.ok(2 === +len); + next(name); + }); + }); +} + +tests.HMSET_BUFFER_AND_ARRAY = function () { + // Saving a buffer and an array to the same key should not error + var key = "test hash", + field1 = "buffer", + value1 = new Buffer("abcdefghij"), + field2 = "array", + value2 = ["array contents"], + name = "HSET"; + + client.HMSET(key, field1, value1, field2, value2, last(name, require_string("OK", name))); +}; + +// TODO - add test for HMSET with optional callbacks + +tests.HMGET = function () { + var key1 = "test hash 1", key2 = "test hash 2", name = "HMGET"; + + // redis-like hmset syntax + client.HMSET(key1, "0123456789", "abcdefghij", "some manner of key", "a type of value", require_string("OK", name)); + + // fancy hmset syntax + client.HMSET(key2, { + "0123456789": "abcdefghij", + "some manner of key": "a type of value" + }, require_string("OK", name)); + + client.HMGET(key1, "0123456789", "some manner of key", function (err, reply) { + assert.strictEqual("abcdefghij", reply[0].toString(), name); + assert.strictEqual("a type of value", reply[1].toString(), name); + }); + + client.HMGET(key2, "0123456789", "some manner of key", function (err, reply) { + assert.strictEqual("abcdefghij", reply[0].toString(), name); + assert.strictEqual("a type of value", reply[1].toString(), name); + }); + + client.HMGET(key1, ["0123456789"], function (err, reply) { + assert.strictEqual("abcdefghij", reply[0], name); + }); + + client.HMGET(key1, ["0123456789", "some manner of key"], function (err, reply) { + assert.strictEqual("abcdefghij", reply[0], name); + assert.strictEqual("a type of value", reply[1], name); + }); + + client.HMGET(key1, "missing thing", "another missing thing", function (err, reply) { + assert.strictEqual(null, reply[0], name); + assert.strictEqual(null, reply[1], name); + next(name); + }); +}; + +tests.HINCRBY = function () { + var name = "HINCRBY"; + client.hset("hash incr", "value", 10, require_number(1, name)); + client.HINCRBY("hash incr", "value", 1, require_number(11, name)); + client.HINCRBY("hash incr", "value 2", 1, last(name, require_number(1, name))); +}; + +tests.SUBSCRIBE = function () { + var client1 = client, msg_count = 0, name = "SUBSCRIBE"; + + client1.on("subscribe", function (channel, count) { + if (channel === "chan1") { + client2.publish("chan1", "message 1", require_number(1, name)); + client2.publish("chan2", "message 2", require_number(1, name)); + client2.publish("chan1", "message 3", require_number(1, name)); + } + }); + + client1.on("unsubscribe", function (channel, count) { + if (count === 0) { + // make sure this connection can go into and out of pub/sub mode + client1.incr("did a thing", last(name, require_number(2, name))); + } + }); + + client1.on("message", function (channel, message) { + msg_count += 1; + assert.strictEqual("message " + msg_count, message.toString()); + if (msg_count === 3) { + client1.unsubscribe("chan1", "chan2"); + } + }); + + client1.set("did a thing", 1, require_string("OK", name)); + client1.subscribe("chan1", "chan2", function (err, results) { + assert.strictEqual(null, err, "result sent back unexpected error: " + err); + assert.strictEqual("chan1", results.toString(), name); + }); +}; + +tests.SUB_UNSUB_SUB = function () { + var name = "SUB_UNSUB_SUB"; + client3.subscribe('chan3'); + client3.unsubscribe('chan3'); + client3.subscribe('chan3', function (err, results) { + assert.strictEqual(null, err, "unexpected error: " + err); + client2.publish('chan3', 'foo'); + }); + client3.on('message', function (channel, message) { + assert.strictEqual(channel, 'chan3'); + assert.strictEqual(message, 'foo'); + next(name); + }); +}; + +tests.SUBSCRIBE_QUIT = function () { + var name = "SUBSCRIBE_QUIT"; + client3.on("end", function () { + next(name); + }); + client3.on("subscribe", function (channel, count) { + client3.quit(); + }); + client3.subscribe("chan3"); +}; + +tests.SUBSCRIBE_CLOSE_RESUBSCRIBE = function () { + var name = "SUBSCRIBE_CLOSE_RESUBSCRIBE"; + var c1 = redis.createClient(); + var c2 = redis.createClient(); + var count = 0; + + /* Create two clients. c1 subscribes to two channels, c2 will publish to them. + c2 publishes the first message. + c1 gets the message and drops its connection. It must resubscribe itself. + When it resubscribes, c2 publishes the second message, on the same channel + c1 gets the message and drops its connection. It must resubscribe itself, again. + When it resubscribes, c2 publishes the third message, on the second channel + c1 gets the message and drops its connection. When it reconnects, the test ends. + */ + + c1.on("message", function(channel, message) { + if (channel === "chan1") { + assert.strictEqual(message, "hi on channel 1"); + c1.stream.end(); + + } else if (channel === "chan2") { + assert.strictEqual(message, "hi on channel 2"); + c1.stream.end(); + + } else { + c1.quit(); + c2.quit(); + assert.fail("test failed"); + } + }) + + c1.subscribe("chan1", "chan2"); + + c2.once("ready", function() { + console.log("c2 is ready"); + c1.on("ready", function(err, results) { + console.log("c1 is ready", count); + + count++; + if (count == 1) { + c2.publish("chan1", "hi on channel 1"); + return; + + } else if (count == 2) { + c2.publish("chan2", "hi on channel 2"); + + } else { + c1.quit(function() { + c2.quit(function() { + next(name); + }); + }); + } + }); + + c2.publish("chan1", "hi on channel 1"); + + }); +}; + +tests.EXISTS = function () { + var name = "EXISTS"; + client.del("foo", "foo2", require_number_any(name)); + client.set("foo", "bar", require_string("OK", name)); + client.EXISTS("foo", require_number(1, name)); + client.EXISTS("foo2", last(name, require_number(0, name))); +}; + +tests.DEL = function () { + var name = "DEL"; + client.DEL("delkey", require_number_any(name)); + client.set("delkey", "delvalue", require_string("OK", name)); + client.DEL("delkey", require_number(1, name)); + client.exists("delkey", require_number(0, name)); + client.DEL("delkey", require_number(0, name)); + client.mset("delkey", "delvalue", "delkey2", "delvalue2", require_string("OK", name)); + client.DEL("delkey", "delkey2", last(name, require_number(2, name))); +}; + +tests.TYPE = function () { + var name = "TYPE"; + client.set(["string key", "should be a string"], require_string("OK", name)); + client.rpush(["list key", "should be a list"], require_number_pos(name)); + client.sadd(["set key", "should be a set"], require_number_any(name)); + client.zadd(["zset key", "10.0", "should be a zset"], require_number_any(name)); + client.hset(["hash key", "hashtest", "should be a hash"], require_number_any(0, name)); + + client.TYPE(["string key"], require_string("string", name)); + client.TYPE(["list key"], require_string("list", name)); + client.TYPE(["set key"], require_string("set", name)); + client.TYPE(["zset key"], require_string("zset", name)); + client.TYPE("not here yet", require_string("none", name)); + client.TYPE(["hash key"], last(name, require_string("hash", name))); +}; + +tests.KEYS = function () { + var name = "KEYS"; + client.mset(["test keys 1", "test val 1", "test keys 2", "test val 2"], require_string("OK", name)); + client.KEYS(["test keys*"], function (err, results) { + assert.strictEqual(null, err, "result sent back unexpected error: " + err); + assert.strictEqual(2, results.length, name); + assert.strictEqual("test keys 1", results[0].toString(), name); + assert.strictEqual("test keys 2", results[1].toString(), name); + next(name); + }); +}; + +tests.MULTIBULK_ZERO_LENGTH = function () { + var name = "MULTIBULK_ZERO_LENGTH"; + client.KEYS(['users:*'], function (err, results) { + assert.strictEqual(null, err, 'error on empty multibulk reply'); + assert.strictEqual(true, is_empty_array(results), "not an empty array"); + next(name); + }); +}; + +tests.RANDOMKEY = function () { + var name = "RANDOMKEY"; + client.mset(["test keys 1", "test val 1", "test keys 2", "test val 2"], require_string("OK", name)); + client.RANDOMKEY([], function (err, results) { + assert.strictEqual(null, err, name + " result sent back unexpected error: " + err); + assert.strictEqual(true, /\w+/.test(results), name); + next(name); + }); +}; + +tests.RENAME = function () { + var name = "RENAME"; + client.set(['foo', 'bar'], require_string("OK", name)); + client.RENAME(["foo", "new foo"], require_string("OK", name)); + client.exists(["foo"], require_number(0, name)); + client.exists(["new foo"], last(name, require_number(1, name))); +}; + +tests.RENAMENX = function () { + var name = "RENAMENX"; + client.set(['foo', 'bar'], require_string("OK", name)); + client.set(['foo2', 'bar2'], require_string("OK", name)); + client.RENAMENX(["foo", "foo2"], require_number(0, name)); + client.exists(["foo"], require_number(1, name)); + client.exists(["foo2"], require_number(1, name)); + client.del(["foo2"], require_number(1, name)); + client.RENAMENX(["foo", "foo2"], require_number(1, name)); + client.exists(["foo"], require_number(0, name)); + client.exists(["foo2"], last(name, require_number(1, name))); +}; + +tests.DBSIZE = function () { + var name = "DBSIZE"; + client.set(['foo', 'bar'], require_string("OK", name)); + client.DBSIZE([], last(name, require_number_pos("DBSIZE"))); +}; + +tests.GET = function () { + var name = "GET"; + client.set(["get key", "get val"], require_string("OK", name)); + client.GET(["get key"], last(name, require_string("get val", name))); +}; + +tests.SET = function () { + var name = "SET"; + client.SET(["set key", "set val"], require_string("OK", name)); + client.get(["set key"], last(name, require_string("set val", name))); +}; + +tests.GETSET = function () { + var name = "GETSET"; + client.set(["getset key", "getset val"], require_string("OK", name)); + client.GETSET(["getset key", "new getset val"], require_string("getset val", name)); + client.get(["getset key"], last(name, require_string("new getset val", name))); +}; + +tests.MGET = function () { + var name = "MGET"; + client.mset(["mget keys 1", "mget val 1", "mget keys 2", "mget val 2", "mget keys 3", "mget val 3"], require_string("OK", name)); + client.MGET("mget keys 1", "mget keys 2", "mget keys 3", function (err, results) { + assert.strictEqual(null, err, "result sent back unexpected error: " + err); + assert.strictEqual(3, results.length, name); + assert.strictEqual("mget val 1", results[0].toString(), name); + assert.strictEqual("mget val 2", results[1].toString(), name); + assert.strictEqual("mget val 3", results[2].toString(), name); + }); + client.MGET(["mget keys 1", "mget keys 2", "mget keys 3"], function (err, results) { + assert.strictEqual(null, err, "result sent back unexpected error: " + err); + assert.strictEqual(3, results.length, name); + assert.strictEqual("mget val 1", results[0].toString(), name); + assert.strictEqual("mget val 2", results[1].toString(), name); + assert.strictEqual("mget val 3", results[2].toString(), name); + }); + client.MGET(["mget keys 1", "some random shit", "mget keys 2", "mget keys 3"], function (err, results) { + assert.strictEqual(null, err, "result sent back unexpected error: " + err); + assert.strictEqual(4, results.length, name); + assert.strictEqual("mget val 1", results[0].toString(), name); + assert.strictEqual(null, results[1], name); + assert.strictEqual("mget val 2", results[2].toString(), name); + assert.strictEqual("mget val 3", results[3].toString(), name); + next(name); + }); +}; + +tests.SETNX = function () { + var name = "SETNX"; + client.set(["setnx key", "setnx value"], require_string("OK", name)); + client.SETNX(["setnx key", "new setnx value"], require_number(0, name)); + client.del(["setnx key"], require_number(1, name)); + client.exists(["setnx key"], require_number(0, name)); + client.SETNX(["setnx key", "new setnx value"], require_number(1, name)); + client.exists(["setnx key"], last(name, require_number(1, name))); +}; + +tests.SETEX = function () { + var name = "SETEX"; + client.SETEX(["setex key", "100", "setex val"], require_string("OK", name)); + client.exists(["setex key"], require_number(1, name)); + client.ttl(["setex key"], last(name, require_number_pos(name))); +}; + +tests.MSETNX = function () { + var name = "MSETNX"; + client.mset(["mset1", "val1", "mset2", "val2", "mset3", "val3"], require_string("OK", name)); + client.MSETNX(["mset3", "val3", "mset4", "val4"], require_number(0, name)); + client.del(["mset3"], require_number(1, name)); + client.MSETNX(["mset3", "val3", "mset4", "val4"], require_number(1, name)); + client.exists(["mset3"], require_number(1, name)); + client.exists(["mset4"], last(name, require_number(1, name))); +}; + +tests.HGETALL = function () { + var name = "HGETALL"; + client.hmset(["hosts", "mjr", "1", "another", "23", "home", "1234"], require_string("OK", name)); + client.HGETALL(["hosts"], function (err, obj) { + assert.strictEqual(null, err, name + " result sent back unexpected error: " + err); + assert.strictEqual(3, Object.keys(obj).length, name); + assert.strictEqual("1", obj.mjr.toString(), name); + assert.strictEqual("23", obj.another.toString(), name); + assert.strictEqual("1234", obj.home.toString(), name); + next(name); + }); +}; + +tests.HGETALL_NULL = function () { + var name = "HGETALL_NULL"; + + client.hgetall("missing", function (err, obj) { + assert.strictEqual(null, err); + assert.strictEqual(null, obj); + next(name); + }); +}; + +tests.UTF8 = function () { + var name = "UTF8", + utf8_sample = "ಠ_ಠ"; + + client.set(["utf8test", utf8_sample], require_string("OK", name)); + client.get(["utf8test"], function (err, obj) { + assert.strictEqual(null, err); + assert.strictEqual(utf8_sample, obj); + next(name); + }); +}; + +// Set tests were adapted from Brian Hammond's redis-node-client.js, which has a comprehensive test suite + +tests.SADD = function () { + var name = "SADD"; + + client.del('set0'); + client.SADD('set0', 'member0', require_number(1, name)); + client.sadd('set0', 'member0', last(name, require_number(0, name))); +}; + +tests.SADD2 = function () { + var name = "SADD2"; + + client.del("set0"); + client.sadd("set0", ["member0", "member1", "member2"], require_number(3, name)); + client.smembers("set0", function (err, res) { + assert.strictEqual(res.length, 3); + assert.strictEqual(res[0], "member0"); + assert.strictEqual(res[1], "member1"); + assert.strictEqual(res[2], "member2"); + }); + client.SADD("set1", ["member0", "member1", "member2"], require_number(3, name)); + client.smembers("set1", function (err, res) { + assert.strictEqual(res.length, 3); + assert.strictEqual(res[0], "member0"); + assert.strictEqual(res[1], "member1"); + assert.strictEqual(res[2], "member2"); + next(name); + }); +}; + +tests.SISMEMBER = function () { + var name = "SISMEMBER"; + + client.del('set0'); + client.sadd('set0', 'member0', require_number(1, name)); + client.sismember('set0', 'member0', require_number(1, name)); + client.sismember('set0', 'member1', last(name, require_number(0, name))); +}; + +tests.SCARD = function () { + var name = "SCARD"; + + client.del('set0'); + client.sadd('set0', 'member0', require_number(1, name)); + client.scard('set0', require_number(1, name)); + client.sadd('set0', 'member1', require_number(1, name)); + client.scard('set0', last(name, require_number(2, name))); +}; + +tests.SREM = function () { + var name = "SREM"; + + client.del('set0'); + client.sadd('set0', 'member0', require_number(1, name)); + client.srem('set0', 'foobar', require_number(0, name)); + client.srem('set0', 'member0', require_number(1, name)); + client.scard('set0', last(name, require_number(0, name))); +}; + +tests.SPOP = function () { + var name = "SPOP"; + + client.del('zzz'); + client.sadd('zzz', 'member0', require_number(1, name)); + client.scard('zzz', require_number(1, name)); + + client.spop('zzz', function (err, value) { + if (err) { + assert.fail(err); + } + assert.equal(value, 'member0', name); + }); + + client.scard('zzz', last(name, require_number(0, name))); +}; + +tests.SDIFF = function () { + var name = "SDIFF"; + + client.del('foo'); + client.sadd('foo', 'x', require_number(1, name)); + client.sadd('foo', 'a', require_number(1, name)); + client.sadd('foo', 'b', require_number(1, name)); + client.sadd('foo', 'c', require_number(1, name)); + + client.sadd('bar', 'c', require_number(1, name)); + + client.sadd('baz', 'a', require_number(1, name)); + client.sadd('baz', 'd', require_number(1, name)); + + client.sdiff('foo', 'bar', 'baz', function (err, values) { + if (err) { + assert.fail(err, name); + } + values.sort(); + assert.equal(values.length, 2, name); + assert.equal(values[0], 'b', name); + assert.equal(values[1], 'x', name); + next(name); + }); +}; + +tests.SDIFFSTORE = function () { + var name = "SDIFFSTORE"; + + client.del('foo'); + client.del('bar'); + client.del('baz'); + client.del('quux'); + + client.sadd('foo', 'x', require_number(1, name)); + client.sadd('foo', 'a', require_number(1, name)); + client.sadd('foo', 'b', require_number(1, name)); + client.sadd('foo', 'c', require_number(1, name)); + + client.sadd('bar', 'c', require_number(1, name)); + + client.sadd('baz', 'a', require_number(1, name)); + client.sadd('baz', 'd', require_number(1, name)); + + // NB: SDIFFSTORE returns the number of elements in the dstkey + + client.sdiffstore('quux', 'foo', 'bar', 'baz', require_number(2, name)); + + client.smembers('quux', function (err, values) { + if (err) { + assert.fail(err, name); + } + var members = buffers_to_strings(values).sort(); + + assert.deepEqual(members, [ 'b', 'x' ], name); + next(name); + }); +}; + +tests.SMEMBERS = function () { + var name = "SMEMBERS"; + + client.del('foo'); + client.sadd('foo', 'x', require_number(1, name)); + + client.smembers('foo', function (err, members) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(members), [ 'x' ], name); + }); + + client.sadd('foo', 'y', require_number(1, name)); + + client.smembers('foo', function (err, values) { + if (err) { + assert.fail(err, name); + } + assert.equal(values.length, 2, name); + var members = buffers_to_strings(values).sort(); + + assert.deepEqual(members, [ 'x', 'y' ], name); + next(name); + }); +}; + +tests.SMOVE = function () { + var name = "SMOVE"; + + client.del('foo'); + client.del('bar'); + + client.sadd('foo', 'x', require_number(1, name)); + client.smove('foo', 'bar', 'x', require_number(1, name)); + client.sismember('foo', 'x', require_number(0, name)); + client.sismember('bar', 'x', require_number(1, name)); + client.smove('foo', 'bar', 'x', last(name, require_number(0, name))); +}; + +tests.SINTER = function () { + var name = "SINTER"; + + client.del('sa'); + client.del('sb'); + client.del('sc'); + + client.sadd('sa', 'a', require_number(1, name)); + client.sadd('sa', 'b', require_number(1, name)); + client.sadd('sa', 'c', require_number(1, name)); + + client.sadd('sb', 'b', require_number(1, name)); + client.sadd('sb', 'c', require_number(1, name)); + client.sadd('sb', 'd', require_number(1, name)); + + client.sadd('sc', 'c', require_number(1, name)); + client.sadd('sc', 'd', require_number(1, name)); + client.sadd('sc', 'e', require_number(1, name)); + + client.sinter('sa', 'sb', function (err, intersection) { + if (err) { + assert.fail(err, name); + } + assert.equal(intersection.length, 2, name); + assert.deepEqual(buffers_to_strings(intersection).sort(), [ 'b', 'c' ], name); + }); + + client.sinter('sb', 'sc', function (err, intersection) { + if (err) { + assert.fail(err, name); + } + assert.equal(intersection.length, 2, name); + assert.deepEqual(buffers_to_strings(intersection).sort(), [ 'c', 'd' ], name); + }); + + client.sinter('sa', 'sc', function (err, intersection) { + if (err) { + assert.fail(err, name); + } + assert.equal(intersection.length, 1, name); + assert.equal(intersection[0], 'c', name); + }); + + // 3-way + + client.sinter('sa', 'sb', 'sc', function (err, intersection) { + if (err) { + assert.fail(err, name); + } + assert.equal(intersection.length, 1, name); + assert.equal(intersection[0], 'c', name); + next(name); + }); +}; + +tests.SINTERSTORE = function () { + var name = "SINTERSTORE"; + + client.del('sa'); + client.del('sb'); + client.del('sc'); + client.del('foo'); + + client.sadd('sa', 'a', require_number(1, name)); + client.sadd('sa', 'b', require_number(1, name)); + client.sadd('sa', 'c', require_number(1, name)); + + client.sadd('sb', 'b', require_number(1, name)); + client.sadd('sb', 'c', require_number(1, name)); + client.sadd('sb', 'd', require_number(1, name)); + + client.sadd('sc', 'c', require_number(1, name)); + client.sadd('sc', 'd', require_number(1, name)); + client.sadd('sc', 'e', require_number(1, name)); + + client.sinterstore('foo', 'sa', 'sb', 'sc', require_number(1, name)); + + client.smembers('foo', function (err, members) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(members), [ 'c' ], name); + next(name); + }); +}; + +tests.SUNION = function () { + var name = "SUNION"; + + client.del('sa'); + client.del('sb'); + client.del('sc'); + + client.sadd('sa', 'a', require_number(1, name)); + client.sadd('sa', 'b', require_number(1, name)); + client.sadd('sa', 'c', require_number(1, name)); + + client.sadd('sb', 'b', require_number(1, name)); + client.sadd('sb', 'c', require_number(1, name)); + client.sadd('sb', 'd', require_number(1, name)); + + client.sadd('sc', 'c', require_number(1, name)); + client.sadd('sc', 'd', require_number(1, name)); + client.sadd('sc', 'e', require_number(1, name)); + + client.sunion('sa', 'sb', 'sc', function (err, union) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(union).sort(), ['a', 'b', 'c', 'd', 'e'], name); + next(name); + }); +}; + +tests.SUNIONSTORE = function () { + var name = "SUNIONSTORE"; + + client.del('sa'); + client.del('sb'); + client.del('sc'); + client.del('foo'); + + client.sadd('sa', 'a', require_number(1, name)); + client.sadd('sa', 'b', require_number(1, name)); + client.sadd('sa', 'c', require_number(1, name)); + + client.sadd('sb', 'b', require_number(1, name)); + client.sadd('sb', 'c', require_number(1, name)); + client.sadd('sb', 'd', require_number(1, name)); + + client.sadd('sc', 'c', require_number(1, name)); + client.sadd('sc', 'd', require_number(1, name)); + client.sadd('sc', 'e', require_number(1, name)); + + client.sunionstore('foo', 'sa', 'sb', 'sc', function (err, cardinality) { + if (err) { + assert.fail(err, name); + } + assert.equal(cardinality, 5, name); + }); + + client.smembers('foo', function (err, members) { + if (err) { + assert.fail(err, name); + } + assert.equal(members.length, 5, name); + assert.deepEqual(buffers_to_strings(members).sort(), ['a', 'b', 'c', 'd', 'e'], name); + next(name); + }); +}; + +// SORT test adapted from Brian Hammond's redis-node-client.js, which has a comprehensive test suite + +tests.SORT = function () { + var name = "SORT"; + + client.del('y'); + client.del('x'); + + client.rpush('y', 'd', require_number(1, name)); + client.rpush('y', 'b', require_number(2, name)); + client.rpush('y', 'a', require_number(3, name)); + client.rpush('y', 'c', require_number(4, name)); + + client.rpush('x', '3', require_number(1, name)); + client.rpush('x', '9', require_number(2, name)); + client.rpush('x', '2', require_number(3, name)); + client.rpush('x', '4', require_number(4, name)); + + client.set('w3', '4', require_string("OK", name)); + client.set('w9', '5', require_string("OK", name)); + client.set('w2', '12', require_string("OK", name)); + client.set('w4', '6', require_string("OK", name)); + + client.set('o2', 'buz', require_string("OK", name)); + client.set('o3', 'foo', require_string("OK", name)); + client.set('o4', 'baz', require_string("OK", name)); + client.set('o9', 'bar', require_string("OK", name)); + + client.set('p2', 'qux', require_string("OK", name)); + client.set('p3', 'bux', require_string("OK", name)); + client.set('p4', 'lux', require_string("OK", name)); + client.set('p9', 'tux', require_string("OK", name)); + + // Now the data has been setup, we can test. + + // But first, test basic sorting. + + // y = [ d b a c ] + // sort y ascending = [ a b c d ] + // sort y descending = [ d c b a ] + + client.sort('y', 'asc', 'alpha', function (err, sorted) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(sorted), ['a', 'b', 'c', 'd'], name); + }); + + client.sort('y', 'desc', 'alpha', function (err, sorted) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(sorted), ['d', 'c', 'b', 'a'], name); + }); + + // Now try sorting numbers in a list. + // x = [ 3, 9, 2, 4 ] + + client.sort('x', 'asc', function (err, sorted) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(sorted), [2, 3, 4, 9], name); + }); + + client.sort('x', 'desc', function (err, sorted) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(sorted), [9, 4, 3, 2], name); + }); + + // Try sorting with a 'by' pattern. + + client.sort('x', 'by', 'w*', 'asc', function (err, sorted) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(sorted), [3, 9, 4, 2], name); + }); + + // Try sorting with a 'by' pattern and 1 'get' pattern. + + client.sort('x', 'by', 'w*', 'asc', 'get', 'o*', function (err, sorted) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(sorted), ['foo', 'bar', 'baz', 'buz'], name); + }); + + // Try sorting with a 'by' pattern and 2 'get' patterns. + + client.sort('x', 'by', 'w*', 'asc', 'get', 'o*', 'get', 'p*', function (err, sorted) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(sorted), ['foo', 'bux', 'bar', 'tux', 'baz', 'lux', 'buz', 'qux'], name); + }); + + // Try sorting with a 'by' pattern and 2 'get' patterns. + // Instead of getting back the sorted set/list, store the values to a list. + // Then check that the values are there in the expected order. + + client.sort('x', 'by', 'w*', 'asc', 'get', 'o*', 'get', 'p*', 'store', 'bacon', function (err) { + if (err) { + assert.fail(err, name); + } + }); + + client.lrange('bacon', 0, -1, function (err, values) { + if (err) { + assert.fail(err, name); + } + assert.deepEqual(buffers_to_strings(values), ['foo', 'bux', 'bar', 'tux', 'baz', 'lux', 'buz', 'qux'], name); + next(name); + }); + + // TODO - sort by hash value +}; + +tests.MONITOR = function () { + var name = "MONITOR", responses = [], monitor_client; + + monitor_client = redis.createClient(); + monitor_client.monitor(function (err, res) { + client.mget("some", "keys", "foo", "bar"); + client.set("json", JSON.stringify({ + foo: "123", + bar: "sdflkdfsjk", + another: false + })); + }); + monitor_client.on("monitor", function (time, args) { + // skip monitor command for Redis <= 2.4.16 + if (args[0] === "monitor") return; + + responses.push(args); + if (responses.length === 2) { + assert.strictEqual(5, responses[0].length); + assert.strictEqual("mget", responses[0][0]); + assert.strictEqual("some", responses[0][1]); + assert.strictEqual("keys", responses[0][2]); + assert.strictEqual("foo", responses[0][3]); + assert.strictEqual("bar", responses[0][4]); + assert.strictEqual(3, responses[1].length); + assert.strictEqual("set", responses[1][0]); + assert.strictEqual("json", responses[1][1]); + assert.strictEqual('{"foo":"123","bar":"sdflkdfsjk","another":false}', responses[1][2]); + monitor_client.quit(function (err, res) { + next(name); + }); + } + }); +}; + +tests.BLPOP = function () { + var name = "BLPOP"; + + client.rpush("blocking list", "initial value", function (err, res) { + client2.BLPOP("blocking list", 0, function (err, res) { + assert.strictEqual("blocking list", res[0].toString()); + assert.strictEqual("initial value", res[1].toString()); + + client.rpush("blocking list", "wait for this value"); + }); + client2.BLPOP("blocking list", 0, function (err, res) { + assert.strictEqual("blocking list", res[0].toString()); + assert.strictEqual("wait for this value", res[1].toString()); + next(name); + }); + }); +}; + +tests.BLPOP_TIMEOUT = function () { + var name = "BLPOP_TIMEOUT"; + + // try to BLPOP the list again, which should be empty. This should timeout and return null. + client2.BLPOP("blocking list", 1, function (err, res) { + if (err) { + throw err; + } + + assert.strictEqual(res, null); + next(name); + }); +}; + +tests.EXPIRE = function () { + var name = "EXPIRE"; + client.set(['expiry key', 'bar'], require_string("OK", name)); + client.EXPIRE(["expiry key", "1"], require_number_pos(name)); + setTimeout(function () { + client.exists(["expiry key"], last(name, require_number(0, name))); + }, 2000); +}; + +tests.TTL = function () { + var name = "TTL"; + client.set(["ttl key", "ttl val"], require_string("OK", name)); + client.expire(["ttl key", "100"], require_number_pos(name)); + setTimeout(function () { + client.TTL(["ttl key"], last(name, require_number_pos(0, name))); + }, 500); +}; + +tests.OPTIONAL_CALLBACK = function () { + var name = "OPTIONAL_CALLBACK"; + client.del("op_cb1"); + client.set("op_cb1", "x"); + client.get("op_cb1", last(name, require_string("x", name))); +}; + +tests.OPTIONAL_CALLBACK_UNDEFINED = function () { + var name = "OPTIONAL_CALLBACK_UNDEFINED"; + client.del("op_cb2"); + client.set("op_cb2", "y", undefined); + client.get("op_cb2", last(name, require_string("y", name))); +}; + +tests.HMSET_THROWS_ON_NON_STRINGS = function () { + var name = "HMSET_THROWS_ON_NON_STRINGS"; + var hash = name; + var data = { "a": [ "this is not a string" ] }; + + client.hmset(hash, data, cb); + function cb(e, r) { + assert(e); // should be an error! + } + + // alternative way it throws + function thrower() { + client.hmset(hash, data); + } + assert.throws(thrower); + next(name); +}; + +tests.ENABLE_OFFLINE_QUEUE_TRUE = function () { + var name = "ENABLE_OFFLINE_QUEUE_TRUE"; + var cli = redis.createClient(9999, null, { + max_attempts: 1 + // default :) + // enable_offline_queue: true + }); + cli.on('error', function(e) { + // ignore, b/c expecting a "can't connect" error + }); + return setTimeout(function() { + cli.set(name, name, function(err, result) { + assert.ifError(err); + }); + + return setTimeout(function(){ + assert.strictEqual(cli.offline_queue.length, 1); + return next(name); + }, 25); + }, 50); +}; + +tests.ENABLE_OFFLINE_QUEUE_FALSE = function () { + var name = "ENABLE_OFFLINE_QUEUE_FALSE"; + var cli = redis.createClient(9999, null, { + max_attempts: 1, + enable_offline_queue: false + }); + cli.on('error', function() { + // ignore, see above + }); + assert.throws(function () { + cli.set(name, name) + }) + assert.doesNotThrow(function () { + cli.set(name, name, function (err) { + // should callback with an error + assert.ok(err); + setTimeout(function () { + next(name); + }, 50); + }); + }); +}; + +// TODO - need a better way to test auth, maybe auto-config a local Redis server or something. +// Yes, this is the real password. Please be nice, thanks. +tests.auth = function () { + var name = "AUTH", client4, ready_count = 0; + + client4 = redis.createClient(9006, "filefish.redistogo.com"); + client4.auth("664b1b6aaf134e1ec281945a8de702a9", function (err, res) { + assert.strictEqual(null, err, name); + assert.strictEqual("OK", res.toString(), name); + }); + + // test auth, then kill the connection so it'll auto-reconnect and auto-re-auth + client4.on("ready", function () { + ready_count++; + if (ready_count === 1) { + client4.stream.destroy(); + } else { + client4.quit(function (err, res) { + next(name); + }); + } + }); +}; + +all_tests = Object.keys(tests); +all_start = new Date(); +test_count = 0; + +run_next_test = function run_next_test() { + var test_name = all_tests.shift(); + if (typeof tests[test_name] === "function") { + util.print('- \x1b[1m' + test_name.toLowerCase() + '\x1b[0m:'); + cur_start = new Date(); + test_count += 1; + tests[test_name](); + } else { + console.log('\n completed \x1b[32m%d\x1b[0m tests in \x1b[33m%d\x1b[0m ms\n', test_count, new Date() - all_start); + client.quit(); + client2.quit(); + } +}; + +client.once("ready", function start_tests() { + console.log("Connected to " + client.host + ":" + client.port + ", Redis server version " + client.server_info.redis_version + "\n"); + console.log("Using reply parser " + client.reply_parser.name); + + run_next_test(); + + connected = true; +}); + +client.on('end', function () { + ended = true; +}); + +// Exit immediately on connection failure, which triggers "exit", below, which fails the test +client.on("error", function (err) { + console.error("client: " + err.stack); + process.exit(); +}); +client2.on("error", function (err) { + console.error("client2: " + err.stack); + process.exit(); +}); +client3.on("error", function (err) { + console.error("client3: " + err.stack); + process.exit(); +}); +client.on("reconnecting", function (params) { + console.log("reconnecting: " + util.inspect(params)); +}); + +process.on('uncaughtException', function (err) { + console.error("Uncaught exception: " + err.stack); + process.exit(1); +}); + +process.on('exit', function (code) { + assert.equal(true, connected); + assert.equal(true, ended); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/.npmignore new file mode 100644 index 00000000..c27cb503 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/.npmignore @@ -0,0 +1,2 @@ +test/node_modules +support diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/History.md new file mode 100644 index 00000000..0867b2f3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/History.md @@ -0,0 +1,237 @@ + +0.9.16 / 2013-06-06 +=================== + + * transports: fix escaping for tests + +0.9.15 / 2013-06-06 +=================== + + * transports: added unescaping for escaped htmlfile + * skipped 12-14 to match socket.io server version + +0.9.11 / 2012-11-02 +=================== + + * Enable use of 'xhr' transport in Node.js + * Fix the problem with disconnecting xhr-polling users + * Add should to devDependencies + * Prefer XmlHttpRequest if CORS is available + * Make client compatible with AMD loaders. + +0.9.10 / 2012-08-10 +=================== + + * fix removeAllListeners to behave as expected. + * set withCredentials to true only if xdomain. + * socket: disable disconnect on unload by default. + +0.9.9 / 2012-08-01 +================== + + * socket: fixed disconnect xhr url and made it actually sync + * *: bump xmlhttprequest dep + +0.9.8 / 2012-07-24 +================== + + * Fixed build. + +0.9.7 / 2012-07-24 +================== + + * iOS websocket crash fix. + * Fixed potential `open` collision. + * Fixed disconnectSync. + +0.9.6 / 2012-04-17 +================== + + * Don't position the jsonp form off the screen (android fix). + +0.9.5 / 2012-04-05 +================== + + * Bumped version. + +0.9.4 / 2012-04-01 +================== + + * Fixes polling loop upon reconnect advice (fixes #438). + +0.9.3 / 2012-03-28 +================== + + * Fix XHR.check, which was throwing an error transparently and causing non-IE browsers to fall back to JSONP [mikito] + * Fixed forced disconnect on window close [zzzaaa] + +0.9.2 / 2012-03-13 +================== + + * Transport order set by "options" [zzzaaa] + +0.9.1-1 / 2012-03-02 +==================== + + * Fixed active-x-obfuscator NPM dependency. + +0.9.1 / 2012-03-02 +================== + + * Misc corrections. + * Added warning within Firefox about webworker test in test runner. + * Update ws dependency [einaros] + * Implemented client side heartbeat checks. [felixge] + * Improved Firewall support with ActiveX obfuscation. [felixge] + * Fixed error handling during connection process. [Outsideris] + +0.9.0 / 2012-02-26 +================== + + * Added DS_Store to gitignore. + * Updated depedencies. + * Bumped uglify + * Tweaking code so it doesn't throw an exception when used inside a WebWorker in Firefox + * Do not rely on Array.prototype.indexOf as it breaks with pages that use the Prototype.js library. + * Windows support landed + * Use @einaros ws module instead of the old crap one + * Fix for broken closeTimeout and 'IE + xhr' goes into infinite loop on disconnection + * Disabled reconnection on error if reconnect option is set to false + * Set withCredentials to true before xhr to fix authentication + * Clears the timeout from reconnection attempt when there is a successful or failed reconnection. + This fixes the issue of setTimeout's carrying over from previous reconnection + and changing (skipping) values of self.reconnectionDelay in the newer reconnection. + * Removed decoding of parameters when chunking the query string. + This was used later on to construct the url to post to the socket.io server + for connection and if we're adding custom parameters of our own to this url + (for example for OAuth authentication) they were being sent decoded, which is wrong. + +0.8.7 / 2011-11-05 +================== + + * Bumped client + +0.8.6 / 2011-10-27 +================== + + * Added WebWorker support. + * Fixed swfobject and web_socket.js to not assume window. + * Fixed CORS detection for webworker. + * Fix `defer` for webkit in a webworker. + * Fixed io.util.request to not rely on window. + * FIxed; use global instead of window and dont rely on document. + * Fixed; JSON-P handshake if CORS is not available. + * Made underlying Transport disconnection trigger immediate socket.io disconnect. + * Fixed warning when compressing with Google Closure Compiler. + * Fixed builder's uglify utf-8 support. + * Added workaround for loading indicator in FF jsonp-polling. [3rd-Eden] + * Fixed host discovery lookup. [holic] + * Fixed close timeout when disconnected/reconnecting. [jscharlach] + * Fixed jsonp-polling feature detection. + * Fixed jsonp-polling client POSTing of \n. + * Fixed test runner on IE6/7 + +0.8.5 / 2011-10-07 +================== + + * Bumped client + +0.8.4 / 2011-09-06 +================== + + * Corrected build + +0.8.3 / 2011-09-03 +================== + + * Fixed `\n` parsing for non-JSON packets. + * Fixed; make Socket.IO XHTML doctype compatible (fixes #460 from server) + * Fixed support for Node.JS running `socket.io-client`. + * Updated repository name in `package.json`. + * Added support for different policy file ports without having to port + forward 843 on the server side [3rd-Eden] + +0.8.2 / 2011-08-29 +================== + + * Fixed flashsocket detection. + +0.8.1 / 2011-08-29 +================== + + * Bump version. + +0.8.0 / 2011-08-28 +================== + + * Added MozWebSocket support (hybi-10 doesn't require API changes) [einaros]. + +0.7.11 / 2011-08-27 +=================== + + * Corrected previous release (missing build). + +0.7.10 / 2011-08-27 +=================== + + * Fix for failing fallback in websockets + +0.7.9 / 2011-08-12 +================== + + * Added check on `Socket#onConnect` to prevent double `connect` events on the main manager. + * Fixed socket namespace connect test. Remove broken alternative namespace connect test. + * Removed test handler for removed test. + * Bumped version to match `socket.io` server. + +0.7.5 / 2011-08-08 +================== + + * Added querystring support for `connect` [3rd-Eden] + * Added partial Node.JS transports support [3rd-Eden, josephg] + * Fixed builder test. + * Changed `util.inherit` to replicate Object.create / __proto__. + * Changed and cleaned up some acceptance tests. + * Fixed race condition with a test that could not be run multiple times. + * Added test for encoding a payload. + * Added the ability to override the transport to use in acceptance test [3rd-Eden] + * Fixed multiple connect packets [DanielBaulig] + * Fixed jsonp-polling over-buffering [3rd-Eden] + * Fixed ascii preservation in minified socket.io client [3rd-Eden] + * Fixed socket.io in situations where the page is not served through utf8. + * Fixed namespaces not reconnecting after disconnect [3rd-Eden] + * Fixed default port for secure connections. + +0.7.4 / 2011-07-12 +================== + + * Added `SocketNamespace#of` shortcut. [3rd-Eden] + * Fixed a IE payload decoding bug. [3rd-Eden] + * Honor document protocol, unless overriden. [dvv] + * Fixed new builder dependencies. [3rd-Eden] + +0.7.3 / 2011-06-30 +================== + + * Fixed; acks don't depend on arity. They're automatic for `.send` and + callback based for `.emit`. [dvv] + * Added support for sub-sockets authorization. [3rd-Eden] + * Added BC support for `new io.connect`. [fat] + * Fixed double `connect` events. [3rd-Eden] + * Fixed reconnection with jsonp-polling maintaining old sessionid. [franck34] + +0.7.2 / 2011-06-22 +================== + + * Added `noop` message type. + +0.7.1 / 2011-06-21 +================== + + * Bumped socket.io dependency version for acceptance tests. + +0.7.0 / 2011-06-21 +================== + + * http://socket.io/announcement.html + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/Makefile new file mode 100644 index 00000000..f2d2f41a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/Makefile @@ -0,0 +1,20 @@ + +ALL_TESTS = $(shell find test/ -name '*.test.js') + +run-tests: + @./node_modules/.bin/expresso \ + -I lib \ + -I support \ + --serial \ + $(TESTS) + +test: + @$(MAKE) TESTS="$(ALL_TESTS)" run-tests + +test-acceptance: + @node support/test-runner/app $(TRANSPORT) + +build: + @node ./bin/builder.js + +.PHONY: test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/README.md new file mode 100644 index 00000000..cdb7715a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/README.md @@ -0,0 +1,246 @@ +socket.io +========= + +#### Sockets for the rest of us + +The `socket.io` client is basically a simple HTTP Socket interface implementation. +It looks similar to WebSocket while providing additional features and +leveraging other transports when WebSocket is not supported by the user's +browser. + +```js +var socket = io.connect('http://domain.com'); +socket.on('connect', function () { + // socket connected +}); +socket.on('custom event', function () { + // server emitted a custom event +}); +socket.on('disconnect', function () { + // socket disconnected +}); +socket.send('hi there'); +``` + +### Recipes + +#### Utilizing namespaces (ie: multiple sockets) + +If you want to namespace all the messages and events emitted to a particular +endpoint, simply specify it as part of the `connect` uri: + +```js +var chat = io.connect('http://localhost/chat'); +chat.on('connect', function () { + // chat socket connected +}); + +var news = io.connect('/news'); // io.connect auto-detects host +news.on('connect', function () { + // news socket connected +}); +``` + +#### Emitting custom events + +To ease with the creation of applications, you can emit custom events outside +of the global `message` event. + +```js +var socket = io.connect(); +socket.emit('server custom event', { my: 'data' }); +``` + +#### Forcing disconnection + +```js +var socket = io.connect(); +socket.on('connect', function () { + socket.disconnect(); +}); +``` + +### Documentation + +#### io#connect + +```js +io.connect(uri, [options]); +``` + +##### Options: + +- *resource* + + socket.io + + The resource is what allows the `socket.io` server to identify incoming connections by `socket.io` clients. In other words, any HTTP server can implement socket.io and still serve other normal, non-realtime HTTP requests. + +- *transports* + +```js +['websocket', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling'] +``` + + A list of the transports to attempt to utilize (in order of preference). + +- *'connect timeout'* + +```js +5000 +``` + + The amount of milliseconds a transport has to create a connection before we consider it timed out. + +- *'try multiple transports'* + +```js +true +``` + + A boolean indicating if we should try other transports when the connectTimeout occurs. + +- *reconnect* + +```js +true +``` + + A boolean indicating if we should automatically reconnect if a connection is disconnected. + +- *'reconnection delay'* + +```js +500 +``` + + The amount of milliseconds before we try to connect to the server again. We are using a exponential back off algorithm for the following reconnections, on each reconnect attempt this value will get multiplied (500 > 1000 > 2000 > 4000 > 8000). + + +- *'max reconnection attempts'* + +```js +10 +``` + + The amount of attempts should we make using the current transport to connect to the server? After this we will do one final attempt, and re-try with all enabled transport methods before we give up. + +##### Properties: + +- *options* + + The passed in options combined with the defaults. + +- *connected* + + Whether the socket is connected or not. + +- *connecting* + + Whether the socket is connecting or not. + +- *reconnecting* + + Whether we are reconnecting or not. + +- *transport* + + The transport instance. + +##### Methods: + +- *connect(λ)* + + Establishes a connection. If λ is supplied as argument, it will be called once the connection is established. + +- *send(message)* + + A string of data to send. + +- *disconnect* + + Closes the connection. + +- *on(event, λ)* + + Adds a listener for the event *event*. + +- *once(event, λ)* + + Adds a one time listener for the event *event*. The listener is removed after the first time the event is fired. + +- *removeListener(event, λ)* + + Removes the listener λ for the event *event*. + +##### Events: + +- *connect* + + Fired when the connection is established and the handshake successful. + +- *connecting(transport_type)* + + Fired when a connection is attempted, passing the transport name. + +- *connect_failed* + + Fired when the connection timeout occurs after the last connection attempt. + This only fires if the `connectTimeout` option is set. + If the `tryTransportsOnConnectTimeout` option is set, this only fires once all + possible transports have been tried. + +- *message(message)* + + Fired when a message arrives from the server + +- *close* + + Fired when the connection is closed. Be careful with using this event, as some transports will fire it even under temporary, expected disconnections (such as XHR-Polling). + +- *disconnect* + + Fired when the connection is considered disconnected. + +- *reconnect(transport_type,reconnectionAttempts)* + + Fired when the connection has been re-established. This only fires if the `reconnect` option is set. + +- *reconnecting(reconnectionDelay,reconnectionAttempts)* + + Fired when a reconnection is attempted, passing the next delay for the next reconnection. + +- *reconnect_failed* + + Fired when all reconnection attempts have failed and we where unsuccessful in reconnecting to the server. + +### Contributors + +Guillermo Rauch <guillermo@learnboost.com> + +Arnout Kazemier <info@3rd-eden.com> + +### License + +(The MIT License) + +Copyright (c) 2010 LearnBoost <dev@learnboost.com> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/bin/builder.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/bin/builder.js new file mode 100755 index 00000000..7383c75a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/bin/builder.js @@ -0,0 +1,303 @@ +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var fs = require('fs') + , socket = require('../lib/io') + , uglify = require('uglify-js') + , activeXObfuscator = require('active-x-obfuscator'); + +/** + * License headers. + * + * @api private + */ + +var template = '/*! Socket.IO.%ext% build:' + socket.version + ', %type%. Copyright(c) 2011 LearnBoost MIT Licensed */\n' + , development = template.replace('%type%', 'development').replace('%ext%', 'js') + , production = template.replace('%type%', 'production').replace('%ext%', 'min.js'); + +/** + * If statements, these allows you to create serveride & client side compatible + * code using specially designed `if` statements that remove serverside + * designed code from the source files + * + * @api private + */ + +var starttagIF = '// if node' + , endtagIF = '// end node'; + +/** + * The modules that are required to create a base build of Socket.IO. + * + * @const + * @type {Array} + * @api private + */ + +var base = [ + 'io.js' + , 'util.js' + , 'events.js' + , 'json.js' + , 'parser.js' + , 'transport.js' + , 'socket.js' + , 'namespace.js' + ]; + +/** + * The available transports for Socket.IO. These are mapped as: + * + * - `key` the name of the transport + * - `value` the dependencies for the transport + * + * @const + * @type {Object} + * @api public + */ + +var baseTransports = { + 'websocket': ['transports/websocket.js'] + , 'flashsocket': [ + 'transports/websocket.js' + , 'transports/flashsocket.js' + , 'vendor/web-socket-js/swfobject.js' + , 'vendor/web-socket-js/web_socket.js' + ] + , 'htmlfile': ['transports/xhr.js', 'transports/htmlfile.js'] + /* FIXME: re-enable me once we have multi-part support + , 'xhr-multipart': ['transports/xhr.js', 'transports/xhr-multipart.js'] */ + , 'xhr-polling': ['transports/xhr.js', 'transports/xhr-polling.js'] + , 'jsonp-polling': [ + 'transports/xhr.js' + , 'transports/xhr-polling.js' + , 'transports/jsonp-polling.js' + ] +}; + +/** + * Wrappers for client-side usage. + * This enables usage in top-level browser window, client-side CommonJS systems and AMD loaders. + * If doing a node build for server-side client, this wrapper is NOT included. + * @api private + */ +var wrapperPre = "\nvar io = ('undefined' === typeof module ? {} : module.exports);\n(function() {\n"; + +var wrapperPost = "\nif (typeof define === \"function\" && define.amd) {" + + "\n define([], function () { return io; });" + + "\n}\n})();"; + + +/** + * Builds a custom Socket.IO distribution based on the transports that you + * need. You can configure the build to create development build or production + * build (minified). + * + * @param {Array} transports The transports that needs to be bundled. + * @param {Object} [options] Options to configure the building process. + * @param {Function} callback Last argument should always be the callback + * @callback {String|Boolean} err An optional argument, if it exists than an error + * occurred during the build process. + * @callback {String} result The result of the build process. + * @api public + */ + +var builder = module.exports = function () { + var transports, options, callback, error = null + , args = Array.prototype.slice.call(arguments, 0) + , settings = { + minify: true + , node: false + , custom: [] + }; + + // Fancy pancy argument support this makes any pattern possible mainly + // because we require only one of each type + args.forEach(function (arg) { + var type = Object.prototype.toString.call(arg) + .replace(/\[object\s(\w+)\]/gi , '$1' ).toLowerCase(); + + switch (type) { + case 'array': + return transports = arg; + case 'object': + return options = arg; + case 'function': + return callback = arg; + } + }); + + // Add defaults + options = options || {}; + transports = transports || Object.keys(baseTransports); + + // Merge the data + for(var option in options) { + settings[option] = options[option]; + } + + // Start creating a dependencies chain with all the required files for the + // custom Socket.IO bundle. + var files = []; + base.forEach(function (file) { + files.push(__dirname + '/../lib/' + file); + }); + + transports.forEach(function (transport) { + var dependencies = baseTransports[transport]; + if (!dependencies) { + error = 'Unsupported transport `' + transport + '` supplied as argument.'; + return; + } + + // Add the files to the files list, but only if they are not added before + dependencies.forEach(function (file) { + var path = __dirname + '/../lib/' + file; + if (!~files.indexOf(path)) files.push(path); + }) + }); + + // check to see if the files tree compilation generated any errors. + if (error) return callback(error); + + var results = {}; + files.forEach(function (file) { + fs.readFile(file, function (err, content) { + if (err) error = err; + results[file] = content; + + // check if we are done yet, or not.. Just by checking the size of the result + // object. + if (Object.keys(results).length !== files.length) return; + + // we are done, did we error? + if (error) return callback(error); + + // start with the license header + var code = development + , ignore = 0; + + // pre-wrapper for non-server-side builds + if (!settings.node) code += wrapperPre; + + // concatenate the file contents in order + files.forEach(function (file) { + code += results[file]; + }); + + // check if we need to add custom code + if (settings.custom.length) { + settings.custom.forEach(function (content) { + code += content; + }); + } + + // post-wrapper for non-server-side builds + if (!settings.node) { + code += wrapperPost; + } + + code = activeXObfuscator(code); + + // Search for conditional code blocks that need to be removed as they + // where designed for a server side env. but only if we don't want to + // make this build node compatible. + if (!settings.node) { + code = code.split('\n').filter(function (line) { + // check if there are tags in here + var start = line.indexOf(starttagIF) >= 0 + , end = line.indexOf(endtagIF) >= 0 + , ret = ignore; + + // ignore the current line + if (start) { + ignore++; + ret = ignore; + } + + // stop ignoring the next line + if (end) { + ignore--; + } + + return ret == 0; + }).join('\n'); + } + + // check if we need to process it any further + if (settings.minify) { + var ast = uglify.parser.parse(code); + ast = uglify.uglify.ast_mangle(ast); + ast = uglify.uglify.ast_squeeze(ast); + + code = production + uglify.uglify.gen_code(ast, { ascii_only: true }); + } + + callback(error, code); + }) + }) +}; + +/** + * Builder version is also the current client version + * this way we don't have to do another include for the + * clients version number and we can just include the builder. + * + * @type {String} + * @api public + */ + +builder.version = socket.version; + +/** + * A list of all build in transport types. + * + * @type {Object} + * @api public + */ + +builder.transports = baseTransports; + +/** + * Command line support, this allows us to generate builds without having + * to load it as module. + */ + +if (!module.parent){ + // the first 2 are `node` and the path to this file, we don't need them + var args = process.argv.slice(2); + + // build a development build + builder(args.length ? args : false, { minify:false }, function (err, content) { + if (err) return console.error(err); + + fs.write( + fs.openSync(__dirname + '/../dist/socket.io.js', 'w') + , content + , 0 + , 'utf8' + ); + console.log('Successfully generated the development build: socket.io.js'); + }); + + // and build a production build + builder(args.length ? args : false, function (err, content) { + if (err) return console.error(err); + + fs.write( + fs.openSync(__dirname + '/../dist/socket.io.min.js', 'w') + , content + , 0 + , 'utf8' + ); + console.log('Successfully generated the production build: socket.io.min.js'); + }); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/component.json new file mode 100644 index 00000000..ebdf6422 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/component.json @@ -0,0 +1,14 @@ +{ + "name": "bind", + "version": "0.0.1", + "description": "function binding utility", + "keywords": [ + "bind", + "utility" + ], + "dependencies": {}, + "scripts": [ + "index.js" + ], + "repo": "https://raw.github.com/component/bind" +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js new file mode 100644 index 00000000..9808fc06 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-bind/index.js @@ -0,0 +1,24 @@ + +/** + * Slice reference. + */ + +var slice = [].slice; + +/** + * Bind `obj` to `fn`. + * + * @param {Object} obj + * @param {Function|String} fn or string + * @return {Function} + * @api public + */ + +module.exports = function(obj, fn){ + if ('string' == typeof fn) fn = obj[fn]; + if ('function' != typeof fn) throw new Error('bind() requires a function'); + var args = [].slice.call(arguments, 2); + return function(){ + return fn.apply(obj, args.concat(slice.call(arguments))); + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/component.json new file mode 100644 index 00000000..0eec23b1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/component.json @@ -0,0 +1,13 @@ +{ + "name": "emitter", + "description": "Event emitter", + "keywords": [ + "emitter", + "events" + ], + "version": "0.0.6", + "scripts": [ + "index.js" + ], + "repo": "https://raw.github.com/component/emitter" +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/index.js new file mode 100644 index 00000000..8cc74ae8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-emitter/index.js @@ -0,0 +1,147 @@ + +/** + * Expose `Emitter`. + */ + +module.exports = Emitter; + +/** + * Initialize a new `Emitter`. + * + * @api public + */ + +function Emitter(obj) { + if (obj) return mixin(obj); +}; + +/** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} + +/** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.on = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks[event] = this._callbacks[event] || []) + .push(fn); + return this; +}; + +/** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.once = function(event, fn){ + var self = this; + this._callbacks = this._callbacks || {}; + + function on() { + self.off(event, on); + fn.apply(this, arguments); + } + + fn._off = on; + this.on(event, on); + return this; +}; + +/** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.off = function(event, fn){ + this._callbacks = this._callbacks || {}; + var callbacks = this._callbacks[event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks[event]; + return this; + } + + // remove specific handler + var i = callbacks.indexOf(fn._off || fn); + if (~i) callbacks.splice(i, 1); + return this; +}; + +/** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + +Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + var args = [].slice.call(arguments, 1) + , callbacks = this._callbacks[event]; + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +/** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + +Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks[event] || []; +}; + +/** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + +Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; +}; + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/component.json new file mode 100644 index 00000000..6b35f453 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/component.json @@ -0,0 +1,15 @@ +{ + "name": "json-fallback", + "repo": "component/json", + "description": "JSON parser / stringifier fallback", + "version": "0.0.1", + "keywords": [ + "json", + "fallback" + ], + "dependencies": {}, + "development": {}, + "scripts": [ + "index.js" + ] +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/index.js new file mode 100644 index 00000000..5a47ca6f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json-fallback/index.js @@ -0,0 +1,486 @@ +/* + json2.js + 2011-10-19 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + See http://www.JSON.org/js.html + + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. + + + This file creates a global JSON object containing two methods: stringify + and parse. + + JSON.stringify(value, replacer, space) + value any JavaScript value, usually an object or array. + + replacer an optional parameter that determines how object + values are stringified for objects. It can be a + function or an array of strings. + + space an optional parameter that specifies the indentation + of nested structures. If it is omitted, the text will + be packed without extra whitespace. If it is a number, + it will specify the number of spaces to indent at each + level. If it is a string (such as '\t' or ' '), + it contains the characters used to indent at each level. + + This method produces a JSON text from a JavaScript value. + + When an object value is found, if the object contains a toJSON + method, its toJSON method will be called and the result will be + stringified. A toJSON method does not serialize: it returns the + value represented by the name/value pair that should be serialized, + or undefined if nothing should be serialized. The toJSON method + will be passed the key associated with the value, and this will be + bound to the value + + For example, this would serialize Dates as ISO strings. + + Date.prototype.toJSON = function (key) { + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + You can provide an optional replacer method. It will be passed the + key and value of each member, with this bound to the containing + object. The value that is returned from your method will be + serialized. If your method returns undefined, then the member will + be excluded from the serialization. + + If the replacer parameter is an array of strings, then it will be + used to select the members to be serialized. It filters the results + such that only members with keys listed in the replacer array are + stringified. + + Values that do not have JSON representations, such as undefined or + functions, will not be serialized. Such values in objects will be + dropped; in arrays they will be replaced with null. You can use + a replacer function to replace those with JSON values. + JSON.stringify(undefined) returns undefined. + + The optional space parameter produces a stringification of the + value that is filled with line breaks and indentation to make it + easier to read. + + If the space parameter is a non-empty string, then that string will + be used for indentation. If the space parameter is a number, then + the indentation will be that many spaces. + + Example: + + text = JSON.stringify(['e', {pluribus: 'unum'}]); + // text is '["e",{"pluribus":"unum"}]' + + + text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); + // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' + + text = JSON.stringify([new Date()], function (key, value) { + return this[key] instanceof Date ? + 'Date(' + this[key] + ')' : value; + }); + // text is '["Date(---current time---)"]' + + + JSON.parse(text, reviver) + This method parses a JSON text to produce an object or array. + It can throw a SyntaxError exception. + + The optional reviver parameter is a function that can filter and + transform the results. It receives each of the keys and values, + and its return value is used instead of the original value. + If it returns what it received, then the structure is not modified. + If it returns undefined then the member is deleted. + + Example: + + // Parse the text. Values that look like ISO date strings will + // be converted to Date objects. + + myData = JSON.parse(text, function (key, value) { + var a; + if (typeof value === 'string') { + a = +/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); + if (a) { + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], + +a[5], +a[6])); + } + } + return value; + }); + + myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { + var d; + if (typeof value === 'string' && + value.slice(0, 5) === 'Date(' && + value.slice(-1) === ')') { + d = new Date(value.slice(5, -1)); + if (d) { + return d; + } + } + return value; + }); + + + This is a reference implementation. You are free to copy, modify, or + redistribute. +*/ + +/*jslint evil: true, regexp: true */ + +/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, + call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, + getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, + lastIndex, length, parse, prototype, push, replace, slice, stringify, + test, toJSON, toString, valueOf +*/ + + +// Create a JSON object only if one does not already exist. We create the +// methods in a closure to avoid creating global variables. + +var JSON = {}; + +(function () { + 'use strict'; + + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + if (typeof Date.prototype.toJSON !== 'function') { + + Date.prototype.toJSON = function (key) { + + return isFinite(this.valueOf()) + ? this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z' + : null; + }; + + String.prototype.toJSON = + Number.prototype.toJSON = + Boolean.prototype.toJSON = function (key) { + return this.valueOf(); + }; + } + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + + function quote(string) { + +// If the string contains no control characters, no quote characters, and no +// backslash characters, then we can safely slap some quotes around it. +// Otherwise we must also replace the offending characters with safe escape +// sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' + ? c + : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } + + + function str(key, holder) { + +// Produce a string from holder[key]. + + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key]; + +// If the value has a toJSON method, call it to obtain a replacement value. + + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + +// If we were called with a replacer function, then call the replacer to +// obtain a replacement value. + + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + +// What happens next depends on the value's type. + + switch (typeof value) { + case 'string': + return quote(value); + + case 'number': + +// JSON numbers must be finite. Encode non-finite numbers as null. + + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + +// If the value is a boolean or null, convert it to a string. Note: +// typeof null does not produce 'null'. The case is included here in +// the remote chance that this gets fixed someday. + + return String(value); + +// If the type is 'object', we might be dealing with an object or an array or +// null. + + case 'object': + +// Due to a specification blunder in ECMAScript, typeof null is 'object', +// so watch out for that case. + + if (!value) { + return 'null'; + } + +// Make an array to hold the partial results of stringifying this object value. + + gap += indent; + partial = []; + +// Is the value an array? + + if (Object.prototype.toString.apply(value) === '[object Array]') { + +// The value is an array. Stringify every element. Use null as a placeholder +// for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + +// Join all of the elements together, separated with commas, and wrap them in +// brackets. + + v = partial.length === 0 + ? '[]' + : gap + ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' + : '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + +// If the replacer is an array, use it to select the members to be stringified. + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + if (typeof rep[i] === 'string') { + k = rep[i]; + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + +// Otherwise, iterate through all of the keys in the object. + + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } + +// Join all of the member texts together, separated with commas, +// and wrap them in braces. + + v = partial.length === 0 + ? '{}' + : gap + ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' + : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + +// If the JSON object does not yet have a stringify method, give it one. + + if (typeof JSON.stringify !== 'function') { + JSON.stringify = function (value, replacer, space) { + +// The stringify method takes a value and an optional replacer, and an optional +// space parameter, and returns a JSON text. The replacer can be a function +// that can replace values, or an array of strings that will select the keys. +// A default replacer method can be provided. Use of the space parameter can +// produce text that is more easily readable. + + var i; + gap = ''; + indent = ''; + +// If the space parameter is a number, make an indent string containing that +// many spaces. + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + +// If the space parameter is a string, it will be used as the indent string. + + } else if (typeof space === 'string') { + indent = space; + } + +// If there is a replacer, it must be a function or an array. +// Otherwise, throw an error. + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + +// Make a fake root object containing our value under the key of ''. +// Return the result of stringifying the value. + + return str('', {'': value}); + }; + } + + +// If the JSON object does not yet have a parse method, give it one. + + if (typeof JSON.parse !== 'function') { + JSON.parse = function (text, reviver) { + +// The parse method takes a text and an optional reviver function, and returns +// a JavaScript value if the text is a valid JSON text. + + var j; + + function walk(holder, key) { + +// The walk method is used to recursively walk the resulting structure so +// that modifications can be made. + + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + for (k in value) { + if (Object.prototype.hasOwnProperty.call(value, k)) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + } + } + } + return reviver.call(holder, key, value); + } + + +// Parsing happens in four stages. In the first stage, we replace certain +// Unicode characters with escape sequences. JavaScript handles many characters +// incorrectly, either silently deleting them, or treating them as line endings. + + text = String(text); + cx.lastIndex = 0; + if (cx.test(text)) { + text = text.replace(cx, function (a) { + return '\\u' + + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }); + } + +// In the second stage, we run the text against regular expressions that look +// for non-JSON patterns. We are especially concerned with '()' and 'new' +// because they can cause invocation, and '=' because it can cause mutation. +// But just to be safe, we want to reject all unexpected forms. + +// We split the second stage into 4 regexp operations in order to work around +// crippling inefficiencies in IE's and Safari's regexp engines. First we +// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we +// replace all simple value tokens with ']' characters. Third, we delete all +// open brackets that follow a colon or comma or that begin the text. Finally, +// we look to see that the remaining characters are only whitespace or ']' or +// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval. + + if (/^[\],:{}\s]*$/ + .test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@') + .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']') + .replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) { + +// In the third stage we use the eval function to compile the text into a +// JavaScript structure. The '{' operator is subject to a syntactic ambiguity +// in JavaScript: it can begin a block or an object literal. We wrap the text +// in parens to eliminate the ambiguity. + + j = eval('(' + text + ')'); + +// In the optional fourth stage, we recursively walk the new structure, passing +// each name/value pair to a reviver function for possible transformation. + + return typeof reviver === 'function' + ? walk({'': j}, '') + : j; + } + +// If the text is not JSON parseable, then a SyntaxError is thrown. + + throw new SyntaxError('JSON.parse'); + }; + } +}()); + +module.exports = JSON \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json/component.json new file mode 100644 index 00000000..da7097cf --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json/component.json @@ -0,0 +1,17 @@ +{ + "name": "json", + "repo": "component/json", + "description": "JSON parser / stringifier", + "version": "0.0.1", + "keywords": [ + "json" + ], + "dependencies": {}, + "development": {}, + "optional": { + "component/json-fallback": "*" + }, + "scripts": [ + "index.js" + ] +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json/index.js new file mode 100644 index 00000000..c05cc28c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/component-json/index.js @@ -0,0 +1,4 @@ + +module.exports = 'undefined' == typeof JSON + ? require('json-fallback') + : JSON; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/component.json new file mode 100644 index 00000000..b90c1f27 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/component.json @@ -0,0 +1,24 @@ +{ + "name": "engine.io", + "version": "0.4.0", + "dependencies": { + "component/emitter": "0.0.6", + "visionmedia/debug": "*" + }, + "main": "lib/index.js", + "scripts": [ + "lib/index.js", + "lib/parser.js", + "lib/socket.js", + "lib/transport.js", + "lib/emitter.js", + "lib/util.js", + "lib/transports/index.js", + "lib/transports/polling.js", + "lib/transports/polling-xhr.js", + "lib/transports/polling-jsonp.js", + "lib/transports/websocket.js", + "lib/transports/flashsocket.js" + ], + "repo": "https://raw.github.com/learnboost/engine.io-client" +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/emitter.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/emitter.js new file mode 100644 index 00000000..142a9bf6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/emitter.js @@ -0,0 +1,52 @@ + +/** + * Module dependencies. + */ + +var Emitter; + +try { + Emitter = require('emitter'); +} catch(e){ + Emitter = require('emitter-component'); +} + +/** + * Module exports. + */ + +module.exports = Emitter; + +/** + * Compatibility with `WebSocket#addEventListener`. + * + * @api public + */ + +Emitter.prototype.addEventListener = Emitter.prototype.on; + +/** + * Compatibility with `WebSocket#removeEventListener`. + * + * @api public + */ + +Emitter.prototype.removeEventListener = Emitter.prototype.off; + +/** + * Node-compatible `EventEmitter#removeListener` + * + * @api public + */ + +Emitter.prototype.removeListener = Emitter.prototype.off; + +/** + * Node-compatible `EventEmitter#removeAllListeners` + * + * @api public + */ + +Emitter.prototype.removeAllListeners = function(){ + this._callbacks = {}; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/index.js new file mode 100644 index 00000000..d463b3fb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/index.js @@ -0,0 +1,2 @@ + +module.exports = require('./socket'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/parser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/parser.js new file mode 100644 index 00000000..2c2928e8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/parser.js @@ -0,0 +1,163 @@ +/** + * Module dependencies. + */ + +var util = require('./util') + +/** + * Packet types. + */ + +var packets = exports.packets = { + open: 0 // non-ws + , close: 1 // non-ws + , ping: 2 + , pong: 3 + , message: 4 + , upgrade: 5 + , noop: 6 +}; + +var packetslist = util.keys(packets); + +/** + * Premade error packet. + */ + +var err = { type: 'error', data: 'parser error' } + +/** + * Encodes a packet. + * + * [ `:` ] + * + * Example: + * + * 5:hello world + * 3 + * 4 + * + * @api private + */ + +exports.encodePacket = function (packet) { + var encoded = packets[packet.type] + + // data fragment is optional + if (undefined !== packet.data) { + encoded += String(packet.data); + } + + return '' + encoded; +}; + +/** + * Decodes a packet. + * + * @return {Object} with `type` and `data` (if any) + * @api private + */ + +exports.decodePacket = function (data) { + var type = data.charAt(0); + + if (Number(type) != type || !packetslist[type]) { + return err; + } + + if (data.length > 1) { + return { type: packetslist[type], data: data.substring(1) }; + } else { + return { type: packetslist[type] }; + } +}; + +/** + * Encodes multiple messages (payload). + * + * :data + * + * Example: + * + * 11:hello world2:hi + * + * @param {Array} packets + * @api private + */ + +exports.encodePayload = function (packets) { + if (!packets.length) { + return '0:'; + } + + var encoded = '' + , message + + for (var i = 0, l = packets.length; i < l; i++) { + message = exports.encodePacket(packets[i]); + encoded += message.length + ':' + message; + } + + return encoded; +}; + +/* + * Decodes data when a payload is maybe expected. + * + * @param {String} data + * @return {Array} packets + * @api public + */ + +exports.decodePayload = function (data) { + if (data == '') { + // parser error - ignoring payload + return [err]; + } + + var packets = [] + , length = '' + , n, msg, packet + + for (var i = 0, l = data.length; i < l; i++) { + var chr = data.charAt(i) + + if (':' != chr) { + length += chr; + } else { + if ('' == length || (length != (n = Number(length)))) { + // parser error - ignoring payload + return [err]; + } + + msg = data.substr(i + 1, n); + + if (length != msg.length) { + // parser error - ignoring payload + return [err]; + } + + if (msg.length) { + packet = exports.decodePacket(msg); + + if (err.type == packet.type && err.data == packet.data) { + // parser error in individual packet - ignoring payload + return [err]; + } + + packets.push(packet); + } + + // advance cursor + i += n; + length = '' + } + } + + if (length != '') { + // parser error - ignoring payload + return [err]; + } + + return packets; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/socket.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/socket.js new file mode 100644 index 00000000..ad86283b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/socket.js @@ -0,0 +1,492 @@ +/** + * Module dependencies. + */ + +var util = require('./util') + , transports = require('./transports') + , Emitter = require('./emitter') + , debug = require('debug')('engine-client:socket'); + +/** + * Module exports. + */ + +module.exports = Socket; + +/** + * Global reference. + */ + +var global = 'undefined' != typeof window ? window : global; + +/** + * Socket constructor. + * + * @param {Object} options + * @api public + */ + +function Socket(opts){ + if (!(this instanceof Socket)) return new Socket(opts); + + if ('string' == typeof opts) { + var uri = util.parseUri(opts); + opts = arguments[1] || {}; + opts.host = uri.host; + opts.secure = uri.protocol == 'https' || uri.protocol == 'wss'; + opts.port = uri.port; + } + + opts = opts || {}; + this.secure = null != opts.secure ? opts.secure : (global.location && 'https:' == location.protocol); + this.host = opts.host || opts.hostname || (global.location ? location.hostname : 'localhost'); + this.port = opts.port || (global.location && location.port ? location.port : (this.secure ? 443 : 80)); + this.query = opts.query || {}; + this.query.uid = rnd(); + this.upgrade = false !== opts.upgrade; + this.resource = opts.resource || 'default'; + this.path = (opts.path || '/engine.io').replace(/\/$/, ''); + this.path += '/' + this.resource + '/'; + this.forceJSONP = !!opts.forceJSONP; + this.timestampParam = opts.timestampParam || 't'; + this.timestampRequests = !!opts.timestampRequests; + this.flashPath = opts.flashPath || ''; + this.transports = opts.transports || ['polling', 'websocket', 'flashsocket']; + this.readyState = ''; + this.writeBuffer = []; + this.policyPort = opts.policyPort || 843; + this.open(); + + Socket.sockets.push(this); + Socket.sockets.evs.emit('add', this); +}; + +/** + * Mix in `Emitter`. + */ + +Emitter(Socket.prototype); + +/** + * Protocol version. + * + * @api public + */ + +Socket.protocol = 1; + +/** + * Static EventEmitter. + */ + +Socket.sockets = []; +Socket.sockets.evs = new Emitter; + +/** + * Expose deps for legacy compatibility + * and standalone browser access. + */ + +Socket.Socket = Socket; +Socket.Transport = require('./transport'); +Socket.Emitter = require('./emitter'); +Socket.transports = require('./transports'); +Socket.util = require('./util'); +Socket.parser = require('./parser'); + +/** + * Creates transport of the given type. + * + * @param {String} transport name + * @return {Transport} + * @api private + */ + +Socket.prototype.createTransport = function (name) { + debug('creating transport "%s"', name); + var query = clone(this.query); + query.transport = name; + + if (this.id) { + query.sid = this.id; + } + + var transport = new transports[name]({ + host: this.host + , port: this.port + , secure: this.secure + , path: this.path + , query: query + , forceJSONP: this.forceJSONP + , timestampRequests: this.timestampRequests + , timestampParam: this.timestampParam + , flashPath: this.flashPath + , policyPort: this.policyPort + }); + + return transport; +}; + +function clone (obj) { + var o = {}; + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + o[i] = obj[i]; + } + } + return o; +} + +/** + * Initializes transport to use and starts probe. + * + * @api private + */ + +Socket.prototype.open = function () { + this.readyState = 'opening'; + var transport = this.createTransport(this.transports[0]); + transport.open(); + this.setTransport(transport); +}; + +/** + * Sets the current transport. Disables the existing one (if any). + * + * @api private + */ + +Socket.prototype.setTransport = function (transport) { + var self = this; + + if (this.transport) { + debug('clearing existing transport'); + this.transport.removeAllListeners(); + } + + // set up transport + this.transport = transport; + + // set up transport listeners + transport + .on('drain', function () { + self.flush(); + }) + .on('packet', function (packet) { + self.onPacket(packet); + }) + .on('error', function (e) { + self.onError(e); + }) + .on('close', function () { + self.onClose('transport close'); + }); +}; + +/** + * Probes a transport. + * + * @param {String} transport name + * @api private + */ + +Socket.prototype.probe = function (name) { + debug('probing transport "%s"', name); + var transport = this.createTransport(name, { probe: 1 }) + , failed = false + , self = this; + + transport.once('open', function () { + if (failed) return; + + debug('probe transport "%s" opened', name); + transport.send([{ type: 'ping', data: 'probe' }]); + transport.once('packet', function (msg) { + if (failed) return; + if ('pong' == msg.type && 'probe' == msg.data) { + debug('probe transport "%s" pong', name); + self.upgrading = true; + self.emit('upgrading', transport); + + debug('pausing current transport "%s"', self.transport.name); + self.transport.pause(function () { + if (failed) return; + if ('closed' == self.readyState || 'closing' == self.readyState) { + return; + } + debug('changing transport and sending upgrade packet'); + transport.removeListener('error', onerror); + self.emit('upgrade', transport); + self.setTransport(transport); + transport.send([{ type: 'upgrade' }]); + transport = null; + self.upgrading = false; + self.flush(); + }); + } else { + debug('probe transport "%s" failed', name); + var err = new Error('probe error'); + err.transport = transport.name; + self.emit('error', err); + } + }); + }); + + transport.once('error', onerror); + function onerror(err) { + if (failed) return; + + // Any callback called by transport should be ignored since now + failed = true; + + var error = new Error('probe error: ' + err); + error.transport = transport.name; + + transport.close(); + transport = null; + + debug('probe transport "%s" failed because of error: %s', name, err); + + self.emit('error', error); + }; + + transport.open(); + + this.once('close', function () { + if (transport) { + debug('socket closed prematurely - aborting probe'); + failed = true; + transport.close(); + transport = null; + } + }); + + this.once('upgrading', function (to) { + if (transport && to.name != transport.name) { + debug('"%s" works - aborting "%s"', to.name, transport.name); + transport.close(); + transport = null; + } + }); +}; + +/** + * Called when connection is deemed open. + * + * @api public + */ + +Socket.prototype.onOpen = function () { + debug('socket open'); + this.readyState = 'open'; + this.emit('open'); + this.onopen && this.onopen.call(this); + this.flush(); + + // we check for `readyState` in case an `open` + // listener alreay closed the socket + if ('open' == this.readyState && this.upgrade && this.transport.pause) { + debug('starting upgrade probes'); + for (var i = 0, l = this.upgrades.length; i < l; i++) { + this.probe(this.upgrades[i]); + } + } +}; + +/** + * Handles a packet. + * + * @api private + */ + +Socket.prototype.onPacket = function (packet) { + if ('opening' == this.readyState || 'open' == this.readyState) { + debug('socket receive: type "%s", data "%s"', packet.type, packet.data); + + this.emit('packet', packet); + + // Socket is live - any packet counts + this.emit('heartbeat'); + + switch (packet.type) { + case 'open': + this.onHandshake(util.parseJSON(packet.data)); + break; + + case 'pong': + this.ping(); + break; + + case 'error': + var err = new Error('server error'); + err.code = packet.data; + this.emit('error', err); + break; + + case 'message': + this.emit('message', packet.data); + var event = { data: packet.data }; + event.toString = function () { + return packet.data; + }; + this.onmessage && this.onmessage.call(this, event); + break; + } + } else { + debug('packet received with socket readyState "%s"', this.readyState); + } +}; + +/** + * Called upon handshake completion. + * + * @param {Object} handshake obj + * @api private + */ + +Socket.prototype.onHandshake = function (data) { + this.emit('handshake', data); + this.id = data.sid; + this.transport.query.sid = data.sid; + this.upgrades = data.upgrades; + this.pingInterval = data.pingInterval; + this.pingTimeout = data.pingTimeout; + this.onOpen(); + this.ping(); + + // Prolong liveness of socket on heartbeat + this.removeListener('heartbeat', this.onHeartbeat); + this.on('heartbeat', this.onHeartbeat); +}; + +/** + * Resets ping timeout. + * + * @api private + */ + +Socket.prototype.onHeartbeat = function (timeout) { + clearTimeout(this.pingTimeoutTimer); + var self = this; + self.pingTimeoutTimer = setTimeout(function () { + if ('closed' == self.readyState) return; + self.onClose('ping timeout'); + }, timeout || (self.pingInterval + self.pingTimeout)); +}; + +/** + * Pings server every `this.pingInterval` and expects response + * within `this.pingTimeout` or closes connection. + * + * @api private + */ + +Socket.prototype.ping = function () { + var self = this; + clearTimeout(self.pingIntervalTimer); + self.pingIntervalTimer = setTimeout(function () { + debug('writing ping packet - expecting pong within %sms', self.pingTimeout); + self.sendPacket('ping'); + self.onHeartbeat(self.pingTimeout); + }, self.pingInterval); +}; + +/** + * Flush write buffers. + * + * @api private + */ + +Socket.prototype.flush = function () { + if ('closed' != this.readyState && this.transport.writable && + !this.upgrading && this.writeBuffer.length) { + debug('flushing %d packets in socket', this.writeBuffer.length); + this.transport.send(this.writeBuffer); + this.writeBuffer = []; + } +}; + +/** + * Sends a message. + * + * @param {String} message. + * @return {Socket} for chaining. + * @api public + */ + +Socket.prototype.write = +Socket.prototype.send = function (msg) { + this.sendPacket('message', msg); + return this; +}; + +/** + * Sends a packet. + * + * @param {String} packet type. + * @param {String} data. + * @api private + */ + +Socket.prototype.sendPacket = function (type, data) { + var packet = { type: type, data: data }; + this.emit('packetCreate', packet); + this.writeBuffer.push(packet); + this.flush(); +}; + +/** + * Closes the connection. + * + * @api private + */ + +Socket.prototype.close = function () { + if ('opening' == this.readyState || 'open' == this.readyState) { + this.onClose('forced close'); + debug('socket closing - telling transport to close'); + this.transport.close(); + this.transport.removeAllListeners(); + } + + return this; +}; + +/** + * Called upon transport error + * + * @api private + */ + +Socket.prototype.onError = function (err) { + this.emit('error', err); + this.onClose('transport error', err); +}; + +/** + * Called upon transport close. + * + * @api private + */ + +Socket.prototype.onClose = function (reason, desc) { + if ('closed' != this.readyState) { + debug('socket close with reason: "%s"', reason); + clearTimeout(this.pingIntervalTimer); + clearTimeout(this.pingTimeoutTimer); + this.readyState = 'closed'; + this.emit('close', reason, desc); + this.onclose && this.onclose.call(this); + this.id = null; + } +}; + +/** + * Generates a random uid. + * + * @api private + */ + +function rnd () { + return String(Math.random()).substr(5) + String(Math.random()).substr(5); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transport.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transport.js new file mode 100644 index 00000000..5760f84b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transport.js @@ -0,0 +1,141 @@ + +/** + * Module dependencies. + */ + +var util = require('./util') + , parser = require('./parser') + , Emitter = require('./emitter'); + +/** + * Module exports. + */ + +module.exports = Transport; + +/** + * Transport abstract constructor. + * + * @param {Object} options. + * @api private + */ + +function Transport (opts) { + this.path = opts.path; + this.host = opts.host; + this.port = opts.port; + this.secure = opts.secure; + this.query = opts.query; + this.timestampParam = opts.timestampParam; + this.timestampRequests = opts.timestampRequests; + this.readyState = ''; +}; + +/** + * Mix in `Emitter`. + */ + +Emitter(Transport.prototype); + +/** + * Emits an error. + * + * @param {String} str + * @return {Transport} for chaining + * @api public + */ + +Transport.prototype.onError = function (msg, desc) { + var err = new Error(msg); + err.type = 'TransportError'; + err.description = desc; + this.emit('error', err); + return this; +}; + +/** + * Opens the transport. + * + * @api public + */ + +Transport.prototype.open = function () { + if ('closed' == this.readyState || '' == this.readyState) { + this.readyState = 'opening'; + this.doOpen(); + } + + return this; +}; + +/** + * Closes the transport. + * + * @api private + */ + +Transport.prototype.close = function () { + if ('opening' == this.readyState || 'open' == this.readyState) { + this.doClose(); + this.onClose(); + } + + return this; +}; + +/** + * Sends multiple packets. + * + * @param {Array} packets + * @api private + */ + +Transport.prototype.send = function(packets){ + if ('open' == this.readyState) { + this.write(packets); + } else { + throw new Error('Transport not open'); + } +}; + +/** + * Called upon open + * + * @api private + */ + +Transport.prototype.onOpen = function () { + this.readyState = 'open'; + this.writable = true; + this.emit('open'); +}; + +/** + * Called with data. + * + * @param {String} data + * @api private + */ + +Transport.prototype.onData = function (data) { + this.onPacket(parser.decodePacket(data)); +}; + +/** + * Called with a decoded packet. + */ + +Transport.prototype.onPacket = function (packet) { + this.emit('packet', packet); +}; + +/** + * Called upon close. + * + * @api private + */ + +Transport.prototype.onClose = function () { + this.readyState = 'closed'; + this.emit('close'); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/flashsocket.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/flashsocket.js new file mode 100644 index 00000000..9a5a1082 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/flashsocket.js @@ -0,0 +1,254 @@ + +/** + * Module dependencies. + */ + +var WS = require('./websocket') + , util = require('../util') + , debug = require('debug')('engine.io-client:flashsocket'); + +/** + * Module exports. + */ + +module.exports = FlashWS; + +/** + * Obfuscated key for Blue Coat. + */ + +var xobject = global[['Active'].concat('Object').join('X')]; + +/** + * FlashWS constructor. + * + * @api public + */ + +function FlashWS (options) { + WS.call(this, options); + this.flashPath = options.flashPath; + this.policyPort = options.policyPort; +}; + +/** + * Inherits from WebSocket. + */ + +util.inherits(FlashWS, WS); + +/** + * Transport name. + * + * @api public + */ + +FlashWS.prototype.name = 'flashsocket'; + +/** + * Opens the transport. + * + * @api public + */ + +FlashWS.prototype.doOpen = function () { + if (!this.check()) { + // let the probe timeout + return; + } + + // instrument websocketjs logging + function log (type) { + return function(){ + var str = Array.prototype.join.call(arguments, ' '); + debug('[websocketjs %s] %s', type, str); + }; + }; + + WEB_SOCKET_LOGGER = { log: log('debug'), error: log('error') }; + WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR = true; + WEB_SOCKET_DISABLE_AUTO_INITIALIZATION = true; + + if ('undefined' == typeof WEB_SOCKET_SWF_LOCATION) { + WEB_SOCKET_SWF_LOCATION = this.flashPath + 'WebSocketMainInsecure.swf'; + } + + // dependencies + var deps = [this.flashPath + 'web_socket.js']; + + if ('undefined' == typeof swfobject) { + deps.unshift(this.flashPath + 'swfobject.js'); + } + + var self = this; + + load(deps, function () { + self.ready(function () { + WebSocket.__addTask(function () { + WS.prototype.doOpen.call(self); + }); + }); + }); +}; + +/** + * Override to prevent closing uninitialized flashsocket. + * + * @api private + */ + +FlashWS.prototype.doClose = function () { + if (!this.socket) return; + var self = this; + WebSocket.__addTask(function() { + WS.prototype.doClose.call(self); + }); +}; + +/** + * Writes to the Flash socket. + * + * @api private + */ + +FlashWS.prototype.write = function() { + var self = this, args = arguments; + WebSocket.__addTask(function () { + WS.prototype.write.apply(self, args); + }); +}; + +/** + * Called upon dependencies are loaded. + * + * @api private + */ + +FlashWS.prototype.ready = function (fn) { + if (typeof WebSocket == 'undefined' || + !('__initialize' in WebSocket) || !swfobject) { + return; + } + + if (swfobject.getFlashPlayerVersion().major < 10) { + return; + } + + function init () { + // Only start downloading the swf file when the checked that this browser + // actually supports it + if (!FlashWS.loaded) { + if (843 != self.policyPort) { + WebSocket.loadFlashPolicyFile('xmlsocket://' + self.host + ':' + self.policyPort); + } + + WebSocket.__initialize(); + FlashWS.loaded = true; + } + + fn.call(self); + } + + var self = this; + if (document.body) { + return init(); + } + + util.load(init); +}; + +/** + * Feature detection for flashsocket. + * + * @return {Boolean} whether this transport is available. + * @api public + */ + +FlashWS.prototype.check = function () { + if ('undefined' != typeof process) { + return false; + } + + if (typeof WebSocket != 'undefined' && !('__initialize' in WebSocket)) { + return false; + } + + if (xobject) { + var control = null; + try { + control = new xobject('ShockwaveFlash.ShockwaveFlash'); + } catch (e) { } + if (control) { + return true; + } + } else { + for (var i = 0, l = navigator.plugins.length; i < l; i++) { + for (var j = 0, m = navigator.plugins[i].length; j < m; j++) { + if (navigator.plugins[i][j].description == 'Shockwave Flash') { + return true; + } + } + } + } + + return false; +}; + +/** + * Lazy loading of scripts. + * Based on $script by Dustin Diaz - MIT + */ + +var scripts = {}; + +/** + * Injects a script. Keeps tracked of injected ones. + * + * @param {String} path + * @param {Function} callback + * @api private + */ + +function create (path, fn) { + if (scripts[path]) return fn(); + + var el = document.createElement('script'); + var loaded = false; + + debug('loading "%s"', path); + el.onload = el.onreadystatechange = function () { + if (loaded || scripts[path]) return; + var rs = el.readyState; + if (!rs || 'loaded' == rs || 'complete' == rs) { + debug('loaded "%s"', path); + el.onload = el.onreadystatechange = null; + loaded = true; + scripts[path] = true; + fn(); + } + }; + + el.async = 1; + el.src = path; + + var head = document.getElementsByTagName('head')[0]; + head.insertBefore(el, head.firstChild); +}; + +/** + * Loads scripts and fires a callback. + * + * @param {Array} paths + * @param {Function} callback + */ + +function load (arr, fn) { + function process (i) { + if (!arr[i]) return fn(); + create(arr[i], function () { + process(++i); + }); + }; + + process(0); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/index.js new file mode 100644 index 00000000..374620b0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/index.js @@ -0,0 +1,62 @@ + +/** + * Module dependencies + */ + +var XHR = require('./polling-xhr') + , JSONP = require('./polling-jsonp') + , websocket = require('./websocket') + , flashsocket = require('./flashsocket') + , util = require('../util'); + +/** + * Export transports. + */ + +exports.polling = polling; +exports.websocket = websocket; +exports.flashsocket = flashsocket; + +/** + * Global reference. + */ + +var global = 'undefined' != typeof window ? window : global; + +/** + * Polling transport polymorphic constructor. + * Decides on xhr vs jsonp based on feature detection. + * + * @api private + */ + +function polling (opts) { + var xhr + , xd = false + , isXProtocol = false; + + if (global.location) { + var isSSL = 'https:' == location.protocol; + var port = location.port; + + // some user agents have empty `location.port` + if (Number(port) != port) { + port = isSSL ? 443 : 80; + } + + xd = opts.host != location.hostname || port != opts.port; + isXProtocol = opts.secure != isSSL; + } + + xhr = util.request(xd); + /* See #7 at http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx */ + if (isXProtocol && global.XDomainRequest && xhr instanceof global.XDomainRequest) { + return new JSONP(opts); + } + + if (xhr && !opts.forceJSONP) { + return new XHR(opts); + } else { + return new JSONP(opts); + } +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-jsonp.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-jsonp.js new file mode 100644 index 00000000..fde3e79e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/components/learnboost-engine.io-client/lib/transports/polling-jsonp.js @@ -0,0 +1,221 @@ + +/** + * Module requirements. + */ + +var Polling = require('./polling') + , util = require('../util'); + +/** + * Module exports. + */ + +module.exports = JSONPPolling; + +/** + * Global reference. + */ + +var global = 'undefined' != typeof window ? window : global; + +/** + * Cached regular expressions. + */ + +var rNewline = /\n/g; + +/** + * Global JSONP callbacks. + */ + +var callbacks; + +/** + * Callbacks count. + */ + +var index = 0; + +/** + * Noop. + */ + +function empty () { } + +/** + * JSONP Polling constructor. + * + * @param {Object} opts. + * @api public + */ + +function JSONPPolling (opts) { + Polling.call(this, opts); + + // define global callbacks array if not present + // we do this here (lazily) to avoid unneeded global pollution + if (!callbacks) { + // we need to consider multiple engines in the same page + if (!global.___eio) global.___eio = []; + callbacks = global.___eio; + } + + // callback identifier + this.index = callbacks.length; + + // add callback to jsonp global + var self = this; + callbacks.push(function (msg) { + self.onData(msg); + }); + + // append to query string + this.query.j = this.index; +}; + +/** + * Inherits from Polling. + */ + +util.inherits(JSONPPolling, Polling); + +/** + * Opens the socket. + * + * @api private + */ + +JSONPPolling.prototype.doOpen = function () { + var self = this; + util.defer(function () { + Polling.prototype.doOpen.call(self); + }); +}; + +/** + * Closes the socket + * + * @api private + */ + +JSONPPolling.prototype.doClose = function () { + if (this.script) { + this.script.parentNode.removeChild(this.script); + this.script = null; + } + + if (this.form) { + this.form.parentNode.removeChild(this.form); + this.form = null; + } + + Polling.prototype.doClose.call(this); +}; + +/** + * Starts a poll cycle. + * + * @api private + */ + +JSONPPolling.prototype.doPoll = function () { + var script = document.createElement('script'); + + if (this.script) { + this.script.parentNode.removeChild(this.script); + this.script = null; + } + + script.async = true; + script.src = this.uri(); + + var insertAt = document.getElementsByTagName('script')[0]; + insertAt.parentNode.insertBefore(script, insertAt); + this.script = script; + + if (util.ua.gecko) { + setTimeout(function () { + var iframe = document.createElement('iframe'); + document.body.appendChild(iframe); + document.body.removeChild(iframe); + }, 100); + } +}; + +/** + * Writes with a hidden iframe. + * + * @param {String} data to send + * @param {Function} called upon flush. + * @api private + */ + +JSONPPolling.prototype.doWrite = function (data, fn) { + var self = this; + + if (!this.form) { + var form = document.createElement('form') + , area = document.createElement('textarea') + , id = this.iframeId = 'eio_iframe_' + this.index + , iframe; + + form.className = 'socketio'; + form.style.position = 'absolute'; + form.style.top = '-1000px'; + form.style.left = '-1000px'; + form.target = id; + form.method = 'POST'; + form.setAttribute('accept-charset', 'utf-8'); + area.name = 'd'; + form.appendChild(area); + document.body.appendChild(form); + + this.form = form; + this.area = area; + } + + this.form.action = this.uri(); + + function complete () { + initIframe(); + fn(); + }; + + function initIframe () { + if (self.iframe) { + self.form.removeChild(self.iframe); + } + + try { + // ie6 dynamic iframes with target="" support (thanks Chris Lambacher) + iframe = document.createElement(''; +html += '
'; +html += '
'; +html += '
Upload File
'; +html += '
Want to upload multiple files at once? Please upgrade to the latest Flash Player, then reload this page. For some reason our Flash based uploader did not load, so you are currently using our single file uploader.
'; +html += spacer(1,20) + '
'; +var url = zero_client.targetURL; +if (url.indexOf('?') > -1) url += '&'; else url += '?'; +url += 'format=jshtml&onafter=' + escape('window.parent.upload_basic_finish(response);'); +Debug.trace('upload', "Prepping basic upload: " + url); +html += '
'; +html += '
'; +html += '
'; +html += '

'; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + ' ' + large_icon_button('page_white_get.png', 'Upload', "upload_basic_go()") + '
'; +html += '
'; +html += ''; +html += '
'; +html += ''; +session.hooks.keys[ESC_KEY] = 'hide_popup_dialog'; +show_popup_dialog(528, 200, html); +} +function upload_basic_go() { +$('f_upload_basic').submit(); +$('d_upload_form').hide(); +$('d_upload_progress').show(); +} +function upload_basic_finish(response) { +Debug.trace('upload', "Basic upload complete: " + dumper(response)); +setTimeout( 'upload_basic_finish_2()', 100 ); +} +function upload_basic_finish_2() { +$('i_upload_basic').src = 'blank.html'; +setTimeout( 'upload_basic_finish_3()', 100 ); +} +function upload_basic_finish_3() { +hide_popup_dialog(); +delete session.progress; +show_progress_dialog( 0, 'Finishing Upload...', true ); +fire_callback( session.upload_callback ); +} +function upload_destroy() { +if (zero_client) { +zero_client.destroy(); +delete ZeroUpload.clients[ zero_client.id ]; +zero_client = null; +} +} +function prep_upload(dom_id, url, callback, types) { +session.upload_callback = callback; +if (url) { +if (url.indexOf('?') > -1) url += '&'; else url += '?'; +url += 'session=' + session.cookie.get('effect_session_id'); +} +upload_destroy(); +zero_client = new ZeroUpload.Client(); +if (url) zero_client.setURL( url ); +zero_client.setHandCursor( true ); +if (types) zero_client.setFileTypes( types[0], types[1] ); +zero_client.addEventListener( 'queueStart', uploadQueueStart ); +zero_client.addEventListener( 'fileStart', uploadFileStart ); +zero_client.addEventListener( 'progress', uploadProgress ); +zero_client.addEventListener( 'fileComplete', uploadFileComplete ); +zero_client.addEventListener( 'queueComplete', uploadQueueComplete ); +zero_client.addEventListener( 'error', uploadError ); +zero_client.addEventListener( 'debug', function(client, eventName, args) { +Debug.trace('upload', "Caught event: " + eventName); +} ); +if (dom_id) { +Debug.trace('upload', "Gluing ZeroUpload to: " + dom_id); +zero_client.glue( dom_id ); +} +} +Class.create( 'Debug', { +__static: { +enabled: false, +categories: { all: 1 }, +buffer: [], +max_rows: 5000, +win: null, +ie: !!navigator.userAgent.match(/MSIE/), +ie6: !!navigator.userAgent.match(/MSIE\D+6/), +init: function() { +Debug.enabled = true; +Debug.trace( 'debug', 'Debug log start' ); +var html = '

'; +if (Debug.ie) { +setTimeout( function() { +document.body.insertAdjacentHTML('beforeEnd', +'
' + html + '
' +); +}, 1000 ); +} +else { +var div = document.createElement('DIV'); +div.id = 'd_debug'; +div.setAttribute('id', 'd_debug'); +div.style.position = Debug.ie6 ? 'absolute' : 'fixed'; +div.style.zIndex = '101'; +div.style.left = '0px'; +div.style.top = '0px'; +div.style.width = '100%'; +div.innerHTML = html; +document.getElementsByTagName('body')[0].appendChild(div); +} +}, +show: function() { +if (!Debug.win || Debug.win.closed) { +Debug.trace('debug', "Opening debug window"); +Debug.win = window.open( '', 'DebugWindow', 'width=600,height=500,menubar=no,resizable=yes,scrollbars=yes,location=no,status=no,toolbar=no,directories=no' ); +if (!Debug.win) return alert("Failed to open window. Popup blocker maybe?"); +var doc = Debug.win.document; +doc.open(); +doc.writeln( 'Debug Log' ); +doc.writeln( '
' ); +doc.writeln( '
' ); +doc.writeln( '
' ); +doc.writeln( '' ); +doc.writeln( '' ); +doc.writeln( '
' ); +doc.writeln( '' ); +doc.close(); +} +Debug.win.focus(); +}, +console_execute: function() { +var cmd = Debug.win.document.getElementById('fe_command'); +if (cmd.value.length) { +Debug.trace( 'console', cmd.value ); +try { +Debug.trace( 'console', '' + eval(cmd.value) ); +} +catch (e) { +Debug.trace( 'error', 'JavaScript Interpreter Exception: ' + e.toString() ); +} +} +}, +get_time_stamp: function(now) { +var date = new Date( now * 1000 ); +var hh = date.getHours(); if (hh < 10) hh = "0" + hh; +var mi = date.getMinutes(); if (mi < 10) mi = "0" + mi; +var ss = date.getSeconds(); if (ss < 10) ss = "0" + ss; +var sss = '' + date.getMilliseconds(); while (sss.length < 3) sss = "0" + sss; +return '' + hh + ':' + mi + ':' + ss + '.' + sss; +}, +refresh_console: function() { +if (!Debug.win || Debug.win.closed) return; +var div = Debug.win.document.getElementById('d_debug_log'); +if (div) { +var row = null; +while ( row = Debug.buffer.shift() ) { +var time_stamp = Debug.get_time_stamp(row.time); +var msg = row.msg; +msg = msg.replace(/\t/g, "    "); +msg = msg.replace(//g, ">"); +msg = msg.replace(/\n/g, "
\n"); +var html = ''; +var sty = 'float:left; font-family: Consolas, Courier, mono; font-size: 12px; cursor:default; margin-right:10px; margin-bottom:1px; padding:2px;'; +html += '
' + time_stamp + '
'; +html += '
' + row.cat + '
'; +html += '
' + msg + '
'; +html += '
'; +var chunk = Debug.win.document.createElement('DIV'); +chunk.style['float'] = 'none'; +chunk.innerHTML = html; +div.appendChild(chunk); +} +var cmd = Debug.win.document.getElementById('fe_command'); +cmd.focus(); +} +Debug.dirty = 0; +Debug.win.scrollTo(0, 99999); +}, +hires_time_now: function() { +var now = new Date(); +return ( now.getTime() / 1000 ); +}, +trace: function(cat, msg) { +if (arguments.length == 1) { +msg = cat; +cat = 'debug'; +} +if (Debug.categories.all || Debug.categories[cat]) { +Debug.buffer.push({ cat: cat, msg: msg, time: Debug.hires_time_now() }); +if (Debug.buffer.length > Debug.max_rows) Debug.buffer.shift(); +if (!Debug.dirty) { +Debug.dirty = 1; +setTimeout( 'Debug.refresh_console();', 1 ); +} +} +} +} +} ); +var session = { +inited: false, +api_mod_cache: {}, +query: parseQueryString( ''+location.search ), +cookie: new CookieTree({ path: '/effect/' }), +storage: {}, +storage_dirty: false, +hooks: { +keys: {} +}, +username: '', +em_width: 11, +audioResourceMatch: /\.mp3$/i, +imageResourceMatch: /\.(jpe|jpeg|jpg|png|gif)$/i, +textResourceMatch: /\.xml$/i, +movieResourceMatch: /\.(flv|mp4|mp4v|mov|3gp|3g2)$/i, +imageResourceMatchString: '\.(jpe|jpeg|jpg|png|gif)$' +}; +session.debug = session.query.debug ? true : false; +var page_manager = null; +var preload_icons = []; +var preload_images = [ +'loading.gif', +'aquaprogressbar.gif', +'aquaprogressbar_bkgnd.gif' +]; +function get_base_url() { +return protocol + '://' + location.hostname + session.config.BaseURI; +} +function effect_init() { +if (session.inited) return; +session.inited = true; +assert( window.config, "Config not loaded" ); +session.config = window.config; +Debug.trace("Starting up"); +rendering_page = false; +preload(); +window.$R = {}; +for (var key in config.RegExpShortcuts) { +$R[key] = new RegExp( config.RegExpShortcuts[key] ); +} +ww_precalc_font("body", "effect_precalc_font_finish"); +page_manager = new Effect.PageManager( config.Pages.Page ); +var session_id = session.cookie.get('effect_session_id'); +if (session_id && session_id.match(/^login/)) { +do_session_recover(); +} +else { +show_default_login_status(); +Nav.init(); +} +Blog.search({ +stag: 'sidebar_docs', +limit: 20, +title_only: true, +sort_by: 'seq', +sort_dir: -1, +target: 'd_sidebar_documents', +outer_div_class: 'sidebar_blog_row', +title_class: 'sidebar_blog_title', +after: '' +}); +Blog.search({ +stag: 'sidebar_tutorials', +limit: 5, +title_only: true, +sort_by: 'seq', +sort_dir: -1, +target: 'd_sidebar_tutorials', +outer_div_class: 'sidebar_blog_row', +title_class: 'sidebar_blog_title', +after: '' +}); +Blog.search({ +stag: 'sidebar_plugins', +limit: 5, +title_only: true, +sort_by: 'seq', +sort_dir: -1, +target: 'd_sidebar_plugins', +outer_div_class: 'sidebar_blog_row', +title_class: 'sidebar_blog_title', +after: '' +}); +$('fe_search_bar').onkeydown = delay_onChange_input_text; +user_storage_idle(); +} +function effect_precalc_font_finish(width, height) { +session.em_width = width; +} +function preload() { +for (var idx = 0, len = preload_icons.length; idx < len; idx++) { +var url = images_uri + '/icons/' + preload_icons[idx] + '.gif'; +preload_icons[idx] = new Image(); +preload_icons[idx].src = url; +} +for (var idx = 0, len = preload_images.length; idx < len; idx++) { +var url = images_uri + '/' + preload_images[idx]; +preload_images[idx] = new Image(); +preload_images[idx].src = url; +} +} +function $P(id) { +if (!id) id = page_manager.current_page_id; +var page = page_manager.find(id); +assert( !!page, "Failed to locate page: " + id ); +return page; +} +function get_pref(name) { +if (!session.user || !session.user.Preferences) return alert("ASSERT FAILURE! Tried to lookup pref " + name + " and user is not yet loaded!"); +return session.user.Preferences[name]; +} +function get_bool_pref(name) { +return (get_pref(name) == 1); +} +function set_pref(name, value) { +session.user.Preferences[name] = value; +} +function set_bool_pref(name, value) { +set_pref(name, value ? '1' : '0'); +} +function save_prefs() { +var prefs_to_save = {}; +if (arguments.length) { +for (var idx = 0, len = arguments.length; idx < len; idx++) { +var key = arguments[idx]; +prefs_to_save[key] = get_pref(key); +} +} +else prefs_to_save = session.user.Preferences; +effect_api_mod_touch('user_get'); +effect_api_send('user_update', { +Username: session.username, +Preferences: prefs_to_save +}, 'save_prefs_2'); +} +function save_prefs_2(response) { +do_message('success', 'Preferences saved.'); +} + +function get_full_name(username) { +var user = session.users[username]; +if (!user) return username; +return user.FullName; +} +function get_buddy_icon_url(username, size) { +var mod = session.api_mod_cache.get_buddy_icon || 0; +if (!size) size = 32; +var url = '/effect/api/get_buddy_icon?username='+username + '&mod=' + mod + '&size=' + size; +return url; +} +function get_buddy_icon_display(username, show_icon, show_name) { +if ((typeof(show_icon) == 'undefined') && get_bool_pref('show_user_icons')) show_icon = 1; +if ((typeof(show_name) == 'undefined') && get_bool_pref('show_user_names')) show_name = 1; +var html = ''; +if (show_icon) html += ''; +if (show_icon && show_name) html += '
'; +if (show_name) html += username; +return html; +} +function do_session_recover() { +session.hooks.after_error = 'do_logout'; +effect_api_send('session_recover', {}, 'do_login_2', { _from_recover: 1 } ); +} +function require_login() { +if (session.user) return true; +Debug.trace('Page requires login, showing login page'); +session.nav_after_login = Nav.currentAnchor(); +setTimeout( function() { +Nav.go( 'Login' ); +}, 1 ); +return false; +} +function popup_window(url, name) { +if (!url) url = ''; +if (!name) name = ''; +var win = window.open(url, name); +if (!win) return alert('Failed to open popup window. If you have a popup blocker, please disable it for this website and try again.'); +return win; +} +function do_login_prompt() { +hide_popup_dialog(); +delete session.progress; +if (!session.temp_password) session.temp_password = ''; +if (!session.username) session.username = ''; +var temp_username = session.open_id || session.username || ''; +var html = ''; +html += '
'; +html += '
'; +html += '
Effect Developer Login
'; +html += '
'; +html += '
Effect Username  or  '+icon('openid', 'OpenID', 'popup_window(\'http://openid.net/\')', 'What is OpenID?')+'


'; +html += '
'; +html += '
'; +html += '

'; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', "clear_login()") + ' ' + large_icon_button('check', 'Login', 'do_login()') + '
'; +html += '
'; +html += ''; +session.hooks.keys[ENTER_KEY] = 'do_login'; +session.hooks.keys[ESC_KEY] = 'clear_login'; +safe_focus( 'fe_username' ); +show_popup_dialog(450, 225, html); +} +function do_openid_reg(title, auto_login_button) { +hide_popup_dialog(); +delete session.progress; +if (!title) title = 'Register Account Using OpenID'; +if (typeof(auto_login_button) == 'undefined') auto_login_button = 1; +var html = ''; +html += '
'; +html += '
'; +html += '
'+title+'
'; +html += '
'; +html += '
'+icon('openid', 'Enter Your OpenID URL:')+'
'; +if (auto_login_button) html += '


'; +html += '
'; +html += '

'; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + ' ' + large_icon_button('check', title.match(/login/i) ? 'Login' : 'Register', 'do_openid_login()') + '
'; +html += '
'; +html += ''; +session.hooks.keys[ENTER_KEY] = 'do_openid_login'; +session.hooks.keys[ESC_KEY] = 'hide_popup_dialog'; +safe_focus( 'fe_username' ); +show_popup_dialog(450, 225, html); +} +function do_login_prompt_2() { +hide_popup_dialog(); +delete session.progress; +if (!session.temp_password) session.temp_password = ''; +if (!session.username) session.username = ''; +var html = ''; +html += '
'; +html += '
'; +html += '
Enter Your Password
'; +html += '
'; +html += '
Password:


'; +html += '
'; +html += '
'; +html += '

'; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', "clear_login()") + ' ' + large_icon_button('check', 'Login', 'do_effect_login()') + '
'; +html += '
'; +html += ''; +session.hooks.keys[ENTER_KEY] = 'do_effect_login'; +session.hooks.keys[ESC_KEY] = 'clear_login'; +safe_focus( 'fe_lp_password' ); +show_popup_dialog(450, 225, html); +} +function clear_login() { +hide_popup_dialog(); +Nav.prev(); +} +function do_login() { +if ($('fe_username').value.match(/^\w+$/)) { +session.username = $('fe_username').value; +session.auto_login = $('fe_auto_login').checked; +do_login_prompt_2(); +return; +} +else { +do_openid_login(); +} +} +function do_openid_login() { +if (!$('fe_username').value) return; +session.openid_win = popup_window(''); +if (!session.openid_win) return; +session.open_id = $('fe_username').value; +session.auto_login = $('fe_auto_login') && $('fe_auto_login').checked; +hide_popup_dialog(); +show_progress_dialog(1, "Logging in..."); +session.hooks.before_error = 'close_openid_window'; +session.hooks.after_error = 'do_login_prompt'; +effect_api_send('openid_login', { +OpenID: session.open_id, +Infinite: session.auto_login ? 1 : 0 +}, 'do_openid_login_2'); +} +function close_openid_window() { +if (session.openid_win) { +session.openid_win.close(); +delete session.openid_win; +} +} +function do_openid_login_2(response) { +if (response.CheckURL) { +Debug.trace('openid', "Redirecting popup window to OpenID Check URL: " + response.CheckURL); +show_progress_dialog(1, "Waiting for popup window...", false, ['x', 'Cancel', 'do_login_prompt()']); +session.openid_win.location = response.CheckURL; +session.openid_win.focus(); +} +} +function receive_openid_response(iframe_response) { +var response = deep_copy_object(iframe_response); +Debug.trace('openid', "Received OpenID Response: " + dumper(response)); +hide_popup_dialog(); +if (response.Code) { +close_openid_window(); +return do_error( response.Description ); +} +delete session.hooks.before_error; +delete session.hooks.after_error; +if (response.SessionID) { +session.cookie.set( 'effect_session_id', response.SessionID ); +session.cookie.save(); +} +switch (response.Action) { +case 'popup': +show_progress_dialog(1, "Waiting for popup window...", false, ['x', 'Cancel', 'do_login_prompt()']); +Debug.trace('openid', "Redirecting popup window to OpenID Setup URL: " + response.SetupURL); +session.openid_win.location = response.SetupURL; +session.openid_win.focus(); +break; +case 'login': +close_openid_window(); +do_login_2(response); +break; +case 'register': +if (!response.Info) response.Info = {}; +close_openid_window(); +Debug.trace('openid', 'Original OpenID: ' + response.OpenID_Login); +Debug.trace('openid', 'Clean OpenID: ' + response.OpenID_Unique); +Debug.trace('openid', 'Registration Info: ' + dumper(response.Info)); +session.prereg = response.Info; +session.prereg.open_id_login = response.OpenID_Login; +session.prereg.open_id = response.OpenID_Unique; +if (session.user) { +if (!session.user.OpenIDs) session.user.OpenIDs = {}; +if (!session.user.OpenIDs.OpenID) session.user.OpenIDs.OpenID = []; +var dupe = find_object( session.user.OpenIDs.OpenID, { Unique: session.prereg.open_id } ); +if (dupe) return do_error("That OpenID is already registered and attached to your account. No need to add it again."); +session.user.OpenIDs.OpenID.push({ +Login: session.prereg.open_id_login, +Unique: session.prereg.open_id +}); +setTimeout( function() { +Nav.go('MyAccount', true); +do_message('success', 'Added new OpenID URL to account.'); +}, 1 ); +} +else { +setTimeout( function() { Nav.go('CreateAccount', true); }, 1 ); +} +break; +} +} +function do_effect_login() { +var password = $('fe_lp_password').value; +session.auto_login = $('fe_auto_login').checked; +hide_popup_dialog(); +show_progress_dialog(1, "Logging in..."); +session.hooks.after_error = 'do_login_prompt'; +effect_api_send('user_login', { +Username: session.username, +Password: password, +Infinite: session.auto_login ? 1 : 0 +}, 'do_login_2'); +} +function do_logout() { +effect_api_send('user_logout', {}, 'do_logout_2'); +} +function do_logout_2(response) { +hide_popup_dialog(); +show_default_login_status(); +delete session.hooks.after_error; +delete session.cookie.tree.effect_session_id; +session.cookie.save(); +session.storage = {}; +session.storage_dirty = false; +delete session.user; +delete session.first_login; +var old_username = session.username; +session.username = ''; +if (Nav.inited) { +Nav.go('Main'); +if (old_username) $GR.growl('success', "Logged out of account: " + old_username); +} +else { +Nav.init(); +} +} +function do_login_2(response, tx) { +if (response.FirstLogin) session.first_login = 1; +if (response.User.UserStorage) { +Debug.trace('Recovering site storage blob: session.storage = ' + response.User.UserStorage + ';'); +try { +eval( 'session.storage = ' + response.User.UserStorage + ';' ); +} +catch (e) { +Debug.trace("SITE STORAGE RECOVERY FAILED: " + e); +session.storage = {}; +} +delete response.User.UserStorage; +session.storage_dirty = false; +} +session.user = response.User; +session.username = session.user.Username; +hide_popup_dialog(); +delete session.hooks.after_error; +update_header(); +if (!tx || !tx._from_recover) $GR.growl('success', "Logged in as: " + session.username); +if (session.nav_after_login) { +Nav.go( session.nav_after_login ); +delete session.nav_after_login; +} +else if (Nav.currentAnchor().match(/^Login/)) { +Nav.go('Home'); +} +else { +Nav.refresh(); +} +Nav.init(); +} +function user_storage_mark() { +Debug.trace("Marking user storage as dirty"); +session.storage_dirty = true; +} +function user_storage_idle() { +if (session.storage_dirty && !session.mouseIsDown) { +user_storage_save(); +session.storage_dirty = false; +} +setTimeout( 'user_storage_idle()', 5000 ); +} +function user_storage_save() { +if (session.user) { +Debug.trace("Committing user storage blob"); +effect_api_send('update_user_storage', { Data: serialize(session.storage) }, 'user_storage_save_finish', { _silent: 1 } ); +} +} +function user_storage_save_finish(response, tx) { +} +function show_default_login_status() { +$('d_sidebar_wrapper_recent_games').hide(); +$('d_login_status').innerHTML = '
' + +'
' + +large_icon_button('key', "Login", '#Home') + '' + spacer(1,1) + '' + +'' + large_icon_button('user_add.png', "Signup", '#CreateAccount') + '
' + +'
'; +$('d_tagline').innerHTML = +'Login' + ' | ' + +'Create Account'; +} +function update_header() { +var html = ''; +html += '
'; +html += ''; +html += ''; +html += ''; +html += ''+spacer(2,2)+''; +html += session.user.FullName + '
'; +html += spacer(1,5) + '
'; +html += 'My Home  |  '; +html += 'Logout'; +html += '
'; +$('d_login_status').innerHTML = html; +$('d_tagline').innerHTML = +'Welcome '+session.user.FirstName+'' + ' | ' + +'My Home' + ' | ' + +'Logout'; +effect_api_get( 'get_user_games', { limit:5, offset:0 }, 'receive_sidebar_recent_games', { } ); +} +function receive_sidebar_recent_games(response, tx) { +var html = ''; +if (response.Rows && response.Rows.Row) { +var games = always_array( response.Rows.Row ); +for (var idx = 0, len = games.length; idx < len; idx++) { +var game = games[idx]; +html += ''; +} +html += ''; +$('d_sidebar_recent_games').innerHTML = html; +$('d_sidebar_wrapper_recent_games').show(); +} +else { +$('d_sidebar_wrapper_recent_games').hide(); +} +} +function check_privilege(key) { +if (!session.user) return false; +if (session.user.Privileges.admin == 1) return true; +if (!key.toString().match(/^\//)) key = '/' + key; +var value = lookup_path(key, session.user.Privileges); +return( value && (value != 0) ); +} +function is_admin() { +return check_privilege('admin'); +} +function upgrade_flash_error() { +return alert("Sorry, file upload requires Adobe Flash Player 9 or higher."); +} +function cancel_user_image_manager() { +upload_destroy(); +hide_popup_dialog(); +delete session.hooks.keys[DELETE_KEY]; +} +function do_user_image_manager(callback) { +if (callback) session.uim_callback = callback; +else session.uim_callback = null; +session.temp_last_user_img = null; +session.temp_last_user_image_filename = ''; +var html = '
'; +html += '
Image Manager
'; +html += '
'; +html += ''; +html += '
'; +html += '
'; +html += ''; +html += ''; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', 'cancel_user_image_manager()') + ' ' + large_icon_button('bullet_upload.png', 'Upload Files...', 'upload_basic()', 'b_upload_user_image') + ' ' + large_icon_button('check', 'Choose', 'do_choose_user_image()', 'btn_choose_user_image', '', 'disabled') + '
'; +html += '
'; +session.hooks.keys[ENTER_KEY] = 'do_choose_user_image'; +session.hooks.keys[ESC_KEY] = 'cancel_user_image_manager'; +session.hooks.keys[DELETE_KEY] = 'do_delete_selected_user_image'; +show_popup_dialog(500, 300, html); +var self = this; +setTimeout( function() { +prep_upload('b_upload_user_image', '/effect/api/upload_user_image', [self, 'do_upload_user_image_2'], ['Image Files', '*.jpg;*.jpe;*.jpeg;*.gif;*.png']); +}, 1 ); +var args = { +limit: 50, +offset: 0, +random: Math.random() +}; +effect_api_get( 'user_images_get', args, 'uim_populate_images', { } ); +} +function do_upload_user_image_2() { +effect_api_mod_touch('user_images_get'); +effect_api_send('user_get', { +Username: session.username +}, [this, 'do_upload_user_image_3']); +} +function do_upload_user_image_3(response) { +if (response.User.LastUploadError) return do_error( "Failed to upload image: " + response.User.LastUploadError ); +do_user_image_manager( session.uim_callback ); +} +function uim_populate_images(response, tx) { +var html = ''; +var base_url = '/effect/api/view/users/' + session.username + '/images'; +if (response.Rows && response.Rows.Row) { +var imgs = always_array( response.Rows.Row ); +for (var idx = 0, len = imgs.length; idx < len; idx++) { +var img = imgs[idx]; +var class_name = ((img.Filename == session.temp_last_user_image_filename) ? 'choose_item_selected' : 'choose_item'); +html += ''; +} +} +else { +html = ''; +} +$('d_user_image_list').innerHTML = html; +} +function do_select_user_image(img, filename) { +if (session.temp_last_user_img) session.temp_last_user_img.className = 'choose_item'; +img.className = 'choose_item_selected'; +$('btn_choose_user_image').removeClass('disabled'); +session.temp_last_user_img = img; +session.temp_last_user_image_filename = filename; +} +function do_delete_selected_user_image() { +if (session.temp_last_user_image_filename) { +effect_api_send('user_image_delete', { Filename: session.temp_last_user_image_filename }, 'do_delete_selected_user_image_finish', {}); +} +} +function do_delete_selected_user_image_finish(response, tx) { +try { $('d_user_image_list').removeChild( session.temp_last_user_img ); } catch(e) {;} +session.temp_last_user_img = null; +session.temp_last_user_image_filename = null; +} +function do_choose_user_image() { +if (!session.temp_last_user_image_filename) return; +if (session.uim_callback) { +fire_callback( session.uim_callback, session.temp_last_user_image_filename ); +} +cancel_user_image_manager(); +} +function user_image_thumbnail(filename, width, height, attribs) { +var username = session.username; +if (filename.match(/^(\w+)\/(.+)$/)) { +username = RegExp.$1; +filename = RegExp.$2; +} +var url = '/effect/api/view/users/' + username + '/images/' + filename.replace(/\.(\w+)$/, '_thumb.jpg'); +return ''; +} +function get_user_display(username, full_name, base_url) { +if (!base_url) base_url = ''; +return icon('user', full_name || username, base_url + '#User/' + username); +} +function get_game_tab_bar(game_id, cur_page_name) { +return tab_bar([ +['#Game/' + game_id, 'Game', 'controller.png'], +['#GameDisplay/' + game_id, 'Display', 'monitor.png'], +['#GameAssets/' + game_id, 'Assets', 'folder_page_white.png'], +['#GameObjects/' + game_id, 'Objects', 'bricks.png'], +['#GameAudio/' + game_id, 'Audio', 'sound.gif'], +['#GameKeys/' + game_id, 'Keyboard', 'keyboard.png'], +['#GameLevels/' + game_id, 'Levels', 'world.png'], +['#GamePublisher/' + game_id, 'Publish', 'cd.png'] +], cur_page_name); +} +function get_user_tab_bar(cur_page_name) { +var tabs = [ +['#Home', 'My Home', 'house.png'] +]; +tabs.push( ['#MyAccount', 'Edit Account', 'user_edit.png'] ); +tabs.push( ['#ArticleEdit', 'Post Article', 'page_white_edit.png'] ); +if (config.ProEnabled) { +tabs.push( ['#UserPayments', 'Payments', 'money.png'] ); +} +tabs.push( ['#UserLog', 'Security Log', 'application_view_detail.png'] ); +return tab_bar(tabs, cur_page_name); +} +function get_admin_tab_bar(cur_page_name) { +var tabs = []; +tabs.push( ['#Admin', 'Admin', 'lock.png'] ); +tabs.push( ['#TicketSearch/bugs', 'Bug Tracker', 'bug.png'] ); +tabs.push( ['#TicketSearch/helpdesk', 'Help Desk', 'telephone.png'] ); +tabs.push( ['#AdminReport', 'Reports', 'chart_pie.png'] ); +return tab_bar(tabs, cur_page_name); +} +function get_string(path, args) { +assert(window.config, "get_string() called before config loaded"); +if (!args) args = {}; +args.config = config; +args.session = session; +args.query = session.query; +var value = lookup_path(path, config.Strings); +return (typeof(value) == 'string') ? substitute(value, args) : value; +} +function normalize_dir_path(path) { +if (!path.match(/^\//)) path = '/' + path; +if (!path.match(/\/$/)) path += '/'; +return path; +} +function textedit_window_save(storage_key, filename, content, callback) { +if (!callback) callback = null; +effect_api_mod_touch('textedit'); +if (storage_key.match(/^\/games\/([a-z0-9][a-z0-9\-]*[a-z0-9])\/assets(.+)$/)) { +var game_id = RegExp.$1; +var path = RegExp.$2; +show_progress_dialog(1, "Saving file..."); +effect_api_send('asset_save_file_contents', { +GameID: game_id, +Path: path, +Filename: filename, +Content: content +}, 'textedit_window_save_finish', { _mode: 'asset', _game_id: game_id, _filename: filename, _callback: callback } ); +} +else { +show_progress_dialog(1, "Saving data..."); +effect_api_send('admin_save_file_contents', { +Path: storage_key, +Filename: filename, +Content: content +}, 'textedit_window_save_finish', { _mode: 'admin', _storage_key: storage_key, _filename: filename, _callback: callback } ); +} +} +function textedit_window_save_finish(response, tx) { +hide_progress_dialog(); +if (tx._mode == 'asset') { +do_message('success', "Saved asset: \""+tx._filename+"\""); +show_glog_widget(); +} +else { +do_message('success', "Saved data: \""+tx._storage_key+'/'+tx._filename+"\""); +} +if (tx._callback) tx._callback(); +} +function do_buy(args) { +$P().hide(); +$('d_page_loading').show(); +effect_api_send('create_order', args, 'do_buy_redirect', { _buy_args: args } ); +} +function do_buy_redirect(response, tx) { +var args = tx._buy_args; +$('fe_gco_title').value = args.Title || ''; +$('fe_gco_desc').value = args.Desc || ''; +$('fe_gco_price').value = args.Price || ''; +$('fe_gco_after').value = args.After || ''; +$('fe_gco_unique_id').value = response.OrderID; +Debug.trace('payment', "Redirecting to Google Checkout"); +setTimeout( function() { $('BB_BuyButtonForm').submit(); }, 1 ); +} +function show_glog_widget(game_id) { +if (!game_id) game_id = session.glog_game_id; +if (!game_id) { +$('glog_widget').hide(); +return; +} +if (game_id != session.glog_game_id) { +$('glog_widget').hide(); +session.glog_game_id = game_id; +update_glog_widget(game_id); +} +else { +$('glog_widget').show(); +setTimeout( function() { update_glog_widget(game_id); }, 500 ); +} +} +function update_glog_widget(game_id) { +effect_api_get('game_get_log', { +id: game_id, +offset: 0, +limit: 1, +rand: Math.random() +}, 'receive_glog_data', { _game_id: game_id }); +} +function receive_glog_data(response, tx) { +var game_id = tx._game_id; +if (response && response.Rows && response.Rows.Row) { +var rows = always_array( response.Rows.Row ); +var row = rows[0]; +var html = ''; +html += '
'; +html += '
Latest Game Activity
'; +html += ''; +html += ''; +html += '
'; +html += '
'; +html += ''; +html += ''; +html += ''; +html += '
' + get_buddy_icon_display(row.Username, 1, 0) + ''; +html += '
' + icon( get_icon_for_glog_type(row.Type), ''+row.Message+'' ) + '
'; +html += '
' + get_relative_date(row.Date, true) + '
'; +html += '
'; +$('glog_widget').innerHTML = html; +$('glog_widget').show(); +} +} +function show_glog_post_dialog(game_id) { +hide_popup_dialog(); +delete session.progress; +var html = ''; +html += '
'; +html += '"; + second_cell = ""; + row = $("").attr("id", "s" + index).attr("class", "location_row").html(first_cell + second_cell); + $locationsDiv.append(row); + } + if (index === this.numSearchToDisplay) { + $locationsDiv.append(""); + return $locationsDiv.append(""); + } + }, this); + return this.geocoder.geocode({ + address: address + }, __bind(function(result, status) { + if (status !== "OK") { + $('.error_message').html(t("Search Address Failed")).fadeIn(); + return; + } + _.each(result, showResults); + $("#search_results").html($locationsDiv); + this.locationChange("search"); + this.searchResults = result; + return this.displaySearchLoc(); + }, this)); + }; + ClientsRequestView.prototype.mouseoverLocation = function(e) { + var $el, id, marker; + $el = $(e.currentTarget); + id = $el.attr("id").substring(1); + marker = this.markers[id]; + return marker.setAnimation(google.maps.Animation.BOUNCE); + }; + ClientsRequestView.prototype.mouseoutLocation = function(e) { + var $el, id, marker; + $el = $(e.currentTarget); + id = $el.attr("id").substring(1); + marker = this.markers[id]; + return marker.setAnimation(null); + }; + ClientsRequestView.prototype.searchLocation = function(e) { + e.preventDefault(); + $("#address").val($(e.currentTarget).html()); + return this.searchAddress(); + }; + ClientsRequestView.prototype.favoriteClick = function(e) { + var index, location; + e.preventDefault(); + $(".favorites").attr("href", ""); + index = $(e.currentTarget).removeAttr("href").attr("id"); + location = new google.maps.LatLng(USER.locations[index].latitude, USER.locations[index].longitude); + return this.panToLocation(location); + }; + ClientsRequestView.prototype.clickLocation = function(e) { + var id; + id = $(e.currentTarget).attr("id").substring(1); + return this.panToLocation(this.markers[id].getPosition()); + }; + ClientsRequestView.prototype.panToLocation = function(location) { + this.map.panTo(location); + this.map.setZoom(16); + return this.pickup_icon.setPosition(location); + }; + ClientsRequestView.prototype.locationLinkHandle = function(e) { + var panelName; + e.preventDefault(); + panelName = $(e.currentTarget).attr("id"); + return this.locationChange(panelName); + }; + ClientsRequestView.prototype.locationChange = function(type) { + $(".locations_link").attr("href", "").css("font-weight", "normal"); + switch (type) { + case "favorite": + $(".search_results").attr("href", ""); + $(".locations_link#favorite").removeAttr("href").css("font-weight", "bold"); + $("#search_results").hide(); + $("#favorite_results").fadeIn(); + return this.displayFavLoc(); + case "search": + $(".favorites").attr("href", ""); + $(".locations_link#search").removeAttr("href").css("font-weight", "bold"); + $("#favorite_results").hide(); + $("#search_results").fadeIn(); + return this.displaySearchLoc(); + } + }; + ClientsRequestView.prototype.rateTrip = function(e) { + var rating; + rating = $(e.currentTarget).attr("id"); + $(".stars").attr("src", "/web/img/star_inactive.png"); + return _(rating).times(function(index) { + return $(".stars#" + (index + 1)).attr("src", "/web/img/star_active.png"); + }); + }; + ClientsRequestView.prototype.pickupHandle = function(e) { + var $el, callback, message; + e.preventDefault(); + $el = $(e.currentTarget).find("span"); + switch ($el.html()) { + case t("Request Pickup"): + _.delay(this.requestRide, 3000); + $("#status_message").html(t("Sending pickup request...")); + $el.html(t("Cancel Pickup")).parent().attr("class", "button_red"); + this.pickup_icon.setDraggable(false); + this.map.panTo(this.pickup_icon.getPosition()); + return this.map.setZoom(18); + case t("Cancel Pickup"): + if (this.status === "ready") { + $el.html(t("Request Pickup")).parent().attr("class", "button_green"); + return this.pickup_icon.setDraggable(true); + } else { + callback = __bind(function(v, m, f) { + if (v) { + this.AskDispatch("PickupCanceledClient"); + return this.setStatus("ready"); + } + }, this); + message = t("Cancel Request Prompt"); + if (this.status === "arriving") { + message = 'Cancel Request Arrived Prompt'; + } + return $.prompt(message, { + buttons: { + Ok: true, + Cancel: false + }, + callback: callback + }); + } + } + }; + ClientsRequestView.prototype.requestRide = function() { + if ($("#pickupHandle").find("span").html() === t("Cancel Pickup")) { + this.AskDispatch("Pickup"); + return this.setStatus("searching"); + } + }; + ClientsRequestView.prototype.removeCabs = function() { + _.each(this.cabs, __bind(function(point) { + return point.setMap(null); + }, this)); + return this.cabs = []; + }; + ClientsRequestView.prototype.addToFavLoc = function(e) { + var $el, lat, lng, nickname; + e.preventDefault(); + $el = $(e.currentTarget); + $el.find(".error_message").html(""); + nickname = $el.find("#favLocNickname").val().toString(); + lat = $el.find("#pickupLat").val().toString(); + lng = $el.find("#pickupLng").val().toString(); + if (nickname.length < 3) { + $el.find(".error_message").html(t("Favorite Location Nickname Length Error")); + return; + } + this.ShowSpinner("submit"); + return $.ajax({ + type: 'POST', + url: API + "/locations", + dataType: 'json', + data: { + token: USER.token, + nickname: nickname, + latitude: lat, + longitude: lng + }, + success: __bind(function(data, textStatus, jqXHR) { + return $el.html(t("Favorite Location Save Succeeded")); + }, this), + error: __bind(function(jqXHR, textStatus, errorThrown) { + return $el.find(".error_message").html(t("Favorite Location Save Failed")); + }, this), + complete: __bind(function(data) { + return this.HideSpinner(); + }, this) + }); + }; + ClientsRequestView.prototype.showFavLoc = function(e) { + $(e.currentTarget).fadeOut(); + return $("#favLoc_form").fadeIn(); + }; + ClientsRequestView.prototype.selectInputText = function(e) { + e.currentTarget.focus(); + return e.currentTarget.select(); + }; + ClientsRequestView.prototype.displayFavLoc = function() { + var alphabet, bounds; + alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + this.removeMarkers(); + bounds = new google.maps.LatLngBounds(); + _.each(USER.locations, __bind(function(location, index) { + var marker; + marker = new google.maps.Marker({ + position: new google.maps.LatLng(location.latitude, location.longitude), + map: this.map, + title: t("Favorite Location Title", { + id: alphabet != null ? alphabet[index] : void 0 + }), + icon: "https://www.google.com/mapfiles/marker" + alphabet[index] + ".png" + }); + this.markers.push(marker); + bounds.extend(marker.getPosition()); + return google.maps.event.addListener(marker, 'click', __bind(function() { + return this.pickup_icon.setPosition(marker.getPosition()); + }, this)); + }, this)); + this.pickup_icon.setPosition(_.first(this.markers).getPosition()); + return this.map.fitBounds(bounds); + }; + ClientsRequestView.prototype.displaySearchLoc = function() { + var alphabet; + alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + this.removeMarkers(); + return _.each(this.searchResults, __bind(function(result, index) { + var marker; + if (index < this.numSearchToDisplay) { + marker = new google.maps.Marker({ + position: result.geometry.location, + map: this.map, + title: t("Search Location Title", { + id: alphabet != null ? alphabet[index] : void 0 + }), + icon: "https://www.google.com/mapfiles/marker" + alphabet[index] + ".png" + }); + this.markers.push(marker); + return this.panToLocation(result.geometry.location); + } + }, this)); + }; + ClientsRequestView.prototype.removeMarkers = function() { + _.each(this.markers, __bind(function(marker) { + return marker.setMap(null); + }, this)); + return this.markers = []; + }; + ClientsRequestView.prototype.AskDispatch = function(ask, options) { + var attrs, lowestETA, processData, showCab; + if (ask == null) { + ask = ""; + } + if (options == null) { + options = {}; + } + switch (ask) { + case "NearestCab": + attrs = { + latitude: this.pickup_icon.getPosition().lat(), + longitude: this.pickup_icon.getPosition().lng() + }; + lowestETA = 99999; + showCab = __bind(function(cab) { + var point; + point = new google.maps.Marker({ + position: new google.maps.LatLng(cab.latitude, cab.longitude), + map: this.map, + icon: this.cabMarker, + title: t("ETA Message", { + minutes: app.helpers.FormatSeconds(cab != null ? cab.eta : void 0, true) + }) + }); + if (cab.eta < lowestETA) { + lowestETA = cab.eta; + } + return this.cabs.push(point); + }, this); + processData = __bind(function(data, textStatus, jqXHR) { + if (this.status === "ready") { + this.removeCabs(); + if (data.sorry) { + $("#status_message").html(data.sorry).fadeIn(); + } else { + _.each(data.driverLocations, showCab); + $("#status_message").html(t("Nearest Cab Message", { + minutes: app.helpers.FormatSeconds(lowestETA, true) + })).fadeIn(); + } + if (Backbone.history.fragment === "!/request") { + return _.delay(this.showCabs, this.pollInterval); + } + } + }, this); + return this.AjaxCall(ask, processData, attrs); + case "StatusClient": + processData = __bind(function(data, textStatus, jqXHR) { + var bounds, cabLocation, locationSaved, point, userLocation; + if (data.messageType === "OK") { + switch (data.status) { + case "completed": + this.removeCabs(); + this.setStatus("rate"); + return this.fetchTripDetails(data.tripID); + case "open": + return this.setStatus("ready"); + case "begintrip": + this.setStatus("riding"); + cabLocation = new google.maps.LatLng(data.latitude, data.longitude); + this.removeCabs(); + this.pickup_icon.setMap(null); + point = new google.maps.Marker({ + position: cabLocation, + map: this.map, + icon: this.cabMarker + }); + this.cabs.push(point); + this.map.panTo(point.getPosition()); + $("#rideName").html(data.driverName); + $("#ridePhone").html(data.driverMobile); + $("#ride_address_wrapper").hide(); + if (Backbone.history.fragment === "!/request") { + return _.delay(this.AskDispatch, this.pollInterval, "StatusClient"); + } + break; + case "pending": + this.setStatus("searching"); + if (Backbone.history.fragment === "!/request") { + return _.delay(this.AskDispatch, this.pollInterval, "StatusClient"); + } + break; + case "accepted": + case "arrived": + if (data.status === "accepted") { + this.setStatus("waiting"); + $("#status_message").html(t("Arrival ETA Message", { + minutes: app.helpers.FormatSeconds(data.eta, true) + })); + } else { + this.setStatus("arriving"); + $("#status_message").html(t("Arriving Now Message")); + } + userLocation = new google.maps.LatLng(data.pickupLocation.latitude, data.pickupLocation.longitude); + cabLocation = new google.maps.LatLng(data.latitude, data.longitude); + this.pickup_icon.setPosition(userLocation); + this.removeCabs(); + $("#rideName").html(data.driverName); + $("#ridePhone").html(data.driverMobile); + if ($("#rideAddress").html() === "") { + locationSaved = false; + _.each(USER.locations, __bind(function(location) { + if (parseFloat(location.latitude) === parseFloat(data.pickupLocation.latitude) && parseFloat(location.longitude) === parseFloat(data.pickupLocation.longitude)) { + return locationSaved = true; + } + }, this)); + if (locationSaved) { + $("#addToFavButton").hide(); + } + $("#pickupLat").val(data.pickupLocation.latitude); + $("#pickupLng").val(data.pickupLocation.longitude); + this.geocoder.geocode({ + location: userLocation + }, __bind(function(result, status) { + $("#rideAddress").html(result[0].formatted_address); + return $("#favLocNickname").val("" + result[0].address_components[0].short_name + " " + result[0].address_components[1].short_name); + }, this)); + } + point = new google.maps.Marker({ + position: cabLocation, + map: this.map, + icon: this.cabMarker + }); + this.cabs.push(point); + bounds = bounds = new google.maps.LatLngBounds(); + bounds.extend(cabLocation); + bounds.extend(userLocation); + this.map.fitBounds(bounds); + if (Backbone.history.fragment === "!/request") { + return _.delay(this.AskDispatch, this.pollInterval, "StatusClient"); + } + } + } + }, this); + return this.AjaxCall(ask, processData); + case "Pickup": + attrs = { + latitude: this.pickup_icon.getPosition().lat(), + longitude: this.pickup_icon.getPosition().lng() + }; + processData = __bind(function(data, textStatus, jqXHR) { + if (data.messageType === "Error") { + return $("#status_message").html(data.description); + } else { + return this.AskDispatch("StatusClient"); + } + }, this); + return this.AjaxCall(ask, processData, attrs); + case "PickupCanceledClient": + processData = __bind(function(data, textStatus, jqXHR) { + if (data.messageType === "OK") { + return this.setStatus("ready"); + } else { + return $("#status_message").html(data.description); + } + }, this); + return this.AjaxCall(ask, processData, attrs); + case "RatingDriver": + attrs = { + rating: options.rating + }; + processData = __bind(function(data, textStatus, jqXHR) { + if (data.messageType === "OK") { + this.setStatus("init"); + } else { + $("status_message").html(t("Rating Driver Failed")); + } + return this.HideSpinner(); + }, this); + return this.AjaxCall(ask, processData, attrs); + case "Feedback": + attrs = { + message: options.message + }; + processData = __bind(function(data, textStatus, jqXHR) { + if (data.messageType === "OK") { + return alert("rated"); + } + }, this); + return this.AjaxCall(ask, processData, attrs); + } + }; + ClientsRequestView.prototype.AjaxCall = function(type, successCallback, attrs) { + if (attrs == null) { + attrs = {}; + } + _.extend(attrs, { + token: USER.token, + messageType: type, + app: "client", + version: "1.0.60", + device: "web" + }); + return $.ajax({ + type: 'POST', + url: DISPATCH + "/", + processData: false, + data: JSON.stringify(attrs), + success: successCallback, + dataType: 'json', + error: __bind(function(jqXHR, textStatus, errorThrown) { + $("#status_message").html(errorThrown); + return this.HideSpinner(); + }, this) + }); + }; + return ClientsRequestView; + })(); +}).call(this); +}, "views/clients/settings": function(exports, require, module) {(function() { + var clientsSettingsTemplate; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }; + clientsSettingsTemplate = require('templates/clients/settings'); + exports.ClientsSettingsView = (function() { + __extends(ClientsSettingsView, UberView); + function ClientsSettingsView() { + this.render = __bind(this.render, this); + this.initialize = __bind(this.initialize, this); + ClientsSettingsView.__super__.constructor.apply(this, arguments); + } + ClientsSettingsView.prototype.id = 'settings_view'; + ClientsSettingsView.prototype.className = 'view_container'; + ClientsSettingsView.prototype.events = { + 'submit #profile_pic_form': 'processPicUpload', + 'click #submit_pic': 'processPicUpload', + 'click a.setting_change': "changeTab", + 'submit #edit_info_form': "submitInfo", + 'click #change_password': 'changePass' + }; + ClientsSettingsView.prototype.divs = { + 'info_div': "Information", + 'pic_div': "Picture" + }; + ClientsSettingsView.prototype.pageTitle = t("Settings") + " | " + t("Uber"); + ClientsSettingsView.prototype.tabTitle = { + 'info_div': t("Information"), + 'pic_div': t("Picture") + }; + ClientsSettingsView.prototype.initialize = function() { + return this.mixin(require('web-lib/mixins/i18n_phone_form').i18nPhoneForm); + }; + ClientsSettingsView.prototype.render = function(type) { + if (type == null) { + type = "info"; + } + this.RefreshUserInfo(__bind(function() { + var $el, alphabet; + this.delegateEvents(); + this.HideSpinner(); + alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + $el = $(this.el); + $(this.el).html(clientsSettingsTemplate({ + type: type + })); + $el.find("#" + type + "_div").show(); + $el.find("a[href='" + type + "_div']").parent().addClass("active"); + return document.title = "" + this.tabTitle[type + '_div'] + " " + this.pageTitle; + }, this)); + this.delegateEvents(); + return this; + }; + ClientsSettingsView.prototype.changeTab = function(e) { + var $eTarget, $el, div, link, pageDiv, _i, _j, _len, _len2, _ref, _ref2; + e.preventDefault(); + $eTarget = $(e.currentTarget); + this.ClearGlobalStatus(); + $el = $(this.el); + _ref = $el.find(".setting_change"); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + link = _ref[_i]; + $(link).parent().removeClass("active"); + } + $eTarget.parent().addClass("active"); + _ref2 = _.keys(this.divs); + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + div = _ref2[_j]; + $el.find("#" + div).hide(); + } + pageDiv = $eTarget.attr('href'); + $el.find("#" + pageDiv).show(); + Backbone.history.navigate("!/settings/" + (this.divs[pageDiv].toLowerCase().replace(" ", "-")), false); + document.title = "" + this.tabTitle[pageDiv] + " " + this.pageTitle; + if (pageDiv === "loc_div") { + try { + google.maps.event.trigger(this.map, 'resize'); + return this.map.fitBounds(this.bounds); + } catch (_e) {} + } + }; + ClientsSettingsView.prototype.submitInfo = function(e) { + var $e, attrs, client, options; + $('#global_status').find('.success_message').text(''); + $('#global_status').find('.error_message').text(''); + $('.error_message').text(''); + e.preventDefault(); + $e = $(e.currentTarget); + attrs = $e.serializeToJson(); + attrs['mobile_country_id'] = this.$('#mobile_country_id').val(); + if (attrs['password'] === '') { + delete attrs['password']; + } + options = { + success: __bind(function(response) { + this.ShowSuccess(t("Information Update Succeeded")); + return this.RefreshUserInfo(); + }, this), + error: __bind(function(model, data) { + var errors; + if (data.status === 406) { + errors = JSON.parse(data.responseText); + return _.each(_.keys(errors), function(field) { + return $("#" + field).parent().find('span.error_message').text(errors[field]); + }); + } else { + return this.ShowError(t("Information Update Failed")); + } + }, this), + type: "PUT" + }; + client = new app.models.client({ + id: USER.id + }); + return client.save(attrs, options); + }; + ClientsSettingsView.prototype.changePass = function(e) { + e.preventDefault(); + $(e.currentTarget).hide(); + return $("#password").show(); + }; + ClientsSettingsView.prototype.processPicUpload = function(e) { + e.preventDefault(); + this.ShowSpinner("submit"); + return $.ajaxFileUpload({ + url: API + '/user_pictures', + secureuri: false, + fileElementId: 'picture', + data: { + token: USER.token + }, + dataType: 'json', + complete: __bind(function(data, status) { + this.HideSpinner(); + if (status === 'success') { + this.ShowSuccess(t("Picture Update Succeeded")); + return this.RefreshUserInfo(__bind(function() { + return $("#settingsProfPic").attr("src", USER.picture_url + ("?" + (Math.floor(Math.random() * 1000)))); + }, this)); + } else { + if (data.error) { + return this.ShowError(data.error); + } else { + return this.ShowError("Picture Update Failed"); + } + } + }, this) + }); + }; + return ClientsSettingsView; + })(); +}).call(this); +}, "views/clients/sign_up": function(exports, require, module) {(function() { + var clientsSignUpTemplate; + var __hasProp = Object.prototype.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; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + clientsSignUpTemplate = require('templates/clients/sign_up'); + exports.ClientsSignUpView = (function() { + __extends(ClientsSignUpView, UberView); + function ClientsSignUpView() { + ClientsSignUpView.__super__.constructor.apply(this, arguments); + } + ClientsSignUpView.prototype.id = 'signup_view'; + ClientsSignUpView.prototype.className = 'view_container'; + ClientsSignUpView.prototype.initialize = function() { + this.mixin(require('web-lib/mixins/i18n_phone_form').i18nPhoneForm); + return $('#location_country').live('change', function() { + if (!$('#mobile').val()) { + return $('#mobile_country').find("option[value=" + ($(this).val()) + "]").attr('selected', 'selected').end().trigger('change'); + } + }); + }; + ClientsSignUpView.prototype.events = { + 'submit form': 'signup', + 'click button': 'signup', + 'change #card_number': 'showCardType', + 'change #location_country': 'countryChange' + }; + ClientsSignUpView.prototype.render = function(invite) { + this.HideSpinner(); + $(this.el).html(clientsSignUpTemplate({ + invite: invite + })); + return this; + }; + ClientsSignUpView.prototype.signup = function(e) { + var $el, attrs, client, error_messages, options; + e.preventDefault(); + $el = $("form"); + $el.find('#terms_error').hide(); + if (!$el.find('#signup_terms input[type=checkbox]').attr('checked')) { + $('#spinner.submit').hide(); + $el.find('#terms_error').show(); + return; + } + error_messages = $el.find('.error_message').html(""); + attrs = { + first_name: $el.find('#first_name').val(), + last_name: $el.find('#last_name').val(), + email: $el.find('#email').val(), + password: $el.find('#password').val(), + location_country: $el.find('#location_country option:selected').attr('data-iso2'), + location: $el.find('#location').val(), + language: $el.find('#language').val(), + mobile_country: $el.find('#mobile_country option:selected').attr('data-iso2'), + mobile: $el.find('#mobile').val(), + card_number: $el.find('#card_number').val(), + card_expiration_month: $el.find('#card_expiration_month').val(), + card_expiration_year: $el.find('#card_expiration_year').val(), + card_code: $el.find('#card_code').val(), + use_case: $el.find('#use_case').val(), + promotion_code: $el.find('#promotion_code').val() + }; + options = { + statusCode: { + 200: function(response) { + $.cookie('token', response.token); + amplify.store('USERjson', response); + app.refreshMenu(); + return app.routers.clients.navigate('!/dashboard', true); + }, + 406: function(e) { + var error, errors, _i, _len, _ref, _results; + errors = JSON.parse(e.responseText); + _ref = _.keys(errors); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + error = _ref[_i]; + _results.push($('#' + error).parent().find('span').html($('#' + error).parent().find('span').html() + " " + errors[error])); + } + return _results; + } + }, + complete: __bind(function(response) { + return this.HideSpinner(); + }, this) + }; + client = new app.models.client; + $('.spinner#submit').show(); + return client.save(attrs, options); + }; + ClientsSignUpView.prototype.countryChange = function(e) { + var $e; + $e = $(e.currentTarget); + return $("#mobile_country").val($e.val()).trigger('change'); + }; + ClientsSignUpView.prototype.showCardType = function(e) { + var $el, reAmerica, reDiscover, reMaster, reVisa, validCard; + reVisa = /^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/; + reMaster = /^5[1-5]\d{2}-?\d{4}-?\d{4}-?\d{4}$/; + reAmerica = /^6011-?\d{4}-?\d{4}-?\d{4}$/; + reDiscover = /^3[4,7]\d{13}$/; + $el = $("#card_logos_signup"); + validCard = false; + if (e.currentTarget.value.match(reVisa)) { + $el.find("#overlay_left").css('width', "0px"); + return $el.find("#overlay_right").css('width', "75%"); + } else if (e.currentTarget.value.match(reMaster)) { + $el.find("#overlay_left").css('width', "25%"); + return $el.find("#overlay_right").css('width', "50%"); + } else if (e.currentTarget.value.match(reAmerica)) { + $el.find("#overlay_left").css('width', "75%"); + $el.find("#overlay_right").css('width', "0px"); + return console.log("amex"); + } else if (e.currentTarget.value.match(reDiscover)) { + $el.find("#overlay_left").css('width', "50%"); + return $el.find("#overlay_right").css('width', "25%"); + } else { + $el.find("#overlay_left").css('width', "0px"); + return $el.find("#overlay_right").css('width', "0px"); + } + }; + return ClientsSignUpView; + })(); +}).call(this); +}, "views/clients/trip_detail": function(exports, require, module) {(function() { + var clientsTripDetailTemplate; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }; + clientsTripDetailTemplate = require('templates/clients/trip_detail'); + exports.TripDetailView = (function() { + __extends(TripDetailView, UberView); + function TripDetailView() { + this.resendReceipt = __bind(this.resendReceipt, this); + TripDetailView.__super__.constructor.apply(this, arguments); + } + TripDetailView.prototype.id = 'trip_detail_view'; + TripDetailView.prototype.className = 'view_container'; + TripDetailView.prototype.events = { + 'click a#fare_review': 'showFareReview', + 'click #fare_review_hide': 'hideFareReview', + 'submit #form_review_form': 'submitFareReview', + 'click #submit_fare_review': 'submitFareReview', + 'click .resendReceipt': 'resendReceipt' + }; + TripDetailView.prototype.render = function(id) { + if (id == null) { + id = 'invalid'; + } + this.ReadUserInfo(); + this.HideSpinner(); + this.model = new app.models.trip({ + id: id + }); + this.model.fetch({ + data: { + relationships: 'points,driver,city.country' + }, + dataType: 'json', + success: __bind(function() { + var trip; + trip = this.model; + $(this.el).html(clientsTripDetailTemplate({ + trip: trip + })); + this.RequireMaps(__bind(function() { + var bounds, endPos, map, myOptions, path, polyline, startPos; + bounds = new google.maps.LatLngBounds(); + path = []; + _.each(this.model.get('points'), __bind(function(point) { + path.push(new google.maps.LatLng(point.lat, point.lng)); + return bounds.extend(_.last(path)); + }, this)); + myOptions = { + zoom: 12, + center: path[0], + mapTypeId: google.maps.MapTypeId.ROADMAP, + zoomControl: false, + rotateControl: false, + panControl: false, + mapTypeControl: false, + scrollwheel: false + }; + map = new google.maps.Map(document.getElementById("trip_details_map"), myOptions); + map.fitBounds(bounds); + startPos = new google.maps.Marker({ + position: _.first(path), + map: map, + title: t("Trip started here"), + icon: 'https://uber-static.s3.amazonaws.com/marker_start.png' + }); + endPos = new google.maps.Marker({ + position: _.last(path), + map: map, + title: t("Trip ended here"), + icon: 'https://uber-static.s3.amazonaws.com/marker_end.png' + }); + startPos.setMap(map); + endPos.setMap(map); + polyline = new google.maps.Polyline({ + path: path, + strokeColor: '#003F87', + strokeOpacity: 1, + strokeWeight: 5 + }); + return polyline.setMap(map); + }, this)); + return this.HideSpinner(); + }, this) + }); + this.ShowSpinner('load'); + this.delegateEvents(); + return this; + }; + TripDetailView.prototype.showFareReview = function(e) { + e.preventDefault(); + $('#fare_review_box').slideDown(); + return $('#fare_review').hide(); + }; + TripDetailView.prototype.hideFareReview = function(e) { + e.preventDefault(); + $('#fare_review_box').slideUp(); + return $('#fare_review').show(); + }; + TripDetailView.prototype.submitFareReview = function(e) { + var attrs, errorMessage, id, options; + e.preventDefault(); + errorMessage = $(".error_message"); + errorMessage.hide(); + id = $("#tripid").val(); + this.model = new app.models.trip({ + id: id + }); + attrs = { + note: $('#form_review_message').val(), + note_type: 'client_fare_review' + }; + options = { + success: __bind(function(response) { + $(".success_message").fadeIn(); + return $("#fare_review_form_wrapper").slideUp(); + }, this), + error: __bind(function(error) { + return errorMessage.fadeIn(); + }, this) + }; + return this.model.save(attrs, options); + }; + TripDetailView.prototype.resendReceipt = function(e) { + var $e; + e.preventDefault(); + $e = $(e.currentTarget); + this.$(".resendReceiptSuccess").empty().show(); + this.$(".resentReceiptError").empty().show(); + e.preventDefault(); + $('#spinner').show(); + return $.ajax('/api/trips/func/resend_receipt', { + data: { + token: $.cookie('token'), + trip_id: this.model.id + }, + type: 'POST', + complete: __bind(function(xhr) { + var response; + response = JSON.parse(xhr.responseText); + $('#spinner').hide(); + switch (xhr.status) { + case 200: + this.$(".resendReceiptSuccess").html("Receipt has been emailed"); + return this.$(".resendReceiptSuccess").fadeOut(2000); + default: + this.$(".resendReceiptError").html("Receipt has failed to be emailed"); + return this.$(".resendReceiptError").fadeOut(2000); + } + }, this) + }); + }; + return TripDetailView; + })(); +}).call(this); +}, "views/shared/menu": function(exports, require, module) {(function() { + var menuTemplate; + var __hasProp = Object.prototype.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; + }; + menuTemplate = require('templates/shared/menu'); + exports.SharedMenuView = (function() { + __extends(SharedMenuView, Backbone.View); + function SharedMenuView() { + SharedMenuView.__super__.constructor.apply(this, arguments); + } + SharedMenuView.prototype.id = 'menu_view'; + SharedMenuView.prototype.render = function() { + var type; + if ($.cookie('token') === null) { + type = 'guest'; + } else { + type = 'client'; + } + $(this.el).html(menuTemplate({ + type: type + })); + return this; + }; + return SharedMenuView; + })(); +}).call(this); +}, "web-lib/collections/countries": function(exports, require, module) {(function() { + var UberCollection; + var __hasProp = Object.prototype.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; + }; + UberCollection = require('web-lib/uber_collection').UberCollection; + exports.CountriesCollection = (function() { + __extends(CountriesCollection, UberCollection); + function CountriesCollection() { + CountriesCollection.__super__.constructor.apply(this, arguments); + } + CountriesCollection.prototype.model = app.models.country; + CountriesCollection.prototype.url = '/countries'; + return CountriesCollection; + })(); +}).call(this); +}, "web-lib/collections/vehicle_types": function(exports, require, module) {(function() { + var UberCollection, vehicleType, _ref; + var __hasProp = Object.prototype.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; + }; + UberCollection = require('web-lib/uber_collection').UberCollection; + vehicleType = (typeof app !== "undefined" && app !== null ? (_ref = app.models) != null ? _ref.vehicleType : void 0 : void 0) || require('models/vehicle_type').VehicleType; + exports.VehicleTypesCollection = (function() { + __extends(VehicleTypesCollection, UberCollection); + function VehicleTypesCollection() { + VehicleTypesCollection.__super__.constructor.apply(this, arguments); + } + VehicleTypesCollection.prototype.model = vehicleType; + VehicleTypesCollection.prototype.url = '/vehicle_types'; + VehicleTypesCollection.prototype.defaultColumns = ['id', 'created_at', 'updated_at', 'deleted_at', 'created_by_user_id', 'updated_by_user_id', 'city_id', 'type', 'make', 'model', 'capacity', 'minimum_year', 'actions']; + VehicleTypesCollection.prototype.tableColumns = function(cols) { + var actions, c, capacity, city_id, columnValues, created_at, created_by_user_id, deleted_at, headerRow, id, make, minimum_year, model, type, updated_at, updated_by_user_id, _i, _len; + id = { + sTitle: 'Id' + }; + created_at = { + sTitle: 'Created At (UTC)', + 'sType': 'string' + }; + updated_at = { + sTitle: 'Updated At (UTC)', + 'sType': 'string' + }; + deleted_at = { + sTitle: 'Deleted At (UTC)', + 'sType': 'string' + }; + created_by_user_id = { + sTitle: 'Created By' + }; + updated_by_user_id = { + sTitle: 'Updated By' + }; + city_id = { + sTitle: 'City' + }; + type = { + sTitle: 'Type' + }; + make = { + sTitle: 'Make' + }; + model = { + sTitle: 'Model' + }; + capacity = { + sTitle: 'Capacity' + }; + minimum_year = { + sTitle: 'Min. Year' + }; + actions = { + sTitle: 'Actions' + }; + columnValues = { + id: id, + created_at: created_at, + updated_at: updated_at, + deleted_at: deleted_at, + created_by_user_id: created_by_user_id, + updated_by_user_id: updated_by_user_id, + city_id: city_id, + type: type, + make: make, + model: model, + capacity: capacity, + minimum_year: minimum_year, + actions: actions + }; + headerRow = []; + for (_i = 0, _len = cols.length; _i < _len; _i++) { + c = cols[_i]; + if (columnValues[c]) { + headerRow.push(columnValues[c]); + } + } + return headerRow; + }; + return VehicleTypesCollection; + })(); +}).call(this); +}, "web-lib/helpers": function(exports, require, module) {(function() { + var __indexOf = Array.prototype.indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) { + if (this[i] === item) return i; + } + return -1; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + exports.helpers = { + pin: function(num, color) { + if (color == null) { + color = 'FF0000'; + } + return ""; + }, + reverseGeocode: function(latitude, longitude) { + if (latitude && longitude) { + return "" + latitude + ", " + longitude + ""; + } else { + return ''; + } + }, + linkedName: function(model) { + var first_name, id, last_name, role, url; + role = model.role || model.get('role'); + id = model.id || model.get('id'); + first_name = model.first_name || model.get('first_name'); + last_name = model.last_name || model.get('last_name'); + url = "/" + role + "s/" + id; + return "" + first_name + " " + last_name + ""; + }, + linkedVehicle: function(vehicle, vehicleType) { + return " " + (vehicleType != null ? vehicleType.get('make') : void 0) + " " + (vehicleType != null ? vehicleType.get('model') : void 0) + " " + (vehicle.get('year')) + " "; + }, + linkedUserId: function(userType, userId) { + return "" + userType + " " + userId + ""; + }, + timeDelta: function(start, end) { + var delta; + if (typeof start === 'string') { + start = this.parseDate(start); + } + if (typeof end === 'string') { + end = this.parseDate(end); + } + if (end && start) { + delta = end.getTime() - start.getTime(); + return this.formatSeconds(delta / 1000); + } else { + return '00:00'; + } + }, + formatSeconds: function(s) { + var minutes, seconds; + s = Math.floor(s); + minutes = Math.floor(s / 60); + seconds = s - minutes * 60; + return "" + (this.leadingZero(minutes)) + ":" + (this.leadingZero(seconds)); + }, + formatCurrency: function(strValue, reverseSign, currency) { + var currency_locale, lc, mf; + if (reverseSign == null) { + reverseSign = false; + } + if (currency == null) { + currency = null; + } + strValue = String(strValue); + if (reverseSign) { + strValue = ~strValue.indexOf('-') ? strValue.split('-').join('') : ['-', strValue].join(''); + } + currency_locale = i18n.currencyToLocale[currency]; + try { + if (!(currency_locale != null) || currency_locale === i18n.locale) { + return i18n.jsworld.mf.format(strValue); + } else { + lc = new jsworld.Locale(POSIX_LC[currency_locale]); + mf = new jsworld.MonetaryFormatter(lc); + return mf.format(strValue); + } + } catch (error) { + i18n.log(error); + return strValue; + } + }, + formatTripFare: function(trip, type) { + var _ref, _ref2; + if (type == null) { + type = "fare"; + } + if (!trip.get('fare')) { + return 'n/a'; + } + if (((_ref = trip.get('fare_breakdown_local')) != null ? _ref.currency : void 0) != null) { + return app.helpers.formatCurrency(trip.get("" + type + "_local"), false, (_ref2 = trip.get('fare_breakdown_local')) != null ? _ref2.currency : void 0); + } else if (trip.get("" + type + "_string") != null) { + return trip.get("" + type + "_string"); + } else if (trip.get("" + type + "_local") != null) { + return trip.get("" + type + "_local"); + } else { + return 'n/a'; + } + }, + formatPhoneNumber: function(phoneNumber, countryCode) { + if (countryCode == null) { + countryCode = "+1"; + } + if (phoneNumber != null) { + phoneNumber = String(phoneNumber); + switch (countryCode) { + case '+1': + return countryCode + ' ' + phoneNumber.substring(0, 3) + '-' + phoneNumber.substring(3, 6) + '-' + phoneNumber.substring(6, 10); + case '+33': + return countryCode + ' ' + phoneNumber.substring(0, 1) + ' ' + phoneNumber.substring(1, 3) + ' ' + phoneNumber.substring(3, 5) + ' ' + phoneNumber.substring(5, 7) + ' ' + phoneNumber.substring(7, 9); + default: + countryCode + phoneNumber; + } + } + return "" + countryCode + " " + phoneNumber; + }, + parseDate: function(d, cityTime, tz) { + var city_filter, parsed, _ref; + if (cityTime == null) { + cityTime = true; + } + if (tz == null) { + tz = null; + } + if (((_ref = !d.substr(-6, 1)) === '+' || _ref === '-') || d.length === 19) { + d += '+00:00'; + } + if (/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.test(d)) { + parsed = d.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})/); + d = new Date(); + d.setUTCFullYear(parsed[1]); + d.setUTCMonth(parsed[2] - 1); + d.setUTCDate(parsed[3]); + d.setUTCHours(parsed[4]); + d.setUTCMinutes(parsed[5]); + d.setUTCSeconds(parsed[6]); + } else { + d = Date.parse(d); + } + if (typeof d === 'number') { + d = new Date(d); + } + d = new timezoneJS.Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), 'Etc/UTC'); + if (tz) { + d.convertToTimezone(tz); + } else if (cityTime) { + city_filter = $.cookie('city_filter'); + if (city_filter) { + tz = $("#city_filter option[value=" + city_filter + "]").attr('data-timezone'); + if (tz) { + d.convertToTimezone(tz); + } + } + } + return d; + }, + dateToTimezone: function(d) { + var city_filter, tz; + d = new timezoneJS.Date(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate(), d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(), 'Etc/UTC'); + city_filter = $.cookie('city_filter'); + if (city_filter) { + tz = $("#city_filter option[value=" + city_filter + "]").attr('data-timezone'); + d.convertToTimezone(tz); + } + return d; + }, + fixAMPM: function(d, formatted) { + if (d.hours >= 12) { + return formatted.replace(/\b[AP]M\b/, 'PM'); + } else { + return formatted.replace(/\b[AP]M\b/, 'AM'); + } + }, + formatDate: function(d, time, timezone) { + var formatted; + if (time == null) { + time = true; + } + if (timezone == null) { + timezone = null; + } + d = this.parseDate(d, true, timezone); + formatted = time ? ("" + (i18n.jsworld.dtf.formatDate(d)) + " ") + this.formatTime(d, d.getTimezoneInfo()) : i18n.jsworld.dtf.formatDate(d); + return this.fixAMPM(d, formatted); + }, + formatDateLong: function(d, time, timezone) { + if (time == null) { + time = true; + } + if (timezone == null) { + timezone = null; + } + d = this.parseDate(d, true, timezone); + timezone = d.getTimezoneInfo().tzAbbr; + if (time) { + return (i18n.jsworld.dtf.formatDateTime(d)) + (" " + timezone); + } else { + return i18n.jsworld.dtf.formatDate(d); + } + }, + formatTimezoneJSDate: function(d) { + var day, hours, jsDate, minutes, month, year; + year = d.getFullYear(); + month = this.leadingZero(d.getMonth()); + day = this.leadingZero(d.getDate()); + hours = this.leadingZero(d.getHours()); + minutes = this.leadingZero(d.getMinutes()); + jsDate = new Date(year, month, day, hours, minutes, 0); + return jsDate.toDateString(); + }, + formatTime: function(d, timezone) { + var formatted; + if (timezone == null) { + timezone = null; + } + formatted = ("" + (i18n.jsworld.dtf.formatTime(d))) + (timezone != null ? " " + (timezone != null ? timezone.tzAbbr : void 0) : ""); + return this.fixAMPM(d, formatted); + }, + formatISODate: function(d) { + var pad; + pad = function(n) { + if (n < 10) { + return '0' + n; + } + return n; + }; + return d.getUTCFullYear() + '-' + pad(d.getUTCMonth() + 1) + '-' + pad(d.getUTCDate()) + 'T' + pad(d.getUTCHours()) + ':' + pad(d.getUTCMinutes()) + ':' + pad(d.getUTCSeconds()) + 'Z'; + }, + formatExpDate: function(d) { + var month, year; + d = this.parseDate(d); + year = d.getFullYear(); + month = this.leadingZero(d.getMonth() + 1); + return "" + year + "-" + month; + }, + formatLatLng: function(lat, lng, precision) { + if (precision == null) { + precision = 8; + } + return parseFloat(lat).toFixed(precision) + ',' + parseFloat(lng).toFixed(precision); + }, + leadingZero: function(num) { + if (num < 10) { + return "0" + num; + } else { + return num; + } + }, + roundNumber: function(num, dec) { + return Math.round(num * Math.pow(10, dec)) / Math.pow(10, dec); + }, + notesToHTML: function(notes) { + var i, note, notesHTML, _i, _len; + notesHTML = ''; + i = 1; + if (notes) { + for (_i = 0, _len = notes.length; _i < _len; _i++) { + note = notes[_i]; + notesHTML += "" + note['userid'] + "     " + (this.formatDate(note['created_at'])) + "

" + note['note'] + "

"; + notesHTML += "
"; + } + } + return notesHTML.replace("'", '"e'); + }, + formatPhone: function(n) { + var parts, phone, regexObj; + n = "" + n; + regexObj = /^(?:\+?1[-. ]?)?(?:\(?([0-9]{3})\)?[-. ]?)?([0-9]{3})[-. ]?([0-9]{4})$/; + if (regexObj.test(n)) { + parts = n.match(regexObj); + phone = ""; + if (parts[1]) { + phone += "(" + parts[1] + ") "; + } + phone += "" + parts[2] + "-" + parts[3]; + } else { + phone = n; + } + return phone; + }, + usStates: ['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana', 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire', 'New Jersey', 'New Mexico', 'New York', 'North Carolina', 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania', 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington', 'West Virginia', 'Wisconsin', 'Wyoming'], + onboardingPages: ['applied', 'ready_to_interview', 'pending_interview', 'interviewed', 'accepted', 'ready_to_onboard', 'pending_onboarding', 'active', 'waitlisted', 'rejected'], + driverBreadCrumb: function(loc, model) { + var onboardingPage, out, _i, _len, _ref; + out = "Drivers > "; + if (!(model != null)) { + out += ""; + } else { + out += "" + (this.onboardingUrlToName(model.get('driver_status'))) + ""; + out += " > " + (this.linkedName(model)) + " (" + (model.get('role')) + ") #" + (model.get('id')); + } + return out; + }, + onboardingUrlToName: function(url) { + return url != null ? url.replace(/_/g, " ").replace(/(^|\s)([a-z])/g, function(m, p1, p2) { + return p1 + p2.toUpperCase(); + }) : void 0; + }, + formatVehicle: function(vehicle) { + if (vehicle.get('make') && vehicle.get('model') && vehicle.get('license_plate')) { + return "" + (vehicle.get('make')) + " " + (vehicle.get('model')) + " (" + (vehicle.get('license_plate')) + ")"; + } + }, + docArbitraryFields: function(docName, cityDocs) { + var doc, field, out, _i, _j, _len, _len2, _ref; + out = ""; + for (_i = 0, _len = cityDocs.length; _i < _len; _i++) { + doc = cityDocs[_i]; + if (doc.name === docName && __indexOf.call(_.keys(doc), "metaFields") >= 0) { + _ref = doc.metaFields; + for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) { + field = _ref[_j]; + out += "" + field.label + ":
"; + } + } + } + return out; + }, + capitaliseFirstLetter: function(string) { + return string.charAt(0).toUpperCase() + string.slice(1); + }, + createDocUploadForm: function(docName, driverId, vehicleId, cityMeta, vehicleName, expirationRequired) { + var ddocs, expDropdowns, pdocs, vdocs; + if (driverId == null) { + driverId = "None"; + } + if (vehicleId == null) { + vehicleId = "None"; + } + if (cityMeta == null) { + cityMeta = []; + } + if (vehicleName == null) { + vehicleName = false; + } + if (expirationRequired == null) { + expirationRequired = false; + } + ddocs = cityMeta["driverRequiredDocs"] || []; + pdocs = cityMeta["partnerRequiredDocs"] || []; + vdocs = cityMeta["vehicleRequiredDocs"] || []; + expDropdowns = "Expiration Date:\n -\n"; + return " \n
\n \n \n \n\n
\n " + (vehicleName ? vehicleName : "") + " " + docName + "\n
\n\n
\n \n
\n\n
\n " + (expirationRequired ? expDropdowns : "") + "\n
\n\n
\n " + (app.helpers.docArbitraryFields(docName, _.union(ddocs, pdocs, vdocs))) + "\n
\n\n
\n \n
\n\n
\n"; + }, + countrySelector: function(name, options) { + var countries, countryCodePrefix, defaultOptions; + if (options == null) { + options = {}; + } + defaultOptions = { + selectedKey: 'telephone_code', + selectedValue: '+1', + silent: false + }; + _.extend(defaultOptions, options); + options = defaultOptions; + countries = new app.collections.countries(); + countries.fetch({ + data: { + limit: 300 + }, + success: function(countries) { + var $option, $select, country, selected, _i, _len, _ref; + selected = false; + _ref = countries.models || []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + country = _ref[_i]; + $select = $("select[name=" + name + "]"); + $option = $('').val(country.id).attr('data-iso2', country.get('iso2')).attr('data-prefix', country.get('telephone_code')).html(country.get('name')); + if (country.get(options.selectedKey) === options.selectedValue && !selected) { + selected = true; + $option.attr('selected', 'selected'); + } + $select.append($option); + } + if (selected && !options.silent) { + return $select.val(options.selected).trigger('change'); + } + } + }); + countryCodePrefix = options.countryCodePrefix ? "data-country-code-prefix='" + options.countryCodePrefix + "'" : ''; + return ""; + }, + missingDocsOnDriver: function(driver) { + var city, docsReq, documents, partnerDocs; + city = driver.get('city'); + documents = driver.get('documents'); + if ((city != null) && (documents != null)) { + docsReq = _.pluck(city != null ? city.get('meta')["driverRequiredDocs"] : void 0, "name"); + if (driver.get('role') === "partner") { + partnerDocs = _.pluck(city != null ? city.get('meta')["partnerRequiredDocs"] : void 0, "name"); + docsReq = _.union(docsReq, partnerDocs); + } + return _.reject(docsReq, __bind(function(doc) { + return __indexOf.call((documents != null ? documents.pluck("name") : void 0) || [], doc) >= 0; + }, this)); + } else { + return []; + } + } + }; +}).call(this); +}, "web-lib/i18n": function(exports, require, module) {(function() { + exports.i18n = { + defaultLocale: 'en_US', + cookieName: '_LOCALE_', + locales: { + 'en_US': "English (US)", + 'fr_FR': "Français" + }, + currencyToLocale: { + 'USD': 'en_US', + 'EUR': 'fr_FR' + }, + logglyKey: 'd2d5a9bc-7ebe-4538-a180-81e62c705b1b', + logglyHost: 'https://logs.loggly.com', + init: function() { + this.castor = new window.loggly({ + url: this.logglyHost + '/inputs/' + this.logglyKey + '?rt=1', + level: 'error' + }); + this.setLocale($.cookie(this.cookieName) || this.defaultLocale); + window.t = _.bind(this.t, this); + this.loadLocaleTranslations(this.locale); + if (!(this[this.defaultLocale] != null)) { + return this.loadLocaleTranslations(this.defaultLocale); + } + }, + loadLocaleTranslations: function(locale) { + var loadPaths, path, _i, _len, _results; + loadPaths = ['web-lib/translations/' + locale, 'web-lib/translations/' + locale.slice(0, 2), 'translations/' + locale, 'translations/' + locale.slice(0, 2)]; + _results = []; + for (_i = 0, _len = loadPaths.length; _i < _len; _i++) { + path = loadPaths[_i]; + locale = path.substring(path.lastIndexOf('/') + 1); + if (this[locale] == null) { + this[locale] = {}; + } + _results.push((function() { + try { + return _.extend(this[locale], require(path).translations); + } catch (error) { + + } + }).call(this)); + } + return _results; + }, + getLocale: function() { + return this.locale; + }, + setLocale: function(locale) { + var message, parts, _ref; + parts = locale.split('_'); + this.locale = parts[0].toLowerCase(); + if (parts.length > 1) { + this.locale += "_" + (parts[1].toUpperCase()); + } + if (this.locale) { + $.cookie(this.cookieName, this.locale, { + path: '/', + domain: '.uber.com' + }); + } + try { + ((_ref = this.jsworld) != null ? _ref : this.jsworld = {}).lc = new jsworld.Locale(POSIX_LC[this.locale]); + this.jsworld.mf = new jsworld.MonetaryFormatter(this.jsworld.lc); + this.jsworld.nf = new jsworld.NumericFormatter(this.jsworld.lc); + this.jsworld.dtf = new jsworld.DateTimeFormatter(this.jsworld.lc); + this.jsworld.np = new jsworld.NumericParser(this.jsworld.lc); + this.jsworld.mp = new jsworld.MonetaryParser(this.jsworld.lc); + return this.jsworld.dtp = new jsworld.DateTimeParser(this.jsworld.lc); + } catch (error) { + message = 'JsWorld error with locale: ' + this.locale; + return this.log({ + message: message, + error: error + }); + } + }, + getTemplate: function(id) { + var _ref, _ref2; + return ((_ref = this[this.locale]) != null ? _ref[id] : void 0) || ((_ref2 = this[this.locale.slice(0, 2)]) != null ? _ref2[id] : void 0); + }, + getTemplateDefault: function(id) { + var _ref, _ref2; + return ((_ref = this[this.defaultLocale]) != null ? _ref[id] : void 0) || ((_ref2 = this[this.defaultLocale.slice(0, 2)]) != null ? _ref2[id] : void 0); + }, + getTemplateOrDefault: function(id) { + return this.getTemplate(id) || this.getTemplateDefault(id); + }, + t: function(id, vars) { + var errStr, locale, template; + if (vars == null) { + vars = {}; + } + locale = this.getLocale(); + template = this.getTemplate(id); + if (template == null) { + if (/dev|test/.test(window.location.host)) { + template = "(?) " + id; + } else { + template = this.getTemplateDefault(id); + } + errStr = "Missing [" + locale + "] translation for [" + id + "] at [" + window.location.hash + "] - Default template is [" + template + "]"; + this.log({ + error: errStr, + locale: locale, + id: id, + defaultTemplate: template + }); + } + if (template) { + return _.template(template, vars); + } else { + return id; + } + }, + log: function(error) { + if (/dev/.test(window.location.host)) { + if ((typeof console !== "undefined" && console !== null ? console.log : void 0) != null) { + return console.log(error); + } + } else { + _.extend(error, { + host: window.location.host, + hash: window.location.hash + }); + return this.castor.error(JSON.stringify(error)); + } + } + }; +}).call(this); +}, "web-lib/mixins/i18n_phone_form": function(exports, require, module) {(function() { + exports.i18nPhoneForm = { + _events: { + 'change select[data-country-code-prefix]': 'setCountryCodePrefix' + }, + setCountryCodePrefix: function(e) { + var $el, prefix; + $el = $(e.currentTarget); + prefix = $el.find('option:selected').attr('data-prefix'); + return $("#" + ($el.attr('data-country-code-prefix'))).text(prefix); + } + }; +}).call(this); +}, "web-lib/models/country": function(exports, require, module) {(function() { + var UberModel; + var __hasProp = Object.prototype.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; + }; + UberModel = require('web-lib/uber_model').UberModel; + exports.Country = (function() { + __extends(Country, UberModel); + function Country() { + Country.__super__.constructor.apply(this, arguments); + } + Country.prototype.url = function() { + if (this.id) { + return "/countries/" + this.id; + } else { + return '/countries'; + } + }; + return Country; + })(); +}).call(this); +}, "web-lib/models/vehicle_type": function(exports, require, module) {(function() { + var UberModel; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }; + UberModel = require('web-lib/uber_model').UberModel; + exports.VehicleType = (function() { + __extends(VehicleType, UberModel); + function VehicleType() { + this.toString = __bind(this.toString, this); + VehicleType.__super__.constructor.apply(this, arguments); + } + VehicleType.prototype.endpoint = 'vehicle_types'; + VehicleType.prototype.toTableRow = function(cols) { + var actions, c, capacity, city_id, columnValues, created_at, created_by_user_id, deleted_at, id, make, minimum_year, model, rows, type, updated_at, updated_by_user_id, _i, _len, _ref; + id = "" + (this.get('id')) + ""; + if (this.get('created_at')) { + created_at = app.helpers.formatDate(this.get('created_at')); + } + if (this.get('updated_at')) { + updated_at = app.helpers.formatDate(this.get('updated_at')); + } + if (this.get('deleted_at')) { + deleted_at = app.helpers.formatDate(this.get('deleted_at')); + } + created_by_user_id = "" + (this.get('created_by_user_id')) + ""; + updated_by_user_id = "" + (this.get('updated_by_user_id')) + ""; + city_id = (_ref = this.get('city')) != null ? _ref.get('display_name') : void 0; + type = this.get('type'); + make = this.get('make'); + model = this.get('model'); + capacity = this.get('capacity'); + minimum_year = this.get('minimum_year'); + actions = "Show"; + if (!this.get('deleted_at')) { + actions += " Edit"; + actions += " Delete"; + } + columnValues = { + id: id, + created_at: created_at, + updated_at: updated_at, + deleted_at: deleted_at, + created_by_user_id: created_by_user_id, + updated_by_user_id: updated_by_user_id, + city_id: city_id, + type: type, + make: make, + model: model, + capacity: capacity, + minimum_year: minimum_year, + actions: actions + }; + rows = []; + for (_i = 0, _len = cols.length; _i < _len; _i++) { + c = cols[_i]; + rows.push(columnValues[c] ? columnValues[c] : '-'); + } + return rows; + }; + VehicleType.prototype.toString = function() { + return this.get('make') + ' ' + this.get('model') + ' ' + this.get('type') + (" (" + (this.get('capacity')) + ")"); + }; + return VehicleType; + })(); +}).call(this); +}, "web-lib/templates/footer": function(exports, require, module) {module.exports = function(__obj) { + if (!__obj) __obj = {}; + var __out = [], __capture = function(callback) { + var out = __out, result; + __out = []; + callback.call(this); + result = __out.join(''); + __out = out; + return __safe(result); + }, __sanitize = function(value) { + if (value && value.ecoSafe) { + return value; + } else if (typeof value !== 'undefined' && value != null) { + return __escape(value); + } else { + return ''; + } + }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; + __safe = __obj.safe = function(value) { + if (value && value.ecoSafe) { + return value; + } else { + if (!(typeof value !== 'undefined' && value != null)) value = ''; + var result = new String(value); + result.ecoSafe = true; + return result; + } + }; + if (!__escape) { + __escape = __obj.escape = function(value) { + return ('' + value) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + }; + } + (function() { + (function() { + var locale, title, _ref; + __out.push('\n\n\n\n\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "web-lib/translations/en": function(exports, require, module) {(function() { + exports.translations = { + "Info": "Info", + "Learn More": "Learn More", + "Pricing": "Pricing", + "FAQ": "FAQ", + "Support": "Support", + "Support & FAQ": "Support & FAQ", + "Contact Us": "Contact Us", + "Jobs": "Jobs", + "Phones": "Phones", + "Text Message": "Text Message", + "iPhone": "iPhone", + "Android": "Android", + "Drivers": "Drivers", + "Apply": "Apply", + "Sign In": "Sign In", + "Social": "Social", + "Twitter": "Twitter", + "Facebook": "Facebook", + "Blog": "Blog", + "Legal": "Legal", + "Company_Footer": "Company", + "Privacy Policy": "Privacy Policy", + "Terms": "Terms", + "Copyright © Uber Technologies, Inc.": "Copyright © Uber Technologies, Inc.", + "Language:": "Language:", + "Apply to Drive": "Apply to Drive", + "Expiration": "Expiration", + "Fare": "Fare", + "Driver": "Driver ", + "Dashboard": "Dashboard", + "Forgot Password": "Forgot Password", + "Trip Details": "Trip Details", + "Save": "Save", + "Cancel": "Cancel", + "Edit": "Edit", + "Password": "Password", + "First Name": "First Name", + "Last Name": "Last Name", + "Email Address": "Email Address", + "Submit": "Submit", + "Mobile Number": "Mobile Number", + "Zip Code": "Zip Code", + "Sign Out": "Sign Out", + "Confirm Email Message": "Attempting to confirm email...", + "Upload": "Upload", + "Rating": "Rating", + "Pickup Time": "Pickup Time", + "2011": "2011", + "2012": "2012", + "2013": "2013", + "2014": "2014", + "2015": "2015", + "2016": "2016", + "2017": "2017", + "2018": "2018", + "2019": "2019", + "2020": "2020", + "2021": "2021", + "2022": "2022", + "01": "01", + "02": "02", + "03": "03", + "04": "04", + "05": "05", + "06": "06", + "07": "07", + "08": "08", + "09": "09", + "10": "10", + "11": "11", + "12": "12" + }; +}).call(this); +}, "web-lib/translations/fr": function(exports, require, module) {(function() { + exports.translations = { + "Info": "Info", + "Learn More": "En Savoir Plus", + "Pricing": "Calcul du Prix", + "Support & FAQ": "Aide & FAQ", + "Contact Us": "Contactez Nous", + "Jobs": "Emplois", + "Phones": "Téléphones", + "Text Message": "SMS", + "iPhone": "iPhone", + "Android": "Android", + "Apply to Drive": "Candidature Chauffeur", + "Sign In": "Connexion", + "Social": "Contact", + "Twitter": "Twitter", + "Facebook": "Facebook", + "Blog": "Blog", + "Privacy Policy": "Protection des Données Personelles", + "Terms": "Conditions Générales", + "Copyright © Uber Technologies, Inc.": "© Uber, Inc.", + "Language:": "Langue:", + "Forgot Password": "Mot de passe oublié", + "Company_Footer": "À Propos d'Uber", + "Expiration": "Expiration", + "Fare": "Tarif", + "Driver": "Chauffeur", + "Drivers": "Chauffeurs", + "Dashboard": "Tableau de bord", + "Forgot Password": "Mot de passe oublié", + "Forgot Password?": "Mot de passe oublié?", + "Trip Details": "Détails de la course", + "Save": "Enregistrer", + "Cancel": "Annuler", + "Edit": "Modifier", + "Password": "Mot de passe", + "First Name": "Prénom", + "Last Name": "Nom", + "Email Address": "E-mail", + "Submit": "Soumettre", + "Mobile Number": "Téléphone Portable", + "Zip Code": "Code Postal", + "Sign Out": "Se déconnecter", + "Confirm Email Message": "E-mail de confirmation", + "Upload": "Télécharger", + "Rating": "Notation", + "Pickup Time": "Heure de prise en charge", + "2011": "2011", + "2012": "2012", + "2013": "2013", + "2014": "2014", + "2015": "2015", + "2016": "2016", + "2017": "2017", + "2018": "2018", + "2019": "2019", + "2020": "2020", + "2021": "2021", + "2022": "2022", + "01": "01", + "02": "02", + "03": "03", + "04": "04", + "05": "05", + "06": "06", + "07": "07", + "08": "08", + "09": "09", + "10": "10", + "11": "11", + "12": "12" + }; +}).call(this); +}, "web-lib/uber_collection": function(exports, require, module) {(function() { + var __hasProp = Object.prototype.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; + }; + exports.UberCollection = (function() { + __extends(UberCollection, Backbone.Collection); + function UberCollection() { + UberCollection.__super__.constructor.apply(this, arguments); + } + UberCollection.prototype.parse = function(data) { + var model, tmp, _i, _in, _len, _out; + _in = data.resources || data; + _out = []; + if (data.meta) { + this.meta = data.meta; + } + for (_i = 0, _len = _in.length; _i < _len; _i++) { + model = _in[_i]; + tmp = new this.model; + tmp.set(tmp.parse(model)); + _out.push(tmp); + } + return _out; + }; + UberCollection.prototype.isRenderable = function() { + if (this.models.length) { + return true; + } + }; + UberCollection.prototype.toTableRows = function(cols) { + var tableRows; + tableRows = []; + _.each(this.models, function(model) { + return tableRows.push(model.toTableRow(cols)); + }); + return tableRows; + }; + return UberCollection; + })(); +}).call(this); +}, "web-lib/uber_model": function(exports, require, module) {(function() { + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }, __indexOf = Array.prototype.indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) { + if (this[i] === item) return i; + } + return -1; + }; + exports.UberModel = (function() { + __extends(UberModel, Backbone.Model); + function UberModel() { + this.refetch = __bind(this.refetch, this); + this.fetch = __bind(this.fetch, this); + this.save = __bind(this.save, this); + this.parse = __bind(this.parse, this); + UberModel.__super__.constructor.apply(this, arguments); + } + UberModel.prototype.endpoint = 'set_api_endpoint_in_subclass'; + UberModel.prototype.refetchOptions = {}; + UberModel.prototype.url = function(type) { + var endpoint_path; + endpoint_path = "/" + this.endpoint; + if (this.get('id')) { + return endpoint_path + ("/" + (this.get('id'))); + } else { + return endpoint_path; + } + }; + UberModel.prototype.isRenderable = function() { + var i, key, value, _ref; + i = 0; + _ref = this.attributes; + for (key in _ref) { + if (!__hasProp.call(_ref, key)) continue; + value = _ref[key]; + if (this.attributes.hasOwnProperty(key)) { + i += 1; + } + if (i > 1) { + return true; + } + } + return !(i === 1); + }; + UberModel.prototype.parse = function(response) { + var attrs, key, model, models, _i, _j, _k, _len, _len2, _len3, _ref, _ref2; + if (typeof response === 'object') { + _ref = _.intersection(_.keys(app.models), _.keys(response)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + key = _ref[_i]; + if (response[key]) { + attrs = this.parse(response[key]); + if (typeof attrs === 'object') { + response[key] = new app.models[key](attrs); + } + } + } + _ref2 = _.intersection(_.keys(app.collections), _.keys(response)); + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + key = _ref2[_j]; + models = response[key]; + if (_.isArray(models)) { + response[key] = new app.collections[key]; + for (_k = 0, _len3 = models.length; _k < _len3; _k++) { + model = models[_k]; + attrs = app.collections[key].prototype.model.prototype.parse(model); + response[key].add(new response[key].model(attrs)); + } + } + } + } + return response; + }; + UberModel.prototype.save = function(attributes, options) { + var attr, _i, _j, _len, _len2, _ref, _ref2; + if (options == null) { + options = {}; + } + _ref = _.intersection(_.keys(app.models), _.keys(this.attributes)); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + attr = _ref[_i]; + if (typeof this.get(attr) === "object") { + this.unset(attr, { + silent: true + }); + } + } + _ref2 = _.intersection(_.keys(app.collections), _.keys(this.attributes)); + for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) { + attr = _ref2[_j]; + if (typeof this.get(attr) === "object") { + this.unset(attr, { + silent: true + }); + } + } + if ((options != null) && options.diff && (attributes != null) && attributes !== {}) { + attributes['id'] = this.get('id'); + attributes['token'] = this.get('token'); + this.clear({ + 'silent': true + }); + this.set(attributes, { + silent: true + }); + } + if (__indexOf.call(_.keys(options), "data") < 0 && __indexOf.call(_.keys(this.refetchOptions || {}), "data") >= 0) { + options.data = this.refetchOptions.data; + } + return Backbone.Model.prototype.save.call(this, attributes, options); + }; + UberModel.prototype.fetch = function(options) { + this.refetchOptions = options; + return Backbone.Model.prototype.fetch.call(this, options); + }; + UberModel.prototype.refetch = function() { + return this.fetch(this.refetchOptions); + }; + return UberModel; + })(); +}).call(this); +}, "web-lib/uber_router": function(exports, require, module) {(function() { + var __hasProp = Object.prototype.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; + }; + exports.UberRouter = (function() { + __extends(UberRouter, Backbone.Router); + function UberRouter() { + UberRouter.__super__.constructor.apply(this, arguments); + } + UberRouter.prototype.datePickers = function(format) { + if (format == null) { + format = "%Z-%m-%dT%H:%i:%s%:"; + } + $('.datepicker').AnyTime_noPicker(); + return $('.datepicker').AnyTime_picker({ + 'format': format, + 'formatUtcOffset': '%@' + }); + }; + UberRouter.prototype.autoGrowInput = function() { + return $('.editable input').autoGrowInput(); + }; + UberRouter.prototype.windowTitle = function(title) { + return $(document).attr('title', title); + }; + return UberRouter; + })(); +}).call(this); +}, "web-lib/uber_show_view": function(exports, require, module) {(function() { + var UberView; + var __hasProp = Object.prototype.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; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + UberView = require('web-lib/uber_view').UberView; + exports.UberShowView = (function() { + __extends(UberShowView, UberView); + function UberShowView() { + UberShowView.__super__.constructor.apply(this, arguments); + } + UberShowView.prototype.view = 'show'; + UberShowView.prototype.events = { + 'click #edit': 'edit', + 'submit form': 'save', + 'click .cancel': 'cancel' + }; + UberShowView.prototype.errors = null; + UberShowView.prototype.showTemplate = null; + UberShowView.prototype.editTemplate = null; + UberShowView.prototype.initialize = function() { + if (this.init_hook) { + this.init_hook(); + } + _.bindAll(this, 'render'); + return this.model.bind('change', this.render); + }; + UberShowView.prototype.render = function() { + var $el; + $el = $(this.el); + this.selectView(); + if (this.view === 'show') { + $el.html(this.showTemplate({ + model: this.model + })); + } else if (this.view === 'edit') { + $el.html(this.editTemplate({ + model: this.model, + errors: this.errors || {}, + collections: this.collections || {} + })); + } else { + $el.html(this.newTemplate({ + model: this.model, + errors: this.errors || {}, + collections: this.collections || {} + })); + } + if (this.render_hook) { + this.render_hook(); + } + this.errors = null; + this.userIdsToLinkedNames(); + this.datePickers(); + return this.place(); + }; + UberShowView.prototype.selectView = function() { + var url; + if (this.options.urlRendering) { + url = window.location.hash; + if (url.match(/\/new/)) { + return this.view = 'new'; + } else if (url.match(/\/edit/)) { + return this.view = 'edit'; + } else { + return this.view = 'show'; + } + } + }; + UberShowView.prototype.edit = function(e) { + e.preventDefault(); + if (this.options.urlRendering) { + window.location.hash = '#/' + this.model.endpoint + '/' + this.model.get('id') + '/edit'; + } else { + this.view = 'edit'; + } + return this.model.change(); + }; + UberShowView.prototype.save = function(e) { + var attributes, ele, form_attrs, _i, _len, _ref; + e.preventDefault(); + attributes = $(e.currentTarget).serializeToJson(); + form_attrs = {}; + _ref = $('input[type="radio"]'); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + ele = _ref[_i]; + if ($(ele).is(':checked')) { + form_attrs[$(ele).attr('name')] = $(ele).attr('value'); + } + } + attributes = _.extend(attributes, form_attrs); + if (this.relationships) { + attributes = _.extend(attributes, { + relationships: this.relationships + }); + } + if (this.filter_attributes != null) { + this.filter_attributes(attributes); + } + return this.model.save(attributes, { + silent: true, + success: __bind(function(model) { + if (this.options.urlRendering) { + window.location.hash = '#/' + this.model.endpoint + '/' + this.model.get('id'); + } else { + this.view = 'show'; + } + return this.flash('success', "Uber save!"); + }, this), + statusCode: { + 406: __bind(function(xhr) { + this.errors = JSON.parse(xhr.responseText); + return this.flash('error', 'That was not Uber.'); + }, this) + }, + error: __bind(function(model, xhr) { + var code, message, responseJSON, responseText; + code = xhr.status; + responseText = xhr.responseText; + if (responseText) { + responseJSON = JSON.parse(responseText); + } + if (responseJSON && (typeof responseJSON === 'object') && (responseJSON.hasOwnProperty('error'))) { + message = responseJSON.error; + } + return this.flash('error', (code || 'Unknown') + ' error' + (': ' + message || '')); + }, this), + complete: __bind(function() { + return this.model.change(); + }, this) + }); + }; + UberShowView.prototype.cancel = function(e) { + e.preventDefault(); + if (this.options.urlRendering) { + window.location.hash = '#/' + this.model.endpoint + '/' + this.model.get('id'); + } else { + this.view = 'show'; + } + return this.model.fetch({ + silent: true, + complete: __bind(function() { + return this.model.change(); + }, this) + }); + }; + return UberShowView; + })(); +}).call(this); +}, "web-lib/uber_sync": function(exports, require, module) {(function() { + var methodType; + var __indexOf = Array.prototype.indexOf || function(item) { + for (var i = 0, l = this.length; i < l; i++) { + if (this[i] === item) return i; + } + return -1; + }; + methodType = { + create: 'POST', + update: 'PUT', + "delete": 'DELETE', + read: 'GET' + }; + exports.UberSync = function(method, model, options) { + var token; + options.type = methodType[method]; + options.url = _.isString(this.url) ? '/api' + this.url : '/api' + this.url(options.type); + options.data = _.extend({}, options.data); + if (__indexOf.call(_.keys(options.data), "city_id") < 0) { + if ($.cookie('city_filter')) { + _.extend(options.data, { + city_id: $.cookie('city_filter') + }); + } + } else { + delete options.data['city_id']; + } + if (options.type === 'POST' || options.type === 'PUT') { + _.extend(options.data, model.toJSON()); + } + token = $.cookie('token') ? $.cookie('token') : typeof USER !== "undefined" && USER !== null ? USER.get('token') : ""; + _.extend(options.data, { + token: token + }); + if (method === "delete") { + options.contentType = 'application/json'; + options.data = JSON.stringify(options.data); + } + return $.ajax(options); + }; +}).call(this); +}, "web-lib/uber_view": function(exports, require, module) {(function() { + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }; + exports.UberView = (function() { + __extends(UberView, Backbone.View); + function UberView() { + this.processDocumentUpload = __bind(this.processDocumentUpload, this); + UberView.__super__.constructor.apply(this, arguments); + } + UberView.prototype.className = 'view_container'; + UberView.prototype.hashId = function() { + return parseInt(location.hash.split('/')[2]); + }; + UberView.prototype.place = function(content) { + var $target; + $target = this.options.scope ? this.options.scope.find(this.options.selector) : $(this.options.selector); + $target[this.options.method || 'html'](content || this.el); + this.delegateEvents(); + $('#spinner').hide(); + return this; + }; + UberView.prototype.mixin = function(m, args) { + var events, self; + if (args == null) { + args = {}; + } + self = this; + events = m._events; + _.extend(this, m); + if (m.initialize) { + m.initialize(self, args); + } + return _.each(_.keys(events), function(key) { + var event, func, selector, split; + split = key.split(' '); + event = split[0]; + selector = split[1]; + func = events[key]; + return $(self.el).find(selector).live(event, function(e) { + return self[func](e); + }); + }); + }; + UberView.prototype.datePickers = function(format) { + if (format == null) { + format = "%Z-%m-%dT%H:%i:%s%:"; + } + $('.datepicker').AnyTime_noPicker(); + return $('.datepicker').AnyTime_picker({ + 'format': format, + 'formatUtcOffset': '%@' + }); + }; + UberView.prototype.dataTable = function(collection, selector, options, params, cols) { + var defaults; + if (selector == null) { + selector = 'table'; + } + if (options == null) { + options = {}; + } + if (params == null) { + params = {}; + } + if (cols == null) { + cols = []; + } + $(selector).empty(); + if (!cols.length) { + cols = collection.defaultColumns; + } + defaults = { + aoColumns: collection.tableColumns(cols), + bDestroy: true, + bSort: false, + bProcessing: true, + bFilter: false, + bServerSide: true, + bPaginate: true, + bScrollInfinite: true, + bScrollCollapse: true, + sScrollY: '600px', + iDisplayLength: 50, + fnServerData: function(source, data, callback) { + var defaultParams; + defaultParams = { + limit: data[4].value, + offset: data[3].value + }; + return collection.fetch({ + data: _.extend(defaultParams, params), + success: function() { + return callback({ + aaData: collection.toTableRows(cols), + iTotalRecords: collection.meta.count, + iTotalDisplayRecords: collection.meta.count + }); + }, + error: function() { + return new Error({ + message: 'Loading error.' + }); + } + }); + }, + fnRowCallback: function(nRow, aData, iDisplayIndex, iDisplayIndexFull) { + $('[data-tooltip]', nRow).qtip({ + content: { + attr: 'data-tooltip' + }, + style: { + classes: "ui-tooltip-light ui-tooltip-rounded ui-tooltip-shadow" + } + }); + return nRow; + } + }; + return $(this.el).find(selector).dataTable(_.extend(defaults, options)); + }; + UberView.prototype.dataTableLocal = function(collection, selector, options, params, cols) { + var $dataTable, defaults; + if (selector == null) { + selector = 'table'; + } + if (options == null) { + options = {}; + } + if (params == null) { + params = {}; + } + if (cols == null) { + cols = []; + } + $(selector).empty(); + if (!cols.length || cols.length === 0) { + cols = collection.defaultColumns; + } + defaults = { + aaData: collection.toTableRows(cols), + aoColumns: collection.tableColumns(cols), + bDestroy: true, + bSort: false, + bProcessing: true, + bFilter: false, + bScrollInfinite: true, + bScrollCollapse: true, + sScrollY: '600px', + iDisplayLength: -1 + }; + $dataTable = $(this.el).find(selector).dataTable(_.extend(defaults, options)); + _.delay(__bind(function() { + if ($dataTable && $dataTable.length > 0) { + return $dataTable.fnAdjustColumnSizing(); + } + }, this), 1); + return $dataTable; + }; + UberView.prototype.reverseGeocode = function() { + var $el; + return ''; + $el = $(this.el); + return this.requireMaps(function() { + var geocoder; + geocoder = new google.maps.Geocoder(); + return $el.find('[data-point]').each(function() { + var $this, latLng, point; + $this = $(this); + point = JSON.parse($this.attr('data-point')); + latLng = new google.maps.LatLng(point.latitude, point.longitude); + return geocoder.geocode({ + latLng: latLng + }, function(data, status) { + if (status === google.maps.GeocoderStatus.OK) { + return $this.text(data[0].formatted_address); + } + }); + }); + }); + }; + UberView.prototype.userIdsToLinkedNames = function() { + var $el; + $el = $(this.el); + return $el.find('a[data-user-id][data-user-type]').each(function() { + var $this, user, userType; + $this = $(this); + userType = $this.attr('data-user-type') === 'user' ? 'client' : $this.attr('data-user-type'); + user = new app.models[userType]({ + id: $this.attr('data-user-id') + }); + return user.fetch({ + success: function(user) { + return $this.html(app.helpers.linkedName(user)).attr('href', "!/" + user.role + "s/" + user.id); + }, + error: function() { + if ($this.attr('data-user-type') === 'user') { + user = new app.models['driver']({ + id: $this.attr('data-user-id') + }); + return user.fetch({ + success: function(user) { + return $this.html(app.helpers.linkedName(user)).attr('href', "!/driver/" + user.id); + } + }); + } + } + }); + }); + }; + UberView.prototype.selectedCity = function() { + var $selected, city, cityFilter; + cityFilter = $.cookie('city_filter'); + $selected = $("#city_filter option[value=" + cityFilter + "]"); + if (city_filter && $selected.length) { + return city = { + lat: parseFloat($selected.attr('data-lat')), + lng: parseFloat($selected.attr('data-lng')), + timezone: $selected.attr('data-timezone') + }; + } else { + return city = { + lat: 37.775, + lng: -122.45, + timezone: 'Etc/UTC' + }; + } + }; + UberView.prototype.updateModel = function(e, success) { + var $el, attrs, model, self; + e.preventDefault(); + $el = $(e.currentTarget); + self = this; + model = new this.model.__proto__.constructor({ + id: this.model.id + }); + attrs = {}; + $el.find('[name]').each(function() { + var $this; + $this = $(this); + return attrs["" + ($this.attr('name'))] = $this.val(); + }); + self.model.set(attrs); + $el.find('span.error').text(''); + return model.save(attrs, { + complete: function(xhr) { + var response; + response = JSON.parse(xhr.responseText); + switch (xhr.status) { + case 200: + self.model = model; + $el.find('[name]').val(''); + if (success) { + return success(); + } + break; + case 406: + return _.each(response, function(error, field) { + return $el.find("[name=" + field + "]").parent().find('span.error').text(error); + }); + default: + return this.unanticipatedError(response); + } + } + }); + }; + UberView.prototype.autoUpdateModel = function(e) { + var $el, arg, model, self, val; + $el = $(e.currentTarget); + val = $el.val(); + self = this; + if (val !== this.model.get($el.attr('id'))) { + arg = {}; + arg[$el.attr('id')] = $el.is(':checkbox') ? $el.is(':checked') ? 1 : 0 : val; + $('.editable span').empty(); + this.model.set(arg); + model = new this.model.__proto__.constructor({ + id: this.model.id + }); + return model.save(arg, { + complete: function(xhr) { + var key, response, _i, _len, _ref, _results; + response = JSON.parse(xhr.responseText); + switch (xhr.status) { + case 200: + self.flash('success', 'Saved!'); + return $el.blur(); + case 406: + self.flash('error', 'That was not Uber.'); + _ref = _.keys(response); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + key = _ref[_i]; + _results.push($el.parent().find('span').html(response[key])); + } + return _results; + break; + default: + return self.unanticipatedError; + } + } + }); + } + }; + UberView.prototype.unanticipatedError = function(response) { + return self.flash('error', response); + }; + UberView.prototype.flash = function(type, text) { + var $banner; + $banner = $("." + type); + $banner.find('p').text(text).end().css('border', '1px solid #999').animate({ + top: 0 + }, 500); + return setTimeout(function() { + return $banner.animate({ + top: -$banner.outerHeight() + }, 500); + }, 3000); + }; + UberView.prototype.requireMaps = function(callback) { + if (typeof google !== 'undefined' && google.maps) { + return callback(); + } else { + return $.getScript("https://www.google.com/jsapi?key=" + CONFIG.googleJsApiKey, function() { + return google.load('maps', 3, { + callback: callback, + other_params: 'sensor=false&language=en' + }); + }); + } + }; + UberView.prototype.select_drop_down = function(model, key) { + var value; + value = model.get(key); + if (value) { + return $("select[id='" + key + "'] option[value='" + value + "']").attr('selected', 'selected'); + } + }; + UberView.prototype.processDocumentUpload = function(e) { + var $fi, $form, arbData, curDate, data, expDate, expM, expY, expiration, fileElementId, invalid; + e.preventDefault(); + $form = $(e.currentTarget); + $fi = $("input[type=file]", $form); + $(".validationError").removeClass("validationError"); + if (!$fi.val()) { + return $fi.addClass("validationError"); + } else { + fileElementId = $fi.attr('id'); + expY = $("select[name=expiration-year]", $form).val(); + expM = $("select[name=expiration-month]", $form).val(); + invalid = false; + if (expY && expM) { + expDate = new Date(expY, expM, 28); + curDate = new Date(); + if (expDate < curDate) { + invalid = true; + $(".expiration", $form).addClass("validationError"); + } + expiration = "" + expY + "-" + expM + "-28T23:59:59Z"; + } + arbData = {}; + $(".arbitraryField", $form).each(__bind(function(i, e) { + arbData[$(e).attr('name')] = $(e).val(); + if ($(e).val() === "") { + invalid = true; + return $(e).addClass("validationError"); + } + }, this)); + if (!invalid) { + data = { + token: $.cookie('token') || USER.get('token'), + name: $("input[name=fileName]", $form).val(), + meta: escape(JSON.stringify(arbData)), + user_id: $("input[name=driver_id]", $form).val(), + vehicle_id: $("input[name=vehicle_id]", $form).val() + }; + if (expiration) { + data['expiration'] = expiration; + } + $("#spinner").show(); + return $.ajaxFileUpload({ + url: '/api/documents', + secureuri: false, + fileElementId: fileElementId, + data: data, + complete: __bind(function(resp, status) { + var key, _i, _len, _ref, _results; + $("#spinner").hide(); + if (status === "success") { + if (this.model) { + this.model.refetch(); + } else { + USER.refetch(); + } + } + if (status === "error") { + _ref = _.keys(resp); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + key = _ref[_i]; + _results.push($("*[name=" + key + "]", $form).addClass("validationError")); + } + return _results; + } + }, this) + }); + } + } + }; + return UberView; + })(); +}).call(this); +}, "web-lib/views/footer": function(exports, require, module) {(function() { + var footerTemplate; + var __hasProp = Object.prototype.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; + }; + footerTemplate = require('web-lib/templates/footer'); + exports.SharedFooterView = (function() { + __extends(SharedFooterView, Backbone.View); + function SharedFooterView() { + SharedFooterView.__super__.constructor.apply(this, arguments); + } + SharedFooterView.prototype.id = 'footer_view'; + SharedFooterView.prototype.events = { + 'click .language': 'intl_set_cookie_locale' + }; + SharedFooterView.prototype.render = function() { + $(this.el).html(footerTemplate()); + this.delegateEvents(); + return this; + }; + SharedFooterView.prototype.intl_set_cookie_locale = function(e) { + var _ref; + i18n.setLocale(e != null ? (_ref = e.srcElement) != null ? _ref.id : void 0 : void 0); + return location.reload(); + }; + return SharedFooterView; + })(); +}).call(this); +}}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/embed-tokens.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/embed-tokens.js new file mode 100755 index 00000000..61307eeb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/embed-tokens.js @@ -0,0 +1,15 @@ +#! /usr/bin/env node + +global.sys = require(/^v0\.[012]/.test(process.version) ? "sys" : "util"); +var fs = require("fs"); +var uglify = require("uglify-js"), // symlink ~/.node_libraries/uglify-js.js to ../uglify-js.js + jsp = uglify.parser, + pro = uglify.uglify; + +var code = fs.readFileSync("embed-tokens.js", "utf8").replace(/^#.*$/mg, ""); +var ast = jsp.parse(code, null, true); + +// trololo +function fooBar() {} + +console.log(sys.inspect(ast, null, null)); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/goto.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/goto.js new file mode 100644 index 00000000..945960c2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/goto.js @@ -0,0 +1,26 @@ +function unique(arqw) { + var a = [], i, j + outer: for (i = 0; i < arqw.length; i++) { + for (j = 0; j < a.length; j++) { + if (a[j] == arqw[i]) { + continue outer + } + } + a[a.length] = arqw[i] + } + return a +} + + +function unique(arqw) { + var crap = [], i, j + outer: for (i = 0; i < arqw.length; i++) { + for (j = 0; j < crap.length; j++) { + if (crap[j] == arqw[i]) { + continue outer + } + } + crap[crap.length] = arqw[i] + } + return crap +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/goto2.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/goto2.js new file mode 100644 index 00000000..d13b2bc0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/goto2.js @@ -0,0 +1,8 @@ +function q(qooo) { + var a; + foo: for(;;) { + a++; + if (something) break foo; + return qooo; + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/hoist.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/hoist.js new file mode 100644 index 00000000..4bf2b94d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/hoist.js @@ -0,0 +1,33 @@ +function foo(arg1, arg2, arg3, arg4, arg5, arg6) { + var a = 5; + { + var d = 10, mak = 20, buz = 30; + var q = buz * 2; + } + if (moo) { + var a, b, c; + } + for (var arg1 = 0, d = 20; arg1 < 10; ++arg1) + console.log(arg3); + for (var i in mak) {} + for (j in d) {} + var d; + + function test() { + + }; + + //test(); + + (function moo(first, second){ + console.log(first); + })(1); + + (function moo(first, second){ + console.log(moo()); + })(1); +} + + +var foo; +var bar; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument.js new file mode 100644 index 00000000..c6a9d798 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument.js @@ -0,0 +1,97 @@ +// sample on how to use the parser and walker API to instrument some code + +var jsp = require("uglify-js").parser; +var pro = require("uglify-js").uglify; + +function instrument(code) { + var ast = jsp.parse(code, false, true); // true for the third arg specifies that we want + // to have start/end tokens embedded in the + // statements + var w = pro.ast_walker(); + + // we're gonna need this to push elements that we're currently looking at, to avoid + // endless recursion. + var analyzing = []; + function do_stat() { + var ret; + if (this[0].start && analyzing.indexOf(this) < 0) { + // without the `analyzing' hack, w.walk(this) would re-enter here leading + // to infinite recursion + analyzing.push(this); + ret = [ "splice", // XXX: "block" is safer + [ [ "stat", + [ "call", [ "name", "trace" ], + [ [ "string", this[0].toString() ], + [ "num", this[0].start.line ], + [ "num", this[0].start.col ], + [ "num", this[0].end.line ], + [ "num", this[0].end.col ]]]], + w.walk(this) ]]; + analyzing.pop(this); + } + return ret; + }; + var new_ast = w.with_walkers({ + "stat" : do_stat, + "label" : do_stat, + "break" : do_stat, + "continue" : do_stat, + "debugger" : do_stat, + "var" : do_stat, + "const" : do_stat, + "return" : do_stat, + "throw" : do_stat, + "try" : do_stat, + "defun" : do_stat, + "if" : do_stat, + "while" : do_stat, + "do" : do_stat, + "for" : do_stat, + "for-in" : do_stat, + "switch" : do_stat, + "with" : do_stat + }, function(){ + return w.walk(ast); + }); + return pro.gen_code(new_ast, { beautify: true }); +} + + + + +////// test code follows. + +var code = instrument(test.toString()); +console.log(code); + +function test() { + // simple stats + a = 5; + c += a + b; + "foo"; + + // var + var foo = 5; + const bar = 6, baz = 7; + + // switch block. note we can't track case lines the same way. + switch ("foo") { + case "foo": + return 1; + case "bar": + return 2; + } + + // for/for in + for (var i = 0; i < 5; ++i) { + console.log("Hello " + i); + } + for (var i in [ 1, 2, 3]) { + console.log(i); + } + + // note however that the following is broken. I guess we + // should add the block brackets in this case... + for (var i = 0; i < 5; ++i) + console.log("foo"); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument2.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument2.js new file mode 100644 index 00000000..6aee5f3f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/instrument2.js @@ -0,0 +1,138 @@ +// sample on how to use the parser and walker API to instrument some code + +var jsp = require("uglify-js").parser; +var pro = require("uglify-js").uglify; + +function instrument(code) { + var ast = jsp.parse(code, false, true); // true for the third arg specifies that we want + // to have start/end tokens embedded in the + // statements + var w = pro.ast_walker(); + + function trace (line, comment) { + var code = pro.gen_code(line, { beautify: true }); + var data = line[0] + + var args = [] + if (!comment) comment = "" + if (typeof data === "object") { + code = code.split(/\n/).shift() + args = [ [ "string", data.toString() ], + [ "string", code ], + [ "num", data.start.line ], + [ "num", data.start.col ], + [ "num", data.end.line ], + [ "num", data.end.col ]] + } else { + args = [ [ "string", data ], + [ "string", code ]] + + } + return [ "call", [ "name", "trace" ], args ]; + } + + // we're gonna need this to push elements that we're currently looking at, to avoid + // endless recursion. + var analyzing = []; + function do_stat() { + var ret; + if (this[0].start && analyzing.indexOf(this) < 0) { + // without the `analyzing' hack, w.walk(this) would re-enter here leading + // to infinite recursion + analyzing.push(this); + ret = [ "splice", + [ [ "stat", trace(this) ], + w.walk(this) ]]; + analyzing.pop(this); + } + return ret; + } + + function do_cond(c, t, f) { + return [ this[0], w.walk(c), + ["seq", trace(t), w.walk(t) ], + ["seq", trace(f), w.walk(f) ]]; + } + + function do_binary(c, l, r) { + if (c !== "&&" && c !== "||") { + return [this[0], c, w.walk(l), w.walk(r)]; + } + return [ this[0], c, + ["seq", trace(l), w.walk(l) ], + ["seq", trace(r), w.walk(r) ]]; + } + + var new_ast = w.with_walkers({ + "stat" : do_stat, + "label" : do_stat, + "break" : do_stat, + "continue" : do_stat, + "debugger" : do_stat, + "var" : do_stat, + "const" : do_stat, + "return" : do_stat, + "throw" : do_stat, + "try" : do_stat, + "defun" : do_stat, + "if" : do_stat, + "while" : do_stat, + "do" : do_stat, + "for" : do_stat, + "for-in" : do_stat, + "switch" : do_stat, + "with" : do_stat, + "conditional" : do_cond, + "binary" : do_binary + }, function(){ + return w.walk(ast); + }); + return pro.gen_code(new_ast, { beautify: true }); +} + + +////// test code follows. + +var code = instrument(test.toString()); +console.log(code); + +function test() { + // simple stats + a = 5; + c += a + b; + "foo"; + + // var + var foo = 5; + const bar = 6, baz = 7; + + // switch block. note we can't track case lines the same way. + switch ("foo") { + case "foo": + return 1; + case "bar": + return 2; + } + + // for/for in + for (var i = 0; i < 5; ++i) { + console.log("Hello " + i); + } + for (var i in [ 1, 2, 3]) { + console.log(i); + } + + for (var i = 0; i < 5; ++i) + console.log("foo"); + + for (var i = 0; i < 5; ++i) { + console.log("foo"); + } + + var k = plurp() ? 1 : 0; + var x = a ? doX(y) && goZoo("zoo") + : b ? blerg({ x: y }) + : null; + + var x = X || Y; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/liftvars.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/liftvars.js new file mode 100644 index 00000000..2f4b7fe2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/liftvars.js @@ -0,0 +1,8 @@ +var UNUSED_VAR1 = 19; + +function main() { + var unused_var2 = 20; + alert(100); +} + +main(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/test.js new file mode 100755 index 00000000..f295fba8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/test.js @@ -0,0 +1,30 @@ +#! /usr/bin/env node + +global.sys = require(/^v0\.[012]/.test(process.version) ? "sys" : "util"); +var fs = require("fs"); +var uglify = require("uglify-js"), // symlink ~/.node_libraries/uglify-js.js to ../uglify-js.js + jsp = uglify.parser, + pro = uglify.uglify; + +var code = fs.readFileSync("hoist.js", "utf8"); +var ast = jsp.parse(code); + +ast = pro.ast_lift_variables(ast); + +var w = pro.ast_walker(); +ast = w.with_walkers({ + "function": function() { + var node = w.dive(this); // walk depth first + console.log(pro.gen_code(node, { beautify: true })); + return node; + }, + "name": function(name) { + return [ this[0], "X" ]; + } +}, function(){ + return w.walk(ast); +}); + +console.log(pro.gen_code(ast, { + beautify: true +})); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/uglify-hangs.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/uglify-hangs.js new file mode 100644 index 00000000..0d5b7e0e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/uglify-hangs.js @@ -0,0 +1,3930 @@ +/** + * @fileoverview + * + * JsWorld + * + *

Javascript library for localised formatting and parsing of: + *

    + *
  • Numbers + *
  • Dates and times + *
  • Currency + *
+ * + *

The library classes are configured with standard POSIX locale definitions + * derived from Unicode's Common Locale Data Repository (CLDR). + * + *

Website: JsWorld + * + * @author Vladimir Dzhuvinov + * @version 2.5 (2011-12-23) + */ + + + +/** + * @namespace Namespace container for the JsWorld library objects. + */ +jsworld = {}; + + +/** + * @function + * + * @description Formats a JavaScript Date object as an ISO-8601 date/time + * string. + * + * @param {Date} [d] A valid JavaScript Date object. If undefined the + * current date/time will be used. + * @param {Boolean} [withTZ] Include timezone offset, default false. + * + * @returns {String} The date/time formatted as YYYY-MM-DD HH:MM:SS. + */ +jsworld.formatIsoDateTime = function(d, withTZ) { + + if (typeof d === "undefined") + d = new Date(); // now + + if (typeof withTZ === "undefined") + withTZ = false; + + var s = jsworld.formatIsoDate(d) + " " + jsworld.formatIsoTime(d); + + if (withTZ) { + + var diff = d.getHours() - d.getUTCHours(); + var hourDiff = Math.abs(diff); + + var minuteUTC = d.getUTCMinutes(); + var minute = d.getMinutes(); + + if (minute != minuteUTC && minuteUTC < 30 && diff < 0) + hourDiff--; + + if (minute != minuteUTC && minuteUTC > 30 && diff > 0) + hourDiff--; + + var minuteDiff; + if (minute != minuteUTC) + minuteDiff = ":30"; + else + minuteDiff = ":00"; + + var timezone; + if (hourDiff < 10) + timezone = "0" + hourDiff + minuteDiff; + + else + timezone = "" + hourDiff + minuteDiff; + + if (diff < 0) + timezone = "-" + timezone; + + else + timezone = "+" + timezone; + + s = s + timezone; + } + + return s; +}; + + +/** + * @function + * + * @description Formats a JavaScript Date object as an ISO-8601 date string. + * + * @param {Date} [d] A valid JavaScript Date object. If undefined the current + * date will be used. + * + * @returns {String} The date formatted as YYYY-MM-DD. + */ +jsworld.formatIsoDate = function(d) { + + if (typeof d === "undefined") + d = new Date(); // now + + var year = d.getFullYear(); + var month = d.getMonth() + 1; + var day = d.getDate(); + + return year + "-" + jsworld._zeroPad(month, 2) + "-" + jsworld._zeroPad(day, 2); +}; + + +/** + * @function + * + * @description Formats a JavaScript Date object as an ISO-8601 time string. + * + * @param {Date} [d] A valid JavaScript Date object. If undefined the current + * time will be used. + * + * @returns {String} The time formatted as HH:MM:SS. + */ +jsworld.formatIsoTime = function(d) { + + if (typeof d === "undefined") + d = new Date(); // now + + var hour = d.getHours(); + var minute = d.getMinutes(); + var second = d.getSeconds(); + + return jsworld._zeroPad(hour, 2) + ":" + jsworld._zeroPad(minute, 2) + ":" + jsworld._zeroPad(second, 2); +}; + + +/** + * @function + * + * @description Parses an ISO-8601 formatted date/time string to a JavaScript + * Date object. + * + * @param {String} isoDateTimeVal An ISO-8601 formatted date/time string. + * + *

Accepted formats: + * + *

    + *
  • YYYY-MM-DD HH:MM:SS + *
  • YYYYMMDD HHMMSS + *
  • YYYY-MM-DD HHMMSS + *
  • YYYYMMDD HH:MM:SS + *
+ * + * @returns {Date} The corresponding Date object. + * + * @throws Error on a badly formatted date/time string or on a invalid date. + */ +jsworld.parseIsoDateTime = function(isoDateTimeVal) { + + if (typeof isoDateTimeVal != "string") + throw "Error: The parameter must be a string"; + + // First, try to match "YYYY-MM-DD HH:MM:SS" format + var matches = isoDateTimeVal.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)/); + + // If unsuccessful, try to match "YYYYMMDD HHMMSS" format + if (matches === null) + matches = isoDateTimeVal.match(/^(\d\d\d\d)(\d\d)(\d\d)[T ](\d\d)(\d\d)(\d\d)/); + + // ... try to match "YYYY-MM-DD HHMMSS" format + if (matches === null) + matches = isoDateTimeVal.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d)(\d\d)(\d\d)/); + + // ... try to match "YYYYMMDD HH:MM:SS" format + if (matches === null) + matches = isoDateTimeVal.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)/); + + // Report bad date/time string + if (matches === null) + throw "Error: Invalid ISO-8601 date/time string"; + + // Force base 10 parse int as some values may have leading zeros! + // (to avoid implicit octal base conversion) + var year = parseInt(matches[1], 10); + var month = parseInt(matches[2], 10); + var day = parseInt(matches[3], 10); + + var hour = parseInt(matches[4], 10); + var mins = parseInt(matches[5], 10); + var secs = parseInt(matches[6], 10); + + // Simple value range check, leap years not checked + // Note: the originial ISO time spec for leap hours (24:00:00) and seconds (00:00:60) is not supported + if (month < 1 || month > 12 || + day < 1 || day > 31 || + hour < 0 || hour > 23 || + mins < 0 || mins > 59 || + secs < 0 || secs > 59 ) + + throw "Error: Invalid ISO-8601 date/time value"; + + var d = new Date(year, month - 1, day, hour, mins, secs); + + // Check if the input date was valid + // (JS Date does automatic forward correction) + if (d.getDate() != day || d.getMonth() +1 != month) + throw "Error: Invalid date"; + + return d; +}; + + +/** + * @function + * + * @description Parses an ISO-8601 formatted date string to a JavaScript + * Date object. + * + * @param {String} isoDateVal An ISO-8601 formatted date string. + * + *

Accepted formats: + * + *

    + *
  • YYYY-MM-DD + *
  • YYYYMMDD + *
+ * + * @returns {Date} The corresponding Date object. + * + * @throws Error on a badly formatted date string or on a invalid date. + */ +jsworld.parseIsoDate = function(isoDateVal) { + + if (typeof isoDateVal != "string") + throw "Error: The parameter must be a string"; + + // First, try to match "YYYY-MM-DD" format + var matches = isoDateVal.match(/^(\d\d\d\d)-(\d\d)-(\d\d)/); + + // If unsuccessful, try to match "YYYYMMDD" format + if (matches === null) + matches = isoDateVal.match(/^(\d\d\d\d)(\d\d)(\d\d)/); + + // Report bad date/time string + if (matches === null) + throw "Error: Invalid ISO-8601 date string"; + + // Force base 10 parse int as some values may have leading zeros! + // (to avoid implicit octal base conversion) + var year = parseInt(matches[1], 10); + var month = parseInt(matches[2], 10); + var day = parseInt(matches[3], 10); + + // Simple value range check, leap years not checked + if (month < 1 || month > 12 || + day < 1 || day > 31 ) + + throw "Error: Invalid ISO-8601 date value"; + + var d = new Date(year, month - 1, day); + + // Check if the input date was valid + // (JS Date does automatic forward correction) + if (d.getDate() != day || d.getMonth() +1 != month) + throw "Error: Invalid date"; + + return d; +}; + + +/** + * @function + * + * @description Parses an ISO-8601 formatted time string to a JavaScript + * Date object. + * + * @param {String} isoTimeVal An ISO-8601 formatted time string. + * + *

Accepted formats: + * + *

    + *
  • HH:MM:SS + *
  • HHMMSS + *
+ * + * @returns {Date} The corresponding Date object, with year, month and day set + * to zero. + * + * @throws Error on a badly formatted time string. + */ +jsworld.parseIsoTime = function(isoTimeVal) { + + if (typeof isoTimeVal != "string") + throw "Error: The parameter must be a string"; + + // First, try to match "HH:MM:SS" format + var matches = isoTimeVal.match(/^(\d\d):(\d\d):(\d\d)/); + + // If unsuccessful, try to match "HHMMSS" format + if (matches === null) + matches = isoTimeVal.match(/^(\d\d)(\d\d)(\d\d)/); + + // Report bad date/time string + if (matches === null) + throw "Error: Invalid ISO-8601 date/time string"; + + // Force base 10 parse int as some values may have leading zeros! + // (to avoid implicit octal base conversion) + var hour = parseInt(matches[1], 10); + var mins = parseInt(matches[2], 10); + var secs = parseInt(matches[3], 10); + + // Simple value range check, leap years not checked + if (hour < 0 || hour > 23 || + mins < 0 || mins > 59 || + secs < 0 || secs > 59 ) + + throw "Error: Invalid ISO-8601 time value"; + + return new Date(0, 0, 0, hour, mins, secs); +}; + + +/** + * @private + * + * @description Trims leading and trailing whitespace from a string. + * + *

Used non-regexp the method from http://blog.stevenlevithan.com/archives/faster-trim-javascript + * + * @param {String} str The string to trim. + * + * @returns {String} The trimmed string. + */ +jsworld._trim = function(str) { + + var whitespace = ' \n\r\t\f\x0b\xa0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000'; + + for (var i = 0; i < str.length; i++) { + + if (whitespace.indexOf(str.charAt(i)) === -1) { + str = str.substring(i); + break; + } + } + + for (i = str.length - 1; i >= 0; i--) { + if (whitespace.indexOf(str.charAt(i)) === -1) { + str = str.substring(0, i + 1); + break; + } + } + + return whitespace.indexOf(str.charAt(0)) === -1 ? str : ''; +}; + + + +/** + * @private + * + * @description Returns true if the argument represents a decimal number. + * + * @param {Number|String} arg The argument to test. + * + * @returns {Boolean} true if the argument represents a decimal number, + * otherwise false. + */ +jsworld._isNumber = function(arg) { + + if (typeof arg == "number") + return true; + + if (typeof arg != "string") + return false; + + // ensure string + var s = arg + ""; + + return (/^-?(\d+|\d*\.\d+)$/).test(s); +}; + + +/** + * @private + * + * @description Returns true if the argument represents a decimal integer. + * + * @param {Number|String} arg The argument to test. + * + * @returns {Boolean} true if the argument represents an integer, otherwise + * false. + */ +jsworld._isInteger = function(arg) { + + if (typeof arg != "number" && typeof arg != "string") + return false; + + // convert to string + var s = arg + ""; + + return (/^-?\d+$/).test(s); +}; + + +/** + * @private + * + * @description Returns true if the argument represents a decimal float. + * + * @param {Number|String} arg The argument to test. + * + * @returns {Boolean} true if the argument represents a float, otherwise false. + */ +jsworld._isFloat = function(arg) { + + if (typeof arg != "number" && typeof arg != "string") + return false; + + // convert to string + var s = arg + ""; + + return (/^-?\.\d+?$/).test(s); +}; + + +/** + * @private + * + * @description Checks if the specified formatting option is contained + * within the options string. + * + * @param {String} option The option to search for. + * @param {String} optionsString The options string. + * + * @returns {Boolean} true if the flag is found, else false + */ +jsworld._hasOption = function(option, optionsString) { + + if (typeof option != "string" || typeof optionsString != "string") + return false; + + if (optionsString.indexOf(option) != -1) + return true; + else + return false; +}; + + +/** + * @private + * + * @description String replacement function. + * + * @param {String} s The string to work on. + * @param {String} target The string to search for. + * @param {String} replacement The replacement. + * + * @returns {String} The new string. + */ +jsworld._stringReplaceAll = function(s, target, replacement) { + + var out; + + if (target.length == 1 && replacement.length == 1) { + // simple char/char case somewhat faster + out = ""; + + for (var i = 0; i < s.length; i++) { + + if (s.charAt(i) == target.charAt(0)) + out = out + replacement.charAt(0); + else + out = out + s.charAt(i); + } + + return out; + } + else { + // longer target and replacement strings + out = s; + + var index = out.indexOf(target); + + while (index != -1) { + + out = out.replace(target, replacement); + + index = out.indexOf(target); + } + + return out; + } +}; + + +/** + * @private + * + * @description Tests if a string starts with the specified substring. + * + * @param {String} testedString The string to test. + * @param {String} sub The string to match. + * + * @returns {Boolean} true if the test succeeds. + */ +jsworld._stringStartsWith = function (testedString, sub) { + + if (testedString.length < sub.length) + return false; + + for (var i = 0; i < sub.length; i++) { + if (testedString.charAt(i) != sub.charAt(i)) + return false; + } + + return true; +}; + + +/** + * @private + * + * @description Gets the requested precision from an options string. + * + *

Example: ".3" returns 3 decimal places precision. + * + * @param {String} optionsString The options string. + * + * @returns {integer Number} The requested precision, -1 if not specified. + */ +jsworld._getPrecision = function (optionsString) { + + if (typeof optionsString != "string") + return -1; + + var m = optionsString.match(/\.(\d)/); + if (m) + return parseInt(m[1], 10); + else + return -1; +}; + + +/** + * @private + * + * @description Takes a decimal numeric amount (optionally as string) and + * returns its integer and fractional parts packed into an object. + * + * @param {Number|String} amount The amount, e.g. "123.45" or "-56.78" + * + * @returns {object} Parsed amount object with properties: + * {String} integer : the integer part + * {String} fraction : the fraction part + */ +jsworld._splitNumber = function (amount) { + + if (typeof amount == "number") + amount = amount + ""; + + var obj = {}; + + // remove negative sign + if (amount.charAt(0) == "-") + amount = amount.substring(1); + + // split amount into integer and decimal parts + var amountParts = amount.split("."); + if (!amountParts[1]) + amountParts[1] = ""; // we need "" instead of null + + obj.integer = amountParts[0]; + obj.fraction = amountParts[1]; + + return obj; +}; + + +/** + * @private + * + * @description Formats the integer part using the specified grouping + * and thousands separator. + * + * @param {String} intPart The integer part of the amount, as string. + * @param {String} grouping The grouping definition. + * @param {String} thousandsSep The thousands separator. + * + * @returns {String} The formatted integer part. + */ +jsworld._formatIntegerPart = function (intPart, grouping, thousandsSep) { + + // empty separator string? no grouping? + // -> return immediately with no formatting! + if (thousandsSep == "" || grouping == "-1") + return intPart; + + // turn the semicolon-separated string of integers into an array + var groupSizes = grouping.split(";"); + + // the formatted output string + var out = ""; + + // the intPart string position to process next, + // start at string end, e.g. "10000000 0) { + + // get next group size (if any, otherwise keep last) + if (groupSizes.length > 0) + size = parseInt(groupSizes.shift(), 10); + + // int parse error? + if (isNaN(size)) + throw "Error: Invalid grouping"; + + // size is -1? -> no more grouping, so just copy string remainder + if (size == -1) { + out = intPart.substring(0, pos) + out; + break; + } + + pos -= size; // move to next sep. char. position + + // position underrun? -> just copy string remainder + if (pos < 1) { + out = intPart.substring(0, pos + size) + out; + break; + } + + // extract group and apply sep. char. + out = thousandsSep + intPart.substring(pos, pos + size) + out; + } + + return out; +}; + + +/** + * @private + * + * @description Formats the fractional part to the specified decimal + * precision. + * + * @param {String} fracPart The fractional part of the amount + * @param {integer Number} precision The desired decimal precision + * + * @returns {String} The formatted fractional part. + */ +jsworld._formatFractionPart = function (fracPart, precision) { + + // append zeroes up to precision if necessary + for (var i=0; fracPart.length < precision; i++) + fracPart = fracPart + "0"; + + return fracPart; +}; + + +/** + * @private + * + * @desription Converts a number to string and pad it with leading zeroes if the + * string is shorter than length. + * + * @param {integer Number} number The number value subjected to selective padding. + * @param {integer Number} length If the number has fewer digits than this length + * apply padding. + * + * @returns {String} The formatted string. + */ +jsworld._zeroPad = function(number, length) { + + // ensure string + var s = number + ""; + + while (s.length < length) + s = "0" + s; + + return s; +}; + + +/** + * @private + * @description Converts a number to string and pads it with leading spaces if + * the string is shorter than length. + * + * @param {integer Number} number The number value subjected to selective padding. + * @param {integer Number} length If the number has fewer digits than this length + * apply padding. + * + * @returns {String} The formatted string. + */ +jsworld._spacePad = function(number, length) { + + // ensure string + var s = number + ""; + + while (s.length < length) + s = " " + s; + + return s; +}; + + + +/** + * @class + * Represents a POSIX-style locale with its numeric, monetary and date/time + * properties. Also provides a set of locale helper methods. + * + *

The locale properties follow the POSIX standards: + * + *

+ * + * @public + * @constructor + * @description Creates a new locale object (POSIX-style) with the specified + * properties. + * + * @param {object} properties An object containing the raw locale properties: + * + * @param {String} properties.decimal_point + * + * A string containing the symbol that shall be used as the decimal + * delimiter (radix character) in numeric, non-monetary formatted + * quantities. This property cannot be omitted and cannot be set to the + * empty string. + * + * + * @param {String} properties.thousands_sep + * + * A string containing the symbol that shall be used as a separator for + * groups of digits to the left of the decimal delimiter in numeric, + * non-monetary formatted monetary quantities. + * + * + * @param {String} properties.grouping + * + * Defines the size of each group of digits in formatted non-monetary + * quantities. The operand is a sequence of integers separated by + * semicolons. Each integer specifies the number of digits in each group, + * with the initial integer defining the size of the group immediately + * preceding the decimal delimiter, and the following integers defining + * the preceding groups. If the last integer is not -1, then the size of + * the previous group (if any) shall be repeatedly used for the + * remainder of the digits. If the last integer is -1, then no further + * grouping shall be performed. + * + * + * @param {String} properties.int_curr_symbol + * + * The first three letters signify the ISO-4217 currency code, + * the fourth letter is the international symbol separation character + * (normally a space). + * + * + * @param {String} properties.currency_symbol + * + * The local shorthand currency symbol, e.g. "$" for the en_US locale + * + * + * @param {String} properties.mon_decimal_point + * + * The symbol to be used as the decimal delimiter (radix character) + * + * + * @param {String} properties.mon_thousands_sep + * + * The symbol to be used as a separator for groups of digits to the + * left of the decimal delimiter. + * + * + * @param {String} properties.mon_grouping + * + * A string that defines the size of each group of digits. The + * operand is a sequence of integers separated by semicolons (";"). + * Each integer specifies the number of digits in each group, with the + * initial integer defining the size of the group preceding the + * decimal delimiter, and the following integers defining the + * preceding groups. If the last integer is not -1, then the size of + * the previous group (if any) must be repeatedly used for the + * remainder of the digits. If the last integer is -1, then no + * further grouping is to be performed. + * + * + * @param {String} properties.positive_sign + * + * The string to indicate a non-negative monetary amount. + * + * + * @param {String} properties.negative_sign + * + * The string to indicate a negative monetary amount. + * + * + * @param {integer Number} properties.frac_digits + * + * An integer representing the number of fractional digits (those to + * the right of the decimal delimiter) to be written in a formatted + * monetary quantity using currency_symbol. + * + * + * @param {integer Number} properties.int_frac_digits + * + * An integer representing the number of fractional digits (those to + * the right of the decimal delimiter) to be written in a formatted + * monetary quantity using int_curr_symbol. + * + * + * @param {integer Number} properties.p_cs_precedes + * + * An integer set to 1 if the currency_symbol precedes the value for a + * monetary quantity with a non-negative value, and set to 0 if the + * symbol succeeds the value. + * + * + * @param {integer Number} properties.n_cs_precedes + * + * An integer set to 1 if the currency_symbol precedes the value for a + * monetary quantity with a negative value, and set to 0 if the symbol + * succeeds the value. + * + * + * @param {integer Number} properties.p_sep_by_space + * + * Set to a value indicating the separation of the currency_symbol, + * the sign string, and the value for a non-negative formatted monetary + * quantity: + * + *

0 No space separates the currency symbol and value.

+ * + *

1 If the currency symbol and sign string are adjacent, a space + * separates them from the value; otherwise, a space separates + * the currency symbol from the value.

+ * + *

2 If the currency symbol and sign string are adjacent, a space + * separates them; otherwise, a space separates the sign string + * from the value.

+ * + * + * @param {integer Number} properties.n_sep_by_space + * + * Set to a value indicating the separation of the currency_symbol, + * the sign string, and the value for a negative formatted monetary + * quantity. Rules same as for p_sep_by_space. + * + * + * @param {integer Number} properties.p_sign_posn + * + * An integer set to a value indicating the positioning of the + * positive_sign for a monetary quantity with a non-negative value: + * + *

0 Parentheses enclose the quantity and the currency_symbol.

+ * + *

1 The sign string precedes the quantity and the currency_symbol.

+ * + *

2 The sign string succeeds the quantity and the currency_symbol.

+ * + *

3 The sign string precedes the currency_symbol.

+ * + *

4 The sign string succeeds the currency_symbol.

+ * + * + * @param {integer Number} properties.n_sign_posn + * + * An integer set to a value indicating the positioning of the + * negative_sign for a negative formatted monetary quantity. Rules same + * as for p_sign_posn. + * + * + * @param {integer Number} properties.int_p_cs_precedes + * + * An integer set to 1 if the int_curr_symbol precedes the value for a + * monetary quantity with a non-negative value, and set to 0 if the + * symbol succeeds the value. + * + * + * @param {integer Number} properties.int_n_cs_precedes + * + * An integer set to 1 if the int_curr_symbol precedes the value for a + * monetary quantity with a negative value, and set to 0 if the symbol + * succeeds the value. + * + * + * @param {integer Number} properties.int_p_sep_by_space + * + * Set to a value indicating the separation of the int_curr_symbol, + * the sign string, and the value for a non-negative internationally + * formatted monetary quantity. Rules same as for p_sep_by_space. + * + * + * @param {integer Number} properties.int_n_sep_by_space + * + * Set to a value indicating the separation of the int_curr_symbol, + * the sign string, and the value for a negative internationally + * formatted monetary quantity. Rules same as for p_sep_by_space. + * + * + * @param {integer Number} properties.int_p_sign_posn + * + * An integer set to a value indicating the positioning of the + * positive_sign for a positive monetary quantity formatted with the + * international format. Rules same as for p_sign_posn. + * + * + * @param {integer Number} properties.int_n_sign_posn + * + * An integer set to a value indicating the positioning of the + * negative_sign for a negative monetary quantity formatted with the + * international format. Rules same as for p_sign_posn. + * + * + * @param {String[] | String} properties.abday + * + * The abbreviated weekday names, corresponding to the %a conversion + * specification. The property must be either an array of 7 strings or + * a string consisting of 7 semicolon-separated substrings, each + * surrounded by double-quotes. The first must be the abbreviated name + * of the day corresponding to Sunday, the second the abbreviated name + * of the day corresponding to Monday, and so on. + * + * + * @param {String[] | String} properties.day + * + * The full weekday names, corresponding to the %A conversion + * specification. The property must be either an array of 7 strings or + * a string consisting of 7 semicolon-separated substrings, each + * surrounded by double-quotes. The first must be the full name of the + * day corresponding to Sunday, the second the full name of the day + * corresponding to Monday, and so on. + * + * + * @param {String[] | String} properties.abmon + * + * The abbreviated month names, corresponding to the %b conversion + * specification. The property must be either an array of 12 strings or + * a string consisting of 12 semicolon-separated substrings, each + * surrounded by double-quotes. The first must be the abbreviated name + * of the first month of the year (January), the second the abbreviated + * name of the second month, and so on. + * + * + * @param {String[] | String} properties.mon + * + * The full month names, corresponding to the %B conversion + * specification. The property must be either an array of 12 strings or + * a string consisting of 12 semicolon-separated substrings, each + * surrounded by double-quotes. The first must be the full name of the + * first month of the year (January), the second the full name of the second + * month, and so on. + * + * + * @param {String} properties.d_fmt + * + * The appropriate date representation. The string may contain any + * combination of characters and conversion specifications (%). + * + * + * @param {String} properties.t_fmt + * + * The appropriate time representation. The string may contain any + * combination of characters and conversion specifications (%). + * + * + * @param {String} properties.d_t_fmt + * + * The appropriate date and time representation. The string may contain + * any combination of characters and conversion specifications (%). + * + * + * @param {String[] | String} properties.am_pm + * + * The appropriate representation of the ante-meridiem and post-meridiem + * strings, corresponding to the %p conversion specification. The property + * must be either an array of 2 strings or a string consisting of 2 + * semicolon-separated substrings, each surrounded by double-quotes. + * The first string must represent the ante-meridiem designation, the + * last string the post-meridiem designation. + * + * + * @throws @throws Error on a undefined or invalid locale property. + */ +jsworld.Locale = function(properties) { + + + /** + * @private + * + * @description Identifies the class for internal library purposes. + */ + this._className = "jsworld.Locale"; + + + /** + * @private + * + * @description Parses a day or month name definition list, which + * could be a ready JS array, e.g. ["Mon", "Tue", "Wed"...] or + * it could be a string formatted according to the classic POSIX + * definition e.g. "Mon";"Tue";"Wed";... + * + * @param {String[] | String} namesAn array or string defining + * the week/month names. + * @param {integer Number} expectedItems The number of expected list + * items, e.g. 7 for weekdays, 12 for months. + * + * @returns {String[]} The parsed (and checked) items. + * + * @throws Error on missing definition, unexpected item count or + * missing double-quotes. + */ + this._parseList = function(names, expectedItems) { + + var array = []; + + if (names == null) { + throw "Names not defined"; + } + else if (typeof names == "object") { + // we got a ready array + array = names; + } + else if (typeof names == "string") { + // we got the names in the classic POSIX form, do parse + array = names.split(";", expectedItems); + + for (var i = 0; i < array.length; i++) { + // check for and strip double quotes + if (array[i][0] == "\"" && array[i][array[i].length - 1] == "\"") + array[i] = array[i].slice(1, -1); + else + throw "Missing double quotes"; + } + } + else { + throw "Names must be an array or a string"; + } + + if (array.length != expectedItems) + throw "Expected " + expectedItems + " items, got " + array.length; + + return array; + }; + + + /** + * @private + * + * @description Validates a date/time format string, such as "H:%M:%S". + * Checks that the argument is of type "string" and is not empty. + * + * @param {String} formatString The format string. + * + * @returns {String} The validated string. + * + * @throws Error on null or empty string. + */ + this._validateFormatString = function(formatString) { + + if (typeof formatString == "string" && formatString.length > 0) + return formatString; + else + throw "Empty or no string"; + }; + + + // LC_NUMERIC + + if (properties == null || typeof properties != "object") + throw "Error: Invalid/missing locale properties"; + + + if (typeof properties.decimal_point != "string") + throw "Error: Invalid/missing decimal_point property"; + + this.decimal_point = properties.decimal_point; + + + if (typeof properties.thousands_sep != "string") + throw "Error: Invalid/missing thousands_sep property"; + + this.thousands_sep = properties.thousands_sep; + + + if (typeof properties.grouping != "string") + throw "Error: Invalid/missing grouping property"; + + this.grouping = properties.grouping; + + + // LC_MONETARY + + if (typeof properties.int_curr_symbol != "string") + throw "Error: Invalid/missing int_curr_symbol property"; + + if (! /[A-Za-z]{3}.?/.test(properties.int_curr_symbol)) + throw "Error: Invalid int_curr_symbol property"; + + this.int_curr_symbol = properties.int_curr_symbol; + + + if (typeof properties.currency_symbol != "string") + throw "Error: Invalid/missing currency_symbol property"; + + this.currency_symbol = properties.currency_symbol; + + + if (typeof properties.frac_digits != "number" && properties.frac_digits < 0) + throw "Error: Invalid/missing frac_digits property"; + + this.frac_digits = properties.frac_digits; + + + // may be empty string/null for currencies with no fractional part + if (properties.mon_decimal_point === null || properties.mon_decimal_point == "") { + + if (this.frac_digits > 0) + throw "Error: Undefined mon_decimal_point property"; + else + properties.mon_decimal_point = ""; + } + + if (typeof properties.mon_decimal_point != "string") + throw "Error: Invalid/missing mon_decimal_point property"; + + this.mon_decimal_point = properties.mon_decimal_point; + + + if (typeof properties.mon_thousands_sep != "string") + throw "Error: Invalid/missing mon_thousands_sep property"; + + this.mon_thousands_sep = properties.mon_thousands_sep; + + + if (typeof properties.mon_grouping != "string") + throw "Error: Invalid/missing mon_grouping property"; + + this.mon_grouping = properties.mon_grouping; + + + if (typeof properties.positive_sign != "string") + throw "Error: Invalid/missing positive_sign property"; + + this.positive_sign = properties.positive_sign; + + + if (typeof properties.negative_sign != "string") + throw "Error: Invalid/missing negative_sign property"; + + this.negative_sign = properties.negative_sign; + + + + if (properties.p_cs_precedes !== 0 && properties.p_cs_precedes !== 1) + throw "Error: Invalid/missing p_cs_precedes property, must be 0 or 1"; + + this.p_cs_precedes = properties.p_cs_precedes; + + + if (properties.n_cs_precedes !== 0 && properties.n_cs_precedes !== 1) + throw "Error: Invalid/missing n_cs_precedes, must be 0 or 1"; + + this.n_cs_precedes = properties.n_cs_precedes; + + + if (properties.p_sep_by_space !== 0 && + properties.p_sep_by_space !== 1 && + properties.p_sep_by_space !== 2) + throw "Error: Invalid/missing p_sep_by_space property, must be 0, 1 or 2"; + + this.p_sep_by_space = properties.p_sep_by_space; + + + if (properties.n_sep_by_space !== 0 && + properties.n_sep_by_space !== 1 && + properties.n_sep_by_space !== 2) + throw "Error: Invalid/missing n_sep_by_space property, must be 0, 1, or 2"; + + this.n_sep_by_space = properties.n_sep_by_space; + + + if (properties.p_sign_posn !== 0 && + properties.p_sign_posn !== 1 && + properties.p_sign_posn !== 2 && + properties.p_sign_posn !== 3 && + properties.p_sign_posn !== 4) + throw "Error: Invalid/missing p_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.p_sign_posn = properties.p_sign_posn; + + + if (properties.n_sign_posn !== 0 && + properties.n_sign_posn !== 1 && + properties.n_sign_posn !== 2 && + properties.n_sign_posn !== 3 && + properties.n_sign_posn !== 4) + throw "Error: Invalid/missing n_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.n_sign_posn = properties.n_sign_posn; + + + if (typeof properties.int_frac_digits != "number" && properties.int_frac_digits < 0) + throw "Error: Invalid/missing int_frac_digits property"; + + this.int_frac_digits = properties.int_frac_digits; + + + if (properties.int_p_cs_precedes !== 0 && properties.int_p_cs_precedes !== 1) + throw "Error: Invalid/missing int_p_cs_precedes property, must be 0 or 1"; + + this.int_p_cs_precedes = properties.int_p_cs_precedes; + + + if (properties.int_n_cs_precedes !== 0 && properties.int_n_cs_precedes !== 1) + throw "Error: Invalid/missing int_n_cs_precedes property, must be 0 or 1"; + + this.int_n_cs_precedes = properties.int_n_cs_precedes; + + + if (properties.int_p_sep_by_space !== 0 && + properties.int_p_sep_by_space !== 1 && + properties.int_p_sep_by_space !== 2) + throw "Error: Invalid/missing int_p_sep_by_spacev, must be 0, 1 or 2"; + + this.int_p_sep_by_space = properties.int_p_sep_by_space; + + + if (properties.int_n_sep_by_space !== 0 && + properties.int_n_sep_by_space !== 1 && + properties.int_n_sep_by_space !== 2) + throw "Error: Invalid/missing int_n_sep_by_space property, must be 0, 1, or 2"; + + this.int_n_sep_by_space = properties.int_n_sep_by_space; + + + if (properties.int_p_sign_posn !== 0 && + properties.int_p_sign_posn !== 1 && + properties.int_p_sign_posn !== 2 && + properties.int_p_sign_posn !== 3 && + properties.int_p_sign_posn !== 4) + throw "Error: Invalid/missing int_p_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.int_p_sign_posn = properties.int_p_sign_posn; + + + if (properties.int_n_sign_posn !== 0 && + properties.int_n_sign_posn !== 1 && + properties.int_n_sign_posn !== 2 && + properties.int_n_sign_posn !== 3 && + properties.int_n_sign_posn !== 4) + throw "Error: Invalid/missing int_n_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.int_n_sign_posn = properties.int_n_sign_posn; + + + // LC_TIME + + if (properties == null || typeof properties != "object") + throw "Error: Invalid/missing time locale properties"; + + + // parse the supported POSIX LC_TIME properties + + // abday + try { + this.abday = this._parseList(properties.abday, 7); + } + catch (error) { + throw "Error: Invalid abday property: " + error; + } + + // day + try { + this.day = this._parseList(properties.day, 7); + } + catch (error) { + throw "Error: Invalid day property: " + error; + } + + // abmon + try { + this.abmon = this._parseList(properties.abmon, 12); + } catch (error) { + throw "Error: Invalid abmon property: " + error; + } + + // mon + try { + this.mon = this._parseList(properties.mon, 12); + } catch (error) { + throw "Error: Invalid mon property: " + error; + } + + // d_fmt + try { + this.d_fmt = this._validateFormatString(properties.d_fmt); + } catch (error) { + throw "Error: Invalid d_fmt property: " + error; + } + + // t_fmt + try { + this.t_fmt = this._validateFormatString(properties.t_fmt); + } catch (error) { + throw "Error: Invalid t_fmt property: " + error; + } + + // d_t_fmt + try { + this.d_t_fmt = this._validateFormatString(properties.d_t_fmt); + } catch (error) { + throw "Error: Invalid d_t_fmt property: " + error; + } + + // am_pm + try { + var am_pm_strings = this._parseList(properties.am_pm, 2); + this.am = am_pm_strings[0]; + this.pm = am_pm_strings[1]; + } catch (error) { + // ignore empty/null string errors + this.am = ""; + this.pm = ""; + } + + + /** + * @public + * + * @description Returns the abbreviated name of the specified weekday. + * + * @param {integer Number} [weekdayNum] An integer between 0 and 6. Zero + * corresponds to Sunday, one to Monday, etc. If omitted the + * method will return an array of all abbreviated weekday + * names. + * + * @returns {String | String[]} The abbreviated name of the specified weekday + * or an array of all abbreviated weekday names. + * + * @throws Error on invalid argument. + */ + this.getAbbreviatedWeekdayName = function(weekdayNum) { + + if (typeof weekdayNum == "undefined" || weekdayNum === null) + return this.abday; + + if (! jsworld._isInteger(weekdayNum) || weekdayNum < 0 || weekdayNum > 6) + throw "Error: Invalid weekday argument, must be an integer [0..6]"; + + return this.abday[weekdayNum]; + }; + + + /** + * @public + * + * @description Returns the name of the specified weekday. + * + * @param {integer Number} [weekdayNum] An integer between 0 and 6. Zero + * corresponds to Sunday, one to Monday, etc. If omitted the + * method will return an array of all weekday names. + * + * @returns {String | String[]} The name of the specified weekday or an + * array of all weekday names. + * + * @throws Error on invalid argument. + */ + this.getWeekdayName = function(weekdayNum) { + + if (typeof weekdayNum == "undefined" || weekdayNum === null) + return this.day; + + if (! jsworld._isInteger(weekdayNum) || weekdayNum < 0 || weekdayNum > 6) + throw "Error: Invalid weekday argument, must be an integer [0..6]"; + + return this.day[weekdayNum]; + }; + + + /** + * @public + * + * @description Returns the abbreviated name of the specified month. + * + * @param {integer Number} [monthNum] An integer between 0 and 11. Zero + * corresponds to January, one to February, etc. If omitted the + * method will return an array of all abbreviated month names. + * + * @returns {String | String[]} The abbreviated name of the specified month + * or an array of all abbreviated month names. + * + * @throws Error on invalid argument. + */ + this.getAbbreviatedMonthName = function(monthNum) { + + if (typeof monthNum == "undefined" || monthNum === null) + return this.abmon; + + if (! jsworld._isInteger(monthNum) || monthNum < 0 || monthNum > 11) + throw "Error: Invalid month argument, must be an integer [0..11]"; + + return this.abmon[monthNum]; + }; + + + /** + * @public + * + * @description Returns the name of the specified month. + * + * @param {integer Number} [monthNum] An integer between 0 and 11. Zero + * corresponds to January, one to February, etc. If omitted the + * method will return an array of all month names. + * + * @returns {String | String[]} The name of the specified month or an array + * of all month names. + * + * @throws Error on invalid argument. + */ + this.getMonthName = function(monthNum) { + + if (typeof monthNum == "undefined" || monthNum === null) + return this.mon; + + if (! jsworld._isInteger(monthNum) || monthNum < 0 || monthNum > 11) + throw "Error: Invalid month argument, must be an integer [0..11]"; + + return this.mon[monthNum]; + }; + + + + /** + * @public + * + * @description Gets the decimal delimiter (radix) character for + * numeric quantities. + * + * @returns {String} The radix character. + */ + this.getDecimalPoint = function() { + + return this.decimal_point; + }; + + + /** + * @public + * + * @description Gets the local shorthand currency symbol. + * + * @returns {String} The currency symbol. + */ + this.getCurrencySymbol = function() { + + return this.currency_symbol; + }; + + + /** + * @public + * + * @description Gets the internaltion currency symbol (ISO-4217 code). + * + * @returns {String} The international currency symbol. + */ + this.getIntCurrencySymbol = function() { + + return this.int_curr_symbol.substring(0,3); + }; + + + /** + * @public + * + * @description Gets the position of the local (shorthand) currency + * symbol relative to the amount. Assumes a non-negative amount. + * + * @returns {Boolean} True if the symbol precedes the amount, false if + * the symbol succeeds the amount. + */ + this.currencySymbolPrecedes = function() { + + if (this.p_cs_precedes == 1) + return true; + else + return false; + }; + + + /** + * @public + * + * @description Gets the position of the international (ISO-4217 code) + * currency symbol relative to the amount. Assumes a non-negative + * amount. + * + * @returns {Boolean} True if the symbol precedes the amount, false if + * the symbol succeeds the amount. + */ + this.intCurrencySymbolPrecedes = function() { + + if (this.int_p_cs_precedes == 1) + return true; + else + return false; + + }; + + + /** + * @public + * + * @description Gets the decimal delimiter (radix) for monetary + * quantities. + * + * @returns {String} The radix character. + */ + this.getMonetaryDecimalPoint = function() { + + return this.mon_decimal_point; + }; + + + /** + * @public + * + * @description Gets the number of fractional digits for local + * (shorthand) symbol formatting. + * + * @returns {integer Number} The number of fractional digits. + */ + this.getFractionalDigits = function() { + + return this.frac_digits; + }; + + + /** + * @public + * + * @description Gets the number of fractional digits for + * international (ISO-4217 code) formatting. + * + * @returns {integer Number} The number of fractional digits. + */ + this.getIntFractionalDigits = function() { + + return this.int_frac_digits; + }; +}; + + + +/** + * @class + * Class for localised formatting of numbers. + * + *

See: + * POSIX LC_NUMERIC. + * + * + * @public + * @constructor + * @description Creates a new numeric formatter for the specified locale. + * + * @param {jsworld.Locale} locale A locale object specifying the required + * POSIX LC_NUMERIC formatting properties. + * + * @throws Error on constructor failure. + */ +jsworld.NumericFormatter = function(locale) { + + if (typeof locale != "object" || locale._className != "jsworld.Locale") + throw "Constructor error: You must provide a valid jsworld.Locale instance"; + + this.lc = locale; + + + /** + * @public + * + * @description Formats a decimal numeric value according to the preset + * locale. + * + * @param {Number|String} number The number to format. + * @param {String} [options] Options to modify the formatted output: + *

    + *
  • "^" suppress grouping + *
  • "+" force positive sign for positive amounts + *
  • "~" suppress positive/negative sign + *
  • ".n" specify decimal precision 'n' + *
+ * + * @returns {String} The formatted number. + * + * @throws "Error: Invalid input" on bad input. + */ + this.format = function(number, options) { + + if (typeof number == "string") + number = jsworld._trim(number); + + if (! jsworld._isNumber(number)) + throw "Error: The input is not a number"; + + var floatAmount = parseFloat(number, 10); + + // get the required precision + var reqPrecision = jsworld._getPrecision(options); + + // round to required precision + if (reqPrecision != -1) + floatAmount = Math.round(floatAmount * Math.pow(10, reqPrecision)) / Math.pow(10, reqPrecision); + + + // convert the float number to string and parse into + // object with properties integer and fraction + var parsedAmount = jsworld._splitNumber(String(floatAmount)); + + // format integer part with grouping chars + var formattedIntegerPart; + + if (floatAmount === 0) + formattedIntegerPart = "0"; + else + formattedIntegerPart = jsworld._hasOption("^", options) ? + parsedAmount.integer : + jsworld._formatIntegerPart(parsedAmount.integer, + this.lc.grouping, + this.lc.thousands_sep); + + // format the fractional part + var formattedFractionPart = + reqPrecision != -1 ? + jsworld._formatFractionPart(parsedAmount.fraction, reqPrecision) : + parsedAmount.fraction; + + + // join the integer and fraction parts using the decimal_point property + var formattedAmount = + formattedFractionPart.length ? + formattedIntegerPart + this.lc.decimal_point + formattedFractionPart : + formattedIntegerPart; + + // prepend sign? + if (jsworld._hasOption("~", options) || floatAmount === 0) { + // suppress both '+' and '-' signs, i.e. return abs value + return formattedAmount; + } + else { + if (jsworld._hasOption("+", options) || floatAmount < 0) { + if (floatAmount > 0) + // force '+' sign for positive amounts + return "+" + formattedAmount; + else if (floatAmount < 0) + // prepend '-' sign + return "-" + formattedAmount; + else + // zero case + return formattedAmount; + } + else { + // positive amount with no '+' sign + return formattedAmount; + } + } + }; +}; + + +/** + * @class + * Class for localised formatting of dates and times. + * + *

See: + * POSIX LC_TIME. + * + * @public + * @constructor + * @description Creates a new date/time formatter for the specified locale. + * + * @param {jsworld.Locale} locale A locale object specifying the required + * POSIX LC_TIME formatting properties. + * + * @throws Error on constructor failure. + */ +jsworld.DateTimeFormatter = function(locale) { + + + if (typeof locale != "object" || locale._className != "jsworld.Locale") + throw "Constructor error: You must provide a valid jsworld.Locale instance."; + + this.lc = locale; + + + /** + * @public + * + * @description Formats a date according to the preset locale. + * + * @param {Date|String} date A valid Date object instance or a string + * containing a valid ISO-8601 formatted date, e.g. "2010-31-03" + * or "2010-03-31 23:59:59". + * + * @returns {String} The formatted date + * + * @throws Error on invalid date argument + */ + this.formatDate = function(date) { + + var d = null; + + if (typeof date == "string") { + // assume ISO-8601 date string + try { + d = jsworld.parseIsoDate(date); + } catch (error) { + // try full ISO-8601 date/time string + d = jsworld.parseIsoDateTime(date); + } + } + else if (date !== null && typeof date == "object") { + // assume ready Date object + d = date; + } + else { + throw "Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"; + } + + return this._applyFormatting(d, this.lc.d_fmt); + }; + + + /** + * @public + * + * @description Formats a time according to the preset locale. + * + * @param {Date|String} date A valid Date object instance or a string + * containing a valid ISO-8601 formatted time, e.g. "23:59:59" + * or "2010-03-31 23:59:59". + * + * @returns {String} The formatted time. + * + * @throws Error on invalid date argument. + */ + this.formatTime = function(date) { + + var d = null; + + if (typeof date == "string") { + // assume ISO-8601 time string + try { + d = jsworld.parseIsoTime(date); + } catch (error) { + // try full ISO-8601 date/time string + d = jsworld.parseIsoDateTime(date); + } + } + else if (date !== null && typeof date == "object") { + // assume ready Date object + d = date; + } + else { + throw "Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"; + } + + return this._applyFormatting(d, this.lc.t_fmt); + }; + + + /** + * @public + * + * @description Formats a date/time value according to the preset + * locale. + * + * @param {Date|String} date A valid Date object instance or a string + * containing a valid ISO-8601 formatted date/time, e.g. + * "2010-03-31 23:59:59". + * + * @returns {String} The formatted time. + * + * @throws Error on invalid argument. + */ + this.formatDateTime = function(date) { + + var d = null; + + if (typeof date == "string") { + // assume ISO-8601 format + d = jsworld.parseIsoDateTime(date); + } + else if (date !== null && typeof date == "object") { + // assume ready Date object + d = date; + } + else { + throw "Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"; + } + + return this._applyFormatting(d, this.lc.d_t_fmt); + }; + + + /** + * @private + * + * @description Apples formatting to the Date object according to the + * format string. + * + * @param {Date} d A valid Date instance. + * @param {String} s The formatting string with '%' placeholders. + * + * @returns {String} The formatted string. + */ + this._applyFormatting = function(d, s) { + + s = s.replace(/%%/g, '%'); + s = s.replace(/%a/g, this.lc.abday[d.getDay()]); + s = s.replace(/%A/g, this.lc.day[d.getDay()]); + s = s.replace(/%b/g, this.lc.abmon[d.getMonth()]); + s = s.replace(/%B/g, this.lc.mon[d.getMonth()]); + s = s.replace(/%d/g, jsworld._zeroPad(d.getDate(), 2)); + s = s.replace(/%e/g, jsworld._spacePad(d.getDate(), 2)); + s = s.replace(/%F/g, d.getFullYear() + + "-" + + jsworld._zeroPad(d.getMonth()+1, 2) + + "-" + + jsworld._zeroPad(d.getDate(), 2)); + s = s.replace(/%h/g, this.lc.abmon[d.getMonth()]); // same as %b + s = s.replace(/%H/g, jsworld._zeroPad(d.getHours(), 2)); + s = s.replace(/%I/g, jsworld._zeroPad(this._hours12(d.getHours()), 2)); + s = s.replace(/%k/g, d.getHours()); + s = s.replace(/%l/g, this._hours12(d.getHours())); + s = s.replace(/%m/g, jsworld._zeroPad(d.getMonth()+1, 2)); + s = s.replace(/%n/g, "\n"); + s = s.replace(/%M/g, jsworld._zeroPad(d.getMinutes(), 2)); + s = s.replace(/%p/g, this._getAmPm(d.getHours())); + s = s.replace(/%P/g, this._getAmPm(d.getHours()).toLocaleLowerCase()); // safe? + s = s.replace(/%R/g, jsworld._zeroPad(d.getHours(), 2) + + ":" + + jsworld._zeroPad(d.getMinutes(), 2)); + s = s.replace(/%S/g, jsworld._zeroPad(d.getSeconds(), 2)); + s = s.replace(/%T/g, jsworld._zeroPad(d.getHours(), 2) + + ":" + + jsworld._zeroPad(d.getMinutes(), 2) + + ":" + + jsworld._zeroPad(d.getSeconds(), 2)); + s = s.replace(/%w/g, this.lc.day[d.getDay()]); + s = s.replace(/%y/g, new String(d.getFullYear()).substring(2)); + s = s.replace(/%Y/g, d.getFullYear()); + + s = s.replace(/%Z/g, ""); // to do: ignored until a reliable TMZ method found + + s = s.replace(/%[a-zA-Z]/g, ""); // ignore all other % sequences + + return s; + }; + + + /** + * @private + * + * @description Does 24 to 12 hour conversion. + * + * @param {integer Number} hour24 Hour [0..23]. + * + * @returns {integer Number} Corresponding hour [1..12]. + */ + this._hours12 = function(hour24) { + + if (hour24 === 0) + return 12; // 00h is 12AM + + else if (hour24 > 12) + return hour24 - 12; // 1PM to 11PM + + else + return hour24; // 1AM to 12PM + }; + + + /** + * @private + * + * @description Gets the appropriate localised AM or PM string depending + * on the day hour. Special cases: midnight is 12AM, noon is 12PM. + * + * @param {integer Number} hour24 Hour [0..23]. + * + * @returns {String} The corresponding localised AM or PM string. + */ + this._getAmPm = function(hour24) { + + if (hour24 < 12) + return this.lc.am; + else + return this.lc.pm; + }; +}; + + + +/** + * @class Class for localised formatting of currency amounts. + * + *

See: + * POSIX LC_MONETARY. + * + * @public + * @constructor + * @description Creates a new monetary formatter for the specified locale. + * + * @param {jsworld.Locale} locale A locale object specifying the required + * POSIX LC_MONETARY formatting properties. + * @param {String} [currencyCode] Set the currency explicitly by + * passing its international ISO-4217 code, e.g. "USD", "EUR", "GBP". + * Use this optional parameter to override the default local currency + * @param {String} [altIntSymbol] Non-local currencies are formatted + * with their international ISO-4217 code to prevent ambiguity. + * Use this optional argument to force a different symbol, such as the + * currency's shorthand sign. This is mostly useful when the shorthand + * sign is both internationally recognised and identifies the currency + * uniquely (e.g. the Euro sign). + * + * @throws Error on constructor failure. + */ +jsworld.MonetaryFormatter = function(locale, currencyCode, altIntSymbol) { + + if (typeof locale != "object" || locale._className != "jsworld.Locale") + throw "Constructor error: You must provide a valid jsworld.Locale instance"; + + this.lc = locale; + + /** + * @private + * @description Lookup table to determine the fraction digits for a + * specific currency; most currencies subdivide at 1/100 (2 fractional + * digits), so we store only those that deviate from the default. + * + *

The data is from Unicode's CLDR version 1.7.0. The two currencies + * with non-decimal subunits (MGA and MRO) are marked as having no + * fractional digits as well as all currencies that have no subunits + * in circulation. + * + *

It is "hard-wired" for referential convenience and is only looked + * up when an overriding currencyCode parameter is supplied. + */ + this.currencyFractionDigits = { + "AFN" : 0, "ALL" : 0, "AMD" : 0, "BHD" : 3, "BIF" : 0, + "BYR" : 0, "CLF" : 0, "CLP" : 0, "COP" : 0, "CRC" : 0, + "DJF" : 0, "GNF" : 0, "GYD" : 0, "HUF" : 0, "IDR" : 0, + "IQD" : 0, "IRR" : 0, "ISK" : 0, "JOD" : 3, "JPY" : 0, + "KMF" : 0, "KRW" : 0, "KWD" : 3, "LAK" : 0, "LBP" : 0, + "LYD" : 3, "MGA" : 0, "MMK" : 0, "MNT" : 0, "MRO" : 0, + "MUR" : 0, "OMR" : 3, "PKR" : 0, "PYG" : 0, "RSD" : 0, + "RWF" : 0, "SLL" : 0, "SOS" : 0, "STD" : 0, "SYP" : 0, + "TND" : 3, "TWD" : 0, "TZS" : 0, "UGX" : 0, "UZS" : 0, + "VND" : 0, "VUV" : 0, "XAF" : 0, "XOF" : 0, "XPF" : 0, + "YER" : 0, "ZMK" : 0 + }; + + + // optional currencyCode argument? + if (typeof currencyCode == "string") { + // user wanted to override the local currency + this.currencyCode = currencyCode.toUpperCase(); + + // must override the frac digits too, for some + // currencies have 0, 2 or 3! + var numDigits = this.currencyFractionDigits[this.currencyCode]; + if (typeof numDigits != "number") + numDigits = 2; // default for most currencies + this.lc.frac_digits = numDigits; + this.lc.int_frac_digits = numDigits; + } + else { + // use local currency + this.currencyCode = this.lc.int_curr_symbol.substring(0,3).toUpperCase(); + } + + // extract intl. currency separator + this.intSep = this.lc.int_curr_symbol.charAt(3); + + // flag local or intl. sign formatting? + if (this.currencyCode == this.lc.int_curr_symbol.substring(0,3)) { + // currency matches the local one? -> + // formatting with local symbol and parameters + this.internationalFormatting = false; + this.curSym = this.lc.currency_symbol; + } + else { + // currency doesn't match the local -> + + // do we have an overriding currency symbol? + if (typeof altIntSymbol == "string") { + // -> force formatting with local parameters, using alt symbol + this.curSym = altIntSymbol; + this.internationalFormatting = false; + } + else { + // -> force formatting with intl. sign and parameters + this.internationalFormatting = true; + } + } + + + /** + * @public + * + * @description Gets the currency symbol used in formatting. + * + * @returns {String} The currency symbol. + */ + this.getCurrencySymbol = function() { + + return this.curSym; + }; + + + /** + * @public + * + * @description Gets the position of the currency symbol relative to + * the amount. Assumes a non-negative amount and local formatting. + * + * @param {String} intFlag Optional flag to force international + * formatting by passing the string "i". + * + * @returns {Boolean} True if the symbol precedes the amount, false if + * the symbol succeeds the amount. + */ + this.currencySymbolPrecedes = function(intFlag) { + + if (typeof intFlag == "string" && intFlag == "i") { + // international formatting was forced + if (this.lc.int_p_cs_precedes == 1) + return true; + else + return false; + + } + else { + // check whether local formatting is on or off + if (this.internationalFormatting) { + if (this.lc.int_p_cs_precedes == 1) + return true; + else + return false; + } + else { + if (this.lc.p_cs_precedes == 1) + return true; + else + return false; + } + } + }; + + + /** + * @public + * + * @description Gets the decimal delimiter (radix) used in formatting. + * + * @returns {String} The radix character. + */ + this.getDecimalPoint = function() { + + return this.lc.mon_decimal_point; + }; + + + /** + * @public + * + * @description Gets the number of fractional digits. Assumes local + * formatting. + * + * @param {String} intFlag Optional flag to force international + * formatting by passing the string "i". + * + * @returns {integer Number} The number of fractional digits. + */ + this.getFractionalDigits = function(intFlag) { + + if (typeof intFlag == "string" && intFlag == "i") { + // international formatting was forced + return this.lc.int_frac_digits; + } + else { + // check whether local formatting is on or off + if (this.internationalFormatting) + return this.lc.int_frac_digits; + else + return this.lc.frac_digits; + } + }; + + + /** + * @public + * + * @description Formats a monetary amount according to the preset + * locale. + * + *

+	 * For local currencies the native shorthand symbol will be used for
+	 * formatting.
+	 * Example:
+	 *        locale is en_US
+	 *        currency is USD
+	 *        -> the "$" symbol will be used, e.g. $123.45
+	 *        
+	 * For non-local currencies the international ISO-4217 code will be
+	 * used for formatting.
+	 * Example:
+	 *       locale is en_US (which has USD as currency)
+	 *       currency is EUR
+	 *       -> the ISO three-letter code will be used, e.g. EUR 123.45
+	 *
+	 * If the currency is non-local, but an alternative currency symbol was
+	 * provided, this will be used instead.
+	 * Example
+	 *       locale is en_US (which has USD as currency)
+	 *       currency is EUR
+	 *       an alternative symbol is provided - "€"
+	 *       -> the alternative symbol will be used, e.g. €123.45
+	 * 
+ * + * @param {Number|String} amount The amount to format as currency. + * @param {String} [options] Options to modify the formatted output: + *
    + *
  • "^" suppress grouping + *
  • "!" suppress the currency symbol + *
  • "~" suppress the currency symbol and the sign (positive or negative) + *
  • "i" force international sign (ISO-4217 code) formatting + *
  • ".n" specify decimal precision + * + * @returns The formatted currency amount as string. + * + * @throws "Error: Invalid amount" on bad amount. + */ + this.format = function(amount, options) { + + // if the amount is passed as string, check that it parses to a float + var floatAmount; + + if (typeof amount == "string") { + amount = jsworld._trim(amount); + floatAmount = parseFloat(amount); + + if (typeof floatAmount != "number" || isNaN(floatAmount)) + throw "Error: Amount string not a number"; + } + else if (typeof amount == "number") { + floatAmount = amount; + } + else { + throw "Error: Amount not a number"; + } + + // get the required precision, ".n" option arg overrides default locale config + var reqPrecision = jsworld._getPrecision(options); + + if (reqPrecision == -1) { + if (this.internationalFormatting || jsworld._hasOption("i", options)) + reqPrecision = this.lc.int_frac_digits; + else + reqPrecision = this.lc.frac_digits; + } + + // round + floatAmount = Math.round(floatAmount * Math.pow(10, reqPrecision)) / Math.pow(10, reqPrecision); + + + // convert the float amount to string and parse into + // object with properties integer and fraction + var parsedAmount = jsworld._splitNumber(String(floatAmount)); + + // format integer part with grouping chars + var formattedIntegerPart; + + if (floatAmount === 0) + formattedIntegerPart = "0"; + else + formattedIntegerPart = jsworld._hasOption("^", options) ? + parsedAmount.integer : + jsworld._formatIntegerPart(parsedAmount.integer, + this.lc.mon_grouping, + this.lc.mon_thousands_sep); + + + // format the fractional part + var formattedFractionPart; + + if (reqPrecision == -1) { + // pad fraction with trailing zeros accoring to default locale [int_]frac_digits + if (this.internationalFormatting || jsworld._hasOption("i", options)) + formattedFractionPart = + jsworld._formatFractionPart(parsedAmount.fraction, this.lc.int_frac_digits); + else + formattedFractionPart = + jsworld._formatFractionPart(parsedAmount.fraction, this.lc.frac_digits); + } + else { + // pad fraction with trailing zeros according to optional format parameter + formattedFractionPart = + jsworld._formatFractionPart(parsedAmount.fraction, reqPrecision); + } + + + // join integer and decimal parts using the mon_decimal_point property + var quantity; + + if (this.lc.frac_digits > 0 || formattedFractionPart.length) + quantity = formattedIntegerPart + this.lc.mon_decimal_point + formattedFractionPart; + else + quantity = formattedIntegerPart; + + + // do final formatting with sign and symbol + if (jsworld._hasOption("~", options)) { + return quantity; + } + else { + var suppressSymbol = jsworld._hasOption("!", options) ? true : false; + + var sign = floatAmount < 0 ? "-" : "+"; + + if (this.internationalFormatting || jsworld._hasOption("i", options)) { + + // format with ISO-4217 code (suppressed or not) + if (suppressSymbol) + return this._formatAsInternationalCurrencyWithNoSym(sign, quantity); + else + return this._formatAsInternationalCurrency(sign, quantity); + } + else { + // format with local currency code (suppressed or not) + if (suppressSymbol) + return this._formatAsLocalCurrencyWithNoSym(sign, quantity); + else + return this._formatAsLocalCurrency(sign, quantity); + } + } + }; + + + /** + * @private + * + * @description Assembles the final string with sign, separator and symbol as local + * currency. + * + * @param {String} sign The amount sign: "+" or "-". + * @param {String} q The formatted quantity (unsigned). + * + * @returns {String} The final formatted string. + */ + this._formatAsLocalCurrency = function (sign, q) { + + // assemble final formatted amount by going over all possible value combinations of: + // sign {+,-} , sign position {0,1,2,3,4} , separator {0,1,2} , symbol position {0,1} + if (sign == "+") { + + // parentheses + if (this.lc.p_sign_posn === 0 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return "(" + q + this.curSym + ")"; + } + else if (this.lc.p_sign_posn === 0 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return "(" + this.curSym + q + ")"; + } + else if (this.lc.p_sign_posn === 0 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return "(" + q + " " + this.curSym + ")"; + } + else if (this.lc.p_sign_posn === 0 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return "(" + this.curSym + " " + q + ")"; + } + + // sign before q + sym + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return this.lc.positive_sign + q + this.curSym; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + this.curSym + q; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return this.lc.positive_sign + q + " " + this.curSym; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + this.curSym + " " + q; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return this.lc.positive_sign + " " + q + this.curSym; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + " " + this.curSym + q; + } + + // sign after q + sym + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return q + this.curSym + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return this.curSym + q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return q + " " + this.curSym + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return this.curSym + " " + q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return q + this.curSym + " " + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return this.curSym + q + " " + this.lc.positive_sign; + } + + // sign before sym + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return q + this.lc.positive_sign + this.curSym; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + this.curSym + q; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return q + " " + this.lc.positive_sign + this.curSym; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + this.curSym + " " + q; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return q + this.lc.positive_sign + " " + this.curSym; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + " " + this.curSym + q; + } + + // sign after symbol + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return q + this.curSym + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return this.curSym + this.lc.positive_sign + q; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return q + " " + this.curSym + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return this.curSym + this.lc.positive_sign + " " + q; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return q + this.curSym + " " + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return this.curSym + " " + this.lc.positive_sign + q; + } + + } + else if (sign == "-") { + + // parentheses enclose q + sym + if (this.lc.n_sign_posn === 0 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return "(" + q + this.curSym + ")"; + } + else if (this.lc.n_sign_posn === 0 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return "(" + this.curSym + q + ")"; + } + else if (this.lc.n_sign_posn === 0 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return "(" + q + " " + this.curSym + ")"; + } + else if (this.lc.n_sign_posn === 0 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return "(" + this.curSym + " " + q + ")"; + } + + // sign before q + sym + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return this.lc.negative_sign + q + this.curSym; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + this.curSym + q; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return this.lc.negative_sign + q + " " + this.curSym; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + this.curSym + " " + q; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return this.lc.negative_sign + " " + q + this.curSym; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + " " + this.curSym + q; + } + + // sign after q + sym + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return q + this.curSym + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return this.curSym + q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return q + " " + this.curSym + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return this.curSym + " " + q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return q + this.curSym + " " + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return this.curSym + q + " " + this.lc.negative_sign; + } + + // sign before sym + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return q + this.lc.negative_sign + this.curSym; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + this.curSym + q; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return q + " " + this.lc.negative_sign + this.curSym; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + this.curSym + " " + q; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return q + this.lc.negative_sign + " " + this.curSym; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + " " + this.curSym + q; + } + + // sign after symbol + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return q + this.curSym + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return this.curSym + this.lc.negative_sign + q; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return q + " " + this.curSym + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return this.curSym + this.lc.negative_sign + " " + q; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return q + this.curSym + " " + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return this.curSym + " " + this.lc.negative_sign + q; + } + } + + // throw error if we fall through + throw "Error: Invalid POSIX LC MONETARY definition"; + }; + + + /** + * @private + * + * @description Assembles the final string with sign, separator and ISO-4217 + * currency code. + * + * @param {String} sign The amount sign: "+" or "-". + * @param {String} q The formatted quantity (unsigned). + * + * @returns {String} The final formatted string. + */ + this._formatAsInternationalCurrency = function (sign, q) { + + // assemble the final formatted amount by going over all possible value combinations of: + // sign {+,-} , sign position {0,1,2,3,4} , separator {0,1,2} , symbol position {0,1} + + if (sign == "+") { + + // parentheses + if (this.lc.int_p_sign_posn === 0 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return "(" + q + this.currencyCode + ")"; + } + else if (this.lc.int_p_sign_posn === 0 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return "(" + this.currencyCode + q + ")"; + } + else if (this.lc.int_p_sign_posn === 0 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return "(" + q + this.intSep + this.currencyCode + ")"; + } + else if (this.lc.int_p_sign_posn === 0 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return "(" + this.currencyCode + this.intSep + q + ")"; + } + + // sign before q + sym + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return this.lc.positive_sign + q + this.currencyCode; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.currencyCode + q; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return this.lc.positive_sign + q + this.intSep + this.currencyCode; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.currencyCode + this.intSep + q; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return this.lc.positive_sign + this.intSep + q + this.currencyCode; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.intSep + this.currencyCode + q; + } + + // sign after q + sym + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return q + this.currencyCode + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return this.currencyCode + q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.currencyCode + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return this.currencyCode + this.intSep + q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return q + this.currencyCode + this.intSep + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return this.currencyCode + q + this.intSep + this.lc.positive_sign; + } + + // sign before sym + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return q + this.lc.positive_sign + this.currencyCode; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.currencyCode + q; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.lc.positive_sign + this.currencyCode; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.currencyCode + this.intSep + q; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return q + this.lc.positive_sign + this.intSep + this.currencyCode; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.intSep + this.currencyCode + q; + } + + // sign after symbol + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return q + this.currencyCode + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return this.currencyCode + this.lc.positive_sign + q; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.currencyCode + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return this.currencyCode + this.lc.positive_sign + this.intSep + q; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return q + this.currencyCode + this.intSep + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return this.currencyCode + this.intSep + this.lc.positive_sign + q; + } + + } + else if (sign == "-") { + + // parentheses enclose q + sym + if (this.lc.int_n_sign_posn === 0 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return "(" + q + this.currencyCode + ")"; + } + else if (this.lc.int_n_sign_posn === 0 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return "(" + this.currencyCode + q + ")"; + } + else if (this.lc.int_n_sign_posn === 0 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return "(" + q + this.intSep + this.currencyCode + ")"; + } + else if (this.lc.int_n_sign_posn === 0 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return "(" + this.currencyCode + this.intSep + q + ")"; + } + + // sign before q + sym + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return this.lc.negative_sign + q + this.currencyCode; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.currencyCode + q; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return this.lc.negative_sign + q + this.intSep + this.currencyCode; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.currencyCode + this.intSep + q; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return this.lc.negative_sign + this.intSep + q + this.currencyCode; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.intSep + this.currencyCode + q; + } + + // sign after q + sym + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return q + this.currencyCode + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return this.currencyCode + q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.currencyCode + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return this.currencyCode + this.intSep + q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return q + this.currencyCode + this.intSep + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return this.currencyCode + q + this.intSep + this.lc.negative_sign; + } + + // sign before sym + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return q + this.lc.negative_sign + this.currencyCode; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.currencyCode + q; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.lc.negative_sign + this.currencyCode; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.currencyCode + this.intSep + q; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return q + this.lc.negative_sign + this.intSep + this.currencyCode; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.intSep + this.currencyCode + q; + } + + // sign after symbol + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return q + this.currencyCode + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return this.currencyCode + this.lc.negative_sign + q; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.currencyCode + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return this.currencyCode + this.lc.negative_sign + this.intSep + q; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return q + this.currencyCode + this.intSep + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return this.currencyCode + this.intSep + this.lc.negative_sign + q; + } + } + + // throw error if we fall through + throw "Error: Invalid POSIX LC MONETARY definition"; + }; + + + /** + * @private + * + * @description Assembles the final string with sign and separator, but suppress the + * local currency symbol. + * + * @param {String} sign The amount sign: "+" or "-". + * @param {String} q The formatted quantity (unsigned). + * + * @returns {String} The final formatted string + */ + this._formatAsLocalCurrencyWithNoSym = function (sign, q) { + + // assemble the final formatted amount by going over all possible value combinations of: + // sign {+,-} , sign position {0,1,2,3,4} , separator {0,1,2} , symbol position {0,1} + + if (sign == "+") { + + // parentheses + if (this.lc.p_sign_posn === 0) { + return "(" + q + ")"; + } + + // sign before q + sym + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return this.lc.positive_sign + q; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return this.lc.positive_sign + q; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return this.lc.positive_sign + " " + q; + } + else if (this.lc.p_sign_posn === 1 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + " " + q; + } + + // sign after q + sym + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return q + " " + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 2 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return q + " " + this.lc.positive_sign; + } + + // sign before sym + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return q + " " + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + " " + q; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 3 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + " " + q; + } + + // sign after symbol + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 0 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 0) { + return q + " " + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 1 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + " " + q; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 0) { + return q + " " + this.lc.positive_sign; + } + else if (this.lc.p_sign_posn === 4 && this.lc.p_sep_by_space === 2 && this.lc.p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + + } + else if (sign == "-") { + + // parentheses enclose q + sym + if (this.lc.n_sign_posn === 0) { + return "(" + q + ")"; + } + + // sign before q + sym + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return this.lc.negative_sign + q; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return this.lc.negative_sign + q; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + " " + q; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return this.lc.negative_sign + " " + q; + } + else if (this.lc.n_sign_posn === 1 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + " " + q; + } + + // sign after q + sym + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return q + " " + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return q + " " + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 2 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return q + " " + this.lc.negative_sign; + } + + // sign before sym + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return q + " " + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + " " + q; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 3 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + " " + q; + } + + // sign after symbol + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 0 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 0) { + return q + " " + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 1 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + " " + q; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 0) { + return q + " " + this.lc.negative_sign; + } + else if (this.lc.n_sign_posn === 4 && this.lc.n_sep_by_space === 2 && this.lc.n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + } + + // throw error if we fall through + throw "Error: Invalid POSIX LC MONETARY definition"; + }; + + + /** + * @private + * + * @description Assembles the final string with sign and separator, but suppress + * the ISO-4217 currency code. + * + * @param {String} sign The amount sign: "+" or "-". + * @param {String} q The formatted quantity (unsigned). + * + * @returns {String} The final formatted string. + */ + this._formatAsInternationalCurrencyWithNoSym = function (sign, q) { + + // assemble the final formatted amount by going over all possible value combinations of: + // sign {+,-} , sign position {0,1,2,3,4} , separator {0,1,2} , symbol position {0,1} + + if (sign == "+") { + + // parentheses + if (this.lc.int_p_sign_posn === 0) { + return "(" + q + ")"; + } + + // sign before q + sym + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return this.lc.positive_sign + q; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return this.lc.positive_sign + q; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.intSep + q; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return this.lc.positive_sign + this.intSep + q; + } + else if (this.lc.int_p_sign_posn === 1 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.intSep + q; + } + + // sign after q + sym + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 2 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return q + this.intSep + this.lc.positive_sign; + } + + // sign before sym + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.intSep + q; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 3 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.intSep + q; + } + + // sign after symbol + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 0) { + return q + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 0 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 1 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + this.intSep + q; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 0) { + return q + this.intSep + this.lc.positive_sign; + } + else if (this.lc.int_p_sign_posn === 4 && this.lc.int_p_sep_by_space === 2 && this.lc.int_p_cs_precedes === 1) { + return this.lc.positive_sign + q; + } + + } + else if (sign == "-") { + + // parentheses enclose q + sym + if (this.lc.int_n_sign_posn === 0) { + return "(" + q + ")"; + } + + // sign before q + sym + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return this.lc.negative_sign + q; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return this.lc.negative_sign + q; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.intSep + q; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return this.lc.negative_sign + this.intSep + q; + } + else if (this.lc.int_n_sign_posn === 1 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.intSep + q; + } + + // sign after q + sym + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 2 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return q + this.intSep + this.lc.negative_sign; + } + + // sign before sym + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.intSep + q; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 3 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.intSep + q; + } + + // sign after symbol + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 0) { + return q + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 0 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 1 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + this.intSep + q; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 0) { + return q + this.intSep + this.lc.negative_sign; + } + else if (this.lc.int_n_sign_posn === 4 && this.lc.int_n_sep_by_space === 2 && this.lc.int_n_cs_precedes === 1) { + return this.lc.negative_sign + q; + } + } + + // throw error if we fall through + throw "Error: Invalid POSIX LC_MONETARY definition"; + }; +}; + + +/** + * @class + * Class for parsing localised number strings. + * + * @public + * @constructor + * @description Creates a new numeric parser for the specified locale. + * + * @param {jsworld.Locale} locale A locale object specifying the required + * POSIX LC_NUMERIC formatting properties. + * + * @throws Error on constructor failure. + */ +jsworld.NumericParser = function(locale) { + + if (typeof locale != "object" || locale._className != "jsworld.Locale") + throw "Constructor error: You must provide a valid jsworld.Locale instance"; + + this.lc = locale; + + + /** + * @public + * + * @description Parses a numeric string formatted according to the + * preset locale. Leading and trailing whitespace is ignored; the number + * may also be formatted without thousands separators. + * + * @param {String} formattedNumber The formatted number. + * + * @returns {Number} The parsed number. + * + * @throws Error on a parse exception. + */ + this.parse = function(formattedNumber) { + + if (typeof formattedNumber != "string") + throw "Parse error: Argument must be a string"; + + // trim whitespace + var s = jsworld._trim(formattedNumber); + + // remove any thousand separator symbols + s = jsworld._stringReplaceAll(formattedNumber, this.lc.thousands_sep, ""); + + // replace any local decimal point symbols with the symbol used + // in JavaScript "." + s = jsworld._stringReplaceAll(s, this.lc.decimal_point, "."); + + // test if the string represents a number + if (jsworld._isNumber(s)) + return parseFloat(s, 10); + else + throw "Parse error: Invalid number string"; + }; +}; + + +/** + * @class + * Class for parsing localised date and time strings. + * + * @public + * @constructor + * @description Creates a new date/time parser for the specified locale. + * + * @param {jsworld.Locale} locale A locale object specifying the required + * POSIX LC_TIME formatting properties. + * + * @throws Error on constructor failure. + */ +jsworld.DateTimeParser = function(locale) { + + if (typeof locale != "object" || locale._className != "jsworld.Locale") + throw "Constructor error: You must provide a valid jsworld.Locale instance."; + + this.lc = locale; + + + /** + * @public + * + * @description Parses a time string formatted according to the + * POSIX LC_TIME t_fmt property of the preset locale. + * + * @param {String} formattedTime The formatted time. + * + * @returns {String} The parsed time in ISO-8601 format (HH:MM:SS), e.g. + * "23:59:59". + * + * @throws Error on a parse exception. + */ + this.parseTime = function(formattedTime) { + + if (typeof formattedTime != "string") + throw "Parse error: Argument must be a string"; + + var dt = this._extractTokens(this.lc.t_fmt, formattedTime); + + var timeDefined = false; + + if (dt.hour !== null && dt.minute !== null && dt.second !== null) { + timeDefined = true; + } + else if (dt.hourAmPm !== null && dt.am !== null && dt.minute !== null && dt.second !== null) { + if (dt.am) { + // AM [12(midnight), 1 .. 11] + if (dt.hourAmPm == 12) + dt.hour = 0; + else + dt.hour = parseInt(dt.hourAmPm, 10); + } + else { + // PM [12(noon), 1 .. 11] + if (dt.hourAmPm == 12) + dt.hour = 12; + else + dt.hour = parseInt(dt.hourAmPm, 10) + 12; + } + timeDefined = true; + } + + if (timeDefined) + return jsworld._zeroPad(dt.hour, 2) + + ":" + + jsworld._zeroPad(dt.minute, 2) + + ":" + + jsworld._zeroPad(dt.second, 2); + else + throw "Parse error: Invalid/ambiguous time string"; + }; + + + /** + * @public + * + * @description Parses a date string formatted according to the + * POSIX LC_TIME d_fmt property of the preset locale. + * + * @param {String} formattedDate The formatted date, must be valid. + * + * @returns {String} The parsed date in ISO-8601 format (YYYY-MM-DD), + * e.g. "2010-03-31". + * + * @throws Error on a parse exception. + */ + this.parseDate = function(formattedDate) { + + if (typeof formattedDate != "string") + throw "Parse error: Argument must be a string"; + + var dt = this._extractTokens(this.lc.d_fmt, formattedDate); + + var dateDefined = false; + + if (dt.year !== null && dt.month !== null && dt.day !== null) { + dateDefined = true; + } + + if (dateDefined) + return jsworld._zeroPad(dt.year, 4) + + "-" + + jsworld._zeroPad(dt.month, 2) + + "-" + + jsworld._zeroPad(dt.day, 2); + else + throw "Parse error: Invalid date string"; + }; + + + /** + * @public + * + * @description Parses a date/time string formatted according to the + * POSIX LC_TIME d_t_fmt property of the preset locale. + * + * @param {String} formattedDateTime The formatted date/time, must be + * valid. + * + * @returns {String} The parsed date/time in ISO-8601 format + * (YYYY-MM-DD HH:MM:SS), e.g. "2010-03-31 23:59:59". + * + * @throws Error on a parse exception. + */ + this.parseDateTime = function(formattedDateTime) { + + if (typeof formattedDateTime != "string") + throw "Parse error: Argument must be a string"; + + var dt = this._extractTokens(this.lc.d_t_fmt, formattedDateTime); + + var timeDefined = false; + var dateDefined = false; + + if (dt.hour !== null && dt.minute !== null && dt.second !== null) { + timeDefined = true; + } + else if (dt.hourAmPm !== null && dt.am !== null && dt.minute !== null && dt.second !== null) { + if (dt.am) { + // AM [12(midnight), 1 .. 11] + if (dt.hourAmPm == 12) + dt.hour = 0; + else + dt.hour = parseInt(dt.hourAmPm, 10); + } + else { + // PM [12(noon), 1 .. 11] + if (dt.hourAmPm == 12) + dt.hour = 12; + else + dt.hour = parseInt(dt.hourAmPm, 10) + 12; + } + timeDefined = true; + } + + if (dt.year !== null && dt.month !== null && dt.day !== null) { + dateDefined = true; + } + + if (dateDefined && timeDefined) + return jsworld._zeroPad(dt.year, 4) + + "-" + + jsworld._zeroPad(dt.month, 2) + + "-" + + jsworld._zeroPad(dt.day, 2) + + " " + + jsworld._zeroPad(dt.hour, 2) + + ":" + + jsworld._zeroPad(dt.minute, 2) + + ":" + + jsworld._zeroPad(dt.second, 2); + else + throw "Parse error: Invalid/ambiguous date/time string"; + }; + + + /** + * @private + * + * @description Parses a string according to the specified format + * specification. + * + * @param {String} fmtSpec The format specification, e.g. "%I:%M:%S %p". + * @param {String} s The string to parse. + * + * @returns {object} An object with set properties year, month, day, + * hour, minute and second if the corresponding values are + * found in the parsed string. + * + * @throws Error on a parse exception. + */ + this._extractTokens = function(fmtSpec, s) { + + // the return object containing the parsed date/time properties + var dt = { + // for date and date/time strings + "year" : null, + "month" : null, + "day" : null, + + // for time and date/time strings + "hour" : null, + "hourAmPm" : null, + "am" : null, + "minute" : null, + "second" : null, + + // used internally only + "weekday" : null + }; + + + // extract and process each token in the date/time spec + while (fmtSpec.length > 0) { + + // Do we have a valid "%\w" placeholder in stream? + if (fmtSpec.charAt(0) == "%" && fmtSpec.charAt(1) != "") { + + // get placeholder + var placeholder = fmtSpec.substring(0,2); + + if (placeholder == "%%") { + // escaped '%'' + s = s.substring(1); + } + else if (placeholder == "%a") { + // abbreviated weekday name + for (var i = 0; i < this.lc.abday.length; i++) { + + if (jsworld._stringStartsWith(s, this.lc.abday[i])) { + dt.weekday = i; + s = s.substring(this.lc.abday[i].length); + break; + } + } + + if (dt.weekday === null) + throw "Parse error: Unrecognised abbreviated weekday name (%a)"; + } + else if (placeholder == "%A") { + // weekday name + for (var i = 0; i < this.lc.day.length; i++) { + + if (jsworld._stringStartsWith(s, this.lc.day[i])) { + dt.weekday = i; + s = s.substring(this.lc.day[i].length); + break; + } + } + + if (dt.weekday === null) + throw "Parse error: Unrecognised weekday name (%A)"; + } + else if (placeholder == "%b" || placeholder == "%h") { + // abbreviated month name + for (var i = 0; i < this.lc.abmon.length; i++) { + + if (jsworld._stringStartsWith(s, this.lc.abmon[i])) { + dt.month = i + 1; + s = s.substring(this.lc.abmon[i].length); + break; + } + } + + if (dt.month === null) + throw "Parse error: Unrecognised abbreviated month name (%b)"; + } + else if (placeholder == "%B") { + // month name + for (var i = 0; i < this.lc.mon.length; i++) { + + if (jsworld._stringStartsWith(s, this.lc.mon[i])) { + dt.month = i + 1; + s = s.substring(this.lc.mon[i].length); + break; + } + } + + if (dt.month === null) + throw "Parse error: Unrecognised month name (%B)"; + } + else if (placeholder == "%d") { + // day of the month [01..31] + if (/^0[1-9]|[1-2][0-9]|3[0-1]/.test(s)) { + dt.day = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised day of the month (%d)"; + } + else if (placeholder == "%e") { + // day of the month [1..31] + + // Note: if %e is leading in fmt string -> space padded! + + var day = s.match(/^\s?(\d{1,2})/); + dt.day = parseInt(day, 10); + + if (isNaN(dt.day) || dt.day < 1 || dt.day > 31) + throw "Parse error: Unrecognised day of the month (%e)"; + + s = s.substring(day.length); + } + else if (placeholder == "%F") { + // equivalent to %Y-%m-%d (ISO-8601 date format) + + // year [nnnn] + if (/^\d\d\d\d/.test(s)) { + dt.year = parseInt(s.substring(0,4), 10); + s = s.substring(4); + } + else { + throw "Parse error: Unrecognised date (%F)"; + } + + // - + if (jsworld._stringStartsWith(s, "-")) + s = s.substring(1); + else + throw "Parse error: Unrecognised date (%F)"; + + // month [01..12] + if (/^0[1-9]|1[0-2]/.test(s)) { + dt.month = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised date (%F)"; + + // - + if (jsworld._stringStartsWith(s, "-")) + s = s.substring(1); + else + throw "Parse error: Unrecognised date (%F)"; + + // day of the month [01..31] + if (/^0[1-9]|[1-2][0-9]|3[0-1]/.test(s)) { + dt.day = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised date (%F)"; + } + else if (placeholder == "%H") { + // hour [00..23] + if (/^[0-1][0-9]|2[0-3]/.test(s)) { + dt.hour = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised hour (%H)"; + } + else if (placeholder == "%I") { + // hour [01..12] + if (/^0[1-9]|1[0-2]/.test(s)) { + dt.hourAmPm = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised hour (%I)"; + } + else if (placeholder == "%k") { + // hour [0..23] + var h = s.match(/^(\d{1,2})/); + dt.hour = parseInt(h, 10); + + if (isNaN(dt.hour) || dt.hour < 0 || dt.hour > 23) + throw "Parse error: Unrecognised hour (%k)"; + + s = s.substring(h.length); + } + else if (placeholder == "%l") { + // hour AM/PM [1..12] + var h = s.match(/^(\d{1,2})/); + dt.hourAmPm = parseInt(h, 10); + + if (isNaN(dt.hourAmPm) || dt.hourAmPm < 1 || dt.hourAmPm > 12) + throw "Parse error: Unrecognised hour (%l)"; + + s = s.substring(h.length); + } + else if (placeholder == "%m") { + // month [01..12] + if (/^0[1-9]|1[0-2]/.test(s)) { + dt.month = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised month (%m)"; + } + else if (placeholder == "%M") { + // minute [00..59] + if (/^[0-5][0-9]/.test(s)) { + dt.minute = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised minute (%M)"; + } + else if (placeholder == "%n") { + // new line + + if (s.charAt(0) == "\n") + s = s.substring(1); + else + throw "Parse error: Unrecognised new line (%n)"; + } + else if (placeholder == "%p") { + // locale's equivalent of AM/PM + if (jsworld._stringStartsWith(s, this.lc.am)) { + dt.am = true; + s = s.substring(this.lc.am.length); + } + else if (jsworld._stringStartsWith(s, this.lc.pm)) { + dt.am = false; + s = s.substring(this.lc.pm.length); + } + else + throw "Parse error: Unrecognised AM/PM value (%p)"; + } + else if (placeholder == "%P") { + // same as %p but forced lower case + if (jsworld._stringStartsWith(s, this.lc.am.toLowerCase())) { + dt.am = true; + s = s.substring(this.lc.am.length); + } + else if (jsworld._stringStartsWith(s, this.lc.pm.toLowerCase())) { + dt.am = false; + s = s.substring(this.lc.pm.length); + } + else + throw "Parse error: Unrecognised AM/PM value (%P)"; + } + else if (placeholder == "%R") { + // same as %H:%M + + // hour [00..23] + if (/^[0-1][0-9]|2[0-3]/.test(s)) { + dt.hour = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised time (%R)"; + + // : + if (jsworld._stringStartsWith(s, ":")) + s = s.substring(1); + else + throw "Parse error: Unrecognised time (%R)"; + + // minute [00..59] + if (/^[0-5][0-9]/.test(s)) { + dt.minute = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised time (%R)"; + + } + else if (placeholder == "%S") { + // second [00..59] + if (/^[0-5][0-9]/.test(s)) { + dt.second = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised second (%S)"; + } + else if (placeholder == "%T") { + // same as %H:%M:%S + + // hour [00..23] + if (/^[0-1][0-9]|2[0-3]/.test(s)) { + dt.hour = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised time (%T)"; + + // : + if (jsworld._stringStartsWith(s, ":")) + s = s.substring(1); + else + throw "Parse error: Unrecognised time (%T)"; + + // minute [00..59] + if (/^[0-5][0-9]/.test(s)) { + dt.minute = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised time (%T)"; + + // : + if (jsworld._stringStartsWith(s, ":")) + s = s.substring(1); + else + throw "Parse error: Unrecognised time (%T)"; + + // second [00..59] + if (/^[0-5][0-9]/.test(s)) { + dt.second = parseInt(s.substring(0,2), 10); + s = s.substring(2); + } + else + throw "Parse error: Unrecognised time (%T)"; + } + else if (placeholder == "%w") { + // weekday [0..6] + if (/^\d/.test(s)) { + dt.weekday = parseInt(s.substring(0,1), 10); + s = s.substring(1); + } + else + throw "Parse error: Unrecognised weekday number (%w)"; + } + else if (placeholder == "%y") { + // year [00..99] + if (/^\d\d/.test(s)) { + var year2digits = parseInt(s.substring(0,2), 10); + + // this conversion to year[nnnn] is arbitrary!!! + if (year2digits > 50) + dt.year = 1900 + year2digits; + else + dt.year = 2000 + year2digits; + + s = s.substring(2); + } + else + throw "Parse error: Unrecognised year (%y)"; + } + else if (placeholder == "%Y") { + // year [nnnn] + if (/^\d\d\d\d/.test(s)) { + dt.year = parseInt(s.substring(0,4), 10); + s = s.substring(4); + } + else + throw "Parse error: Unrecognised year (%Y)"; + } + + else if (placeholder == "%Z") { + // time-zone place holder is not supported + + if (fmtSpec.length === 0) + break; // ignore rest of fmt spec + } + + // remove the spec placeholder that was just parsed + fmtSpec = fmtSpec.substring(2); + } + else { + // If we don't have a placeholder, the chars + // at pos. 0 of format spec and parsed string must match + + // Note: Space chars treated 1:1 ! + + if (fmtSpec.charAt(0) != s.charAt(0)) + throw "Parse error: Unexpected symbol \"" + s.charAt(0) + "\" in date/time string"; + + fmtSpec = fmtSpec.substring(1); + s = s.substring(1); + } + } + + // parsing finished, return composite date/time object + return dt; + }; +}; + + +/** + * @class + * Class for parsing localised currency amount strings. + * + * @public + * @constructor + * @description Creates a new monetary parser for the specified locale. + * + * @param {jsworld.Locale} locale A locale object specifying the required + * POSIX LC_MONETARY formatting properties. + * + * @throws Error on constructor failure. + */ +jsworld.MonetaryParser = function(locale) { + + if (typeof locale != "object" || locale._className != "jsworld.Locale") + throw "Constructor error: You must provide a valid jsworld.Locale instance"; + + + this.lc = locale; + + + /** + * @public + * + * @description Parses a currency amount string formatted according to + * the preset locale. Leading and trailing whitespace is ignored; the + * amount may also be formatted without thousands separators. Both + * the local (shorthand) symbol and the ISO 4217 code are accepted to + * designate the currency in the formatted amount. + * + * @param {String} formattedCurrency The formatted currency amount. + * + * @returns {Number} The parsed amount. + * + * @throws Error on a parse exception. + */ + this.parse = function(formattedCurrency) { + + if (typeof formattedCurrency != "string") + throw "Parse error: Argument must be a string"; + + // Detect the format type and remove the currency symbol + var symbolType = this._detectCurrencySymbolType(formattedCurrency); + + var formatType, s; + + if (symbolType == "local") { + formatType = "local"; + s = formattedCurrency.replace(this.lc.getCurrencySymbol(), ""); + } + else if (symbolType == "int") { + formatType = "int"; + s = formattedCurrency.replace(this.lc.getIntCurrencySymbol(), ""); + } + else if (symbolType == "none") { + formatType = "local"; // assume local + s = formattedCurrency; + } + else + throw "Parse error: Internal assert failure"; + + // Remove any thousands separators + s = jsworld._stringReplaceAll(s, this.lc.mon_thousands_sep, ""); + + // Replace any local radix char with JavaScript's "." + s = s.replace(this.lc.mon_decimal_point, "."); + + // Remove all whitespaces + s = s.replace(/\s*/g, ""); + + // Remove any local non-negative sign + s = this._removeLocalNonNegativeSign(s, formatType); + + // Replace any local minus sign with JavaScript's "-" and put + // it in front of the amount if necessary + // (special parentheses rule checked too) + s = this._normaliseNegativeSign(s, formatType); + + // Finally, we should be left with a bare parsable decimal number + if (jsworld._isNumber(s)) + return parseFloat(s, 10); + else + throw "Parse error: Invalid currency amount string"; + }; + + + /** + * @private + * + * @description Tries to detect the symbol type used in the specified + * formatted currency string: local(shorthand), + * international (ISO-4217 code) or none. + * + * @param {String} formattedCurrency The the formatted currency string. + * + * @return {String} With possible values "local", "int" or "none". + */ + this._detectCurrencySymbolType = function(formattedCurrency) { + + // Check for whichever sign (int/local) is longer first + // to cover cases such as MOP/MOP$ and ZAR/R + + if (this.lc.getCurrencySymbol().length > this.lc.getIntCurrencySymbol().length) { + + if (formattedCurrency.indexOf(this.lc.getCurrencySymbol()) != -1) + return "local"; + else if (formattedCurrency.indexOf(this.lc.getIntCurrencySymbol()) != -1) + return "int"; + else + return "none"; + } + else { + if (formattedCurrency.indexOf(this.lc.getIntCurrencySymbol()) != -1) + return "int"; + else if (formattedCurrency.indexOf(this.lc.getCurrencySymbol()) != -1) + return "local"; + else + return "none"; + } + }; + + + /** + * @private + * + * @description Removes a local non-negative sign in a formatted + * currency string if it is found. This is done according to the + * locale properties p_sign_posn and int_p_sign_posn. + * + * @param {String} s The input string. + * @param {String} formatType With possible values "local" or "int". + * + * @returns {String} The processed string. + */ + this._removeLocalNonNegativeSign = function(s, formatType) { + + s = s.replace(this.lc.positive_sign, ""); + + // check for enclosing parentheses rule + if (((formatType == "local" && this.lc.p_sign_posn === 0) || + (formatType == "int" && this.lc.int_p_sign_posn === 0) ) && + /\(\d+\.?\d*\)/.test(s)) { + s = s.replace("(", ""); + s = s.replace(")", ""); + } + + return s; + }; + + + /** + * @private + * + * @description Replaces a local negative sign with the standard + * JavaScript minus ("-") sign placed in the correct position + * (preceding the amount). This is done according to the locale + * properties for negative sign symbol and relative position. + * + * @param {String} s The input string. + * @param {String} formatType With possible values "local" or "int". + * + * @returns {String} The processed string. + */ + this._normaliseNegativeSign = function(s, formatType) { + + // replace local negative symbol with JavaScript's "-" + s = s.replace(this.lc.negative_sign, "-"); + + // check for enclosing parentheses rule and replace them + // with negative sign before the amount + if ((formatType == "local" && this.lc.n_sign_posn === 0) || + (formatType == "int" && this.lc.int_n_sign_posn === 0) ) { + + if (/^\(\d+\.?\d*\)$/.test(s)) { + + s = s.replace("(", ""); + s = s.replace(")", ""); + return "-" + s; + } + } + + // check for rule negative sign succeeding the amount + if (formatType == "local" && this.lc.n_sign_posn == 2 || + formatType == "int" && this.lc.int_n_sign_posn == 2 ) { + + if (/^\d+\.?\d*-$/.test(s)) { + s = s.replace("-", ""); + return "-" + s; + } + } + + // check for rule cur. sym. succeeds and sign adjacent + if (formatType == "local" && this.lc.n_cs_precedes === 0 && this.lc.n_sign_posn == 3 || + formatType == "local" && this.lc.n_cs_precedes === 0 && this.lc.n_sign_posn == 4 || + formatType == "int" && this.lc.int_n_cs_precedes === 0 && this.lc.int_n_sign_posn == 3 || + formatType == "int" && this.lc.int_n_cs_precedes === 0 && this.lc.int_n_sign_posn == 4 ) { + + if (/^\d+\.?\d*-$/.test(s)) { + s = s.replace("-", ""); + return "-" + s; + } + } + + return s; + }; +}; + +// end-of-file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/uglify-hangs2.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/uglify-hangs2.js new file mode 100644 index 00000000..4e9f9672 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/tmp/uglify-hangs2.js @@ -0,0 +1,166 @@ +jsworld.Locale = function(properties) { + + // LC_NUMERIC + + + this.frac_digits = properties.frac_digits; + + + // may be empty string/null for currencies with no fractional part + if (properties.mon_decimal_point === null || properties.mon_decimal_point == "") { + + if (this.frac_digits > 0) + throw "Error: Undefined mon_decimal_point property"; + else + properties.mon_decimal_point = ""; + } + + if (typeof properties.mon_decimal_point != "string") + throw "Error: Invalid/missing mon_decimal_point property"; + + this.mon_decimal_point = properties.mon_decimal_point; + + + if (typeof properties.mon_thousands_sep != "string") + throw "Error: Invalid/missing mon_thousands_sep property"; + + this.mon_thousands_sep = properties.mon_thousands_sep; + + + if (typeof properties.mon_grouping != "string") + throw "Error: Invalid/missing mon_grouping property"; + + this.mon_grouping = properties.mon_grouping; + + + if (typeof properties.positive_sign != "string") + throw "Error: Invalid/missing positive_sign property"; + + this.positive_sign = properties.positive_sign; + + + if (typeof properties.negative_sign != "string") + throw "Error: Invalid/missing negative_sign property"; + + this.negative_sign = properties.negative_sign; + + + if (properties.p_cs_precedes !== 0 && properties.p_cs_precedes !== 1) + throw "Error: Invalid/missing p_cs_precedes property, must be 0 or 1"; + + this.p_cs_precedes = properties.p_cs_precedes; + + + if (properties.n_cs_precedes !== 0 && properties.n_cs_precedes !== 1) + throw "Error: Invalid/missing n_cs_precedes, must be 0 or 1"; + + this.n_cs_precedes = properties.n_cs_precedes; + + + if (properties.p_sep_by_space !== 0 && + properties.p_sep_by_space !== 1 && + properties.p_sep_by_space !== 2) + throw "Error: Invalid/missing p_sep_by_space property, must be 0, 1 or 2"; + + this.p_sep_by_space = properties.p_sep_by_space; + + + if (properties.n_sep_by_space !== 0 && + properties.n_sep_by_space !== 1 && + properties.n_sep_by_space !== 2) + throw "Error: Invalid/missing n_sep_by_space property, must be 0, 1, or 2"; + + this.n_sep_by_space = properties.n_sep_by_space; + + + if (properties.p_sign_posn !== 0 && + properties.p_sign_posn !== 1 && + properties.p_sign_posn !== 2 && + properties.p_sign_posn !== 3 && + properties.p_sign_posn !== 4) + throw "Error: Invalid/missing p_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.p_sign_posn = properties.p_sign_posn; + + + if (properties.n_sign_posn !== 0 && + properties.n_sign_posn !== 1 && + properties.n_sign_posn !== 2 && + properties.n_sign_posn !== 3 && + properties.n_sign_posn !== 4) + throw "Error: Invalid/missing n_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.n_sign_posn = properties.n_sign_posn; + + + if (typeof properties.int_frac_digits != "number" && properties.int_frac_digits < 0) + throw "Error: Invalid/missing int_frac_digits property"; + + this.int_frac_digits = properties.int_frac_digits; + + + if (properties.int_p_cs_precedes !== 0 && properties.int_p_cs_precedes !== 1) + throw "Error: Invalid/missing int_p_cs_precedes property, must be 0 or 1"; + + this.int_p_cs_precedes = properties.int_p_cs_precedes; + + + if (properties.int_n_cs_precedes !== 0 && properties.int_n_cs_precedes !== 1) + throw "Error: Invalid/missing int_n_cs_precedes property, must be 0 or 1"; + + this.int_n_cs_precedes = properties.int_n_cs_precedes; + + + if (properties.int_p_sep_by_space !== 0 && + properties.int_p_sep_by_space !== 1 && + properties.int_p_sep_by_space !== 2) + throw "Error: Invalid/missing int_p_sep_by_spacev, must be 0, 1 or 2"; + + this.int_p_sep_by_space = properties.int_p_sep_by_space; + + + if (properties.int_n_sep_by_space !== 0 && + properties.int_n_sep_by_space !== 1 && + properties.int_n_sep_by_space !== 2) + throw "Error: Invalid/missing int_n_sep_by_space property, must be 0, 1, or 2"; + + this.int_n_sep_by_space = properties.int_n_sep_by_space; + + + if (properties.int_p_sign_posn !== 0 && + properties.int_p_sign_posn !== 1 && + properties.int_p_sign_posn !== 2 && + properties.int_p_sign_posn !== 3 && + properties.int_p_sign_posn !== 4) + throw "Error: Invalid/missing int_p_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.int_p_sign_posn = properties.int_p_sign_posn; + + + if (properties.int_n_sign_posn !== 0 && + properties.int_n_sign_posn !== 1 && + properties.int_n_sign_posn !== 2 && + properties.int_n_sign_posn !== 3 && + properties.int_n_sign_posn !== 4) + throw "Error: Invalid/missing int_n_sign_posn property, must be 0, 1, 2, 3 or 4"; + + this.int_n_sign_posn = properties.int_n_sign_posn; + + + // LC_TIME + + if (properties == null || typeof properties != "object") + throw "Error: Invalid/missing time locale properties"; + + + // parse the supported POSIX LC_TIME properties + + // abday + try { + this.abday = this._parseList(properties.abday, 7); + } + catch (error) { + throw "Error: Invalid abday property: " + error; + } + +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/uglify-js.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/uglify-js.js new file mode 100644 index 00000000..4305e232 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/uglify-js.js @@ -0,0 +1,17 @@ +//convienence function(src, [options]); +function uglify(orig_code, options){ + options || (options = {}); + var jsp = uglify.parser; + var pro = uglify.uglify; + + var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST + ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names + ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations + var final_code = pro.gen_code(ast, options.gen_options); // compressed code here + return final_code; +}; + +uglify.parser = require("./lib/parse-js"); +uglify.uglify = require("./lib/process"); + +module.exports = uglify \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.npmignore new file mode 100644 index 00000000..1eba800f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.npmignore @@ -0,0 +1,11 @@ +npm-debug.log +node_modules +.*.swp +.lock-* +build + +bench +doc +examples +test + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.travis.yml new file mode 100644 index 00000000..97358668 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +npm_args: --ws:native +node_js: + - "0.8" + - "0.10" diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/History.md new file mode 100644 index 00000000..63cf0ea6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/History.md @@ -0,0 +1,312 @@ +v0.4.31 - September 23th, 2013 +===================== + +* Component support + +v0.4.30 - August 30th, 2013 +===================== + +* BufferedAmount could be undefined, default to 0 [TooTallNate] +* Support protocols as second argument and options as third [TooTallNate] +* Proper browserify shim [mcollina] +* Broadcasting example in README [stefanocudini] + +v0.4.29 - August 23th, 2013 +===================== +* Small clean up of the Node 0.11 support by using NAN from the NPM registry [kkoopa] +* Support for custom `Agent`'s through the options. [gramakri] & [TooTallNate] +* Support for custom headers through the options [3rd-Eden] +* Added a `gypfile` flag to the package.json for compiled module discovery [wolfeidau] + +v0.4.28 - August 16th, 2013 +===================== +* Node 0.11 support. [kkoopa] +* Authorization headers are sent when basic auth is used in the url [jcrugzz] +* Origin header will now include the port number [Jason Plum] +* Race condition fixed where data was received before the readyState was updated. [saschagehlich] + +v0.4.27 - June 27th, 2013 +===================== +* Frames are no longer masked in `wscat`. [slaskis] +* Don't retrain reference to large slab buffers. [jmatthewsr-msi] +* Don't use Buffer.byteLength for ArrayBuffer's. [Anthony Pesch] +* Fix browser field in package.json. [shtylman] +* Client-side certificate support & documentation improvements. [Lukas Berns] +* WebSocket readyState's is added to the prototype for spec compatiblity. [BallBearing] +* Use Object.defineProperty. [arlolra] +* Autodetect ArrayBuffers as binary when sending. [BallBearing] +* Check instanceof Buffer for binary data. [arlolra] +* Emit the close event before destroying the internal socket. [3rd-Eden] +* Don't setup multiply timeouts for one connection. [AndreasMadsen] +* Allow support for binding to ethereal port. [wpreul] +* Fix broken terminate reference. [3rd-Eden] +* Misc node 0.10 test fixes and documentation improvements. [3rd-Eden] +* Ensure ssl options are propagated to request. [einaros] +* Add 'Host' and 'Origin' to request header. [Lars-Magnus Skog] +* Subprotocol support. [kanaka] +* Honor ArrayBufferView's byteOffset when sending. [Anthony Pesch] +* Added target attribute for events. [arlolra] + +v0.4.26 - Skipped +===================== + +v0.4.25 - December 17th, 2012 +===================== +* Removed install.js. [shtylman] +* Added browser field to package.json. [shtylman] +* Support overwriting host header. [Raynos] +* Emit 'listening' also with custom http server. [sebiq] + +v0.4.24 - December 6th, 2012 +===================== +* Yet another intermediate release, to not delay minor features any longer. +* Native support installation issues further circumvented. [einaros] + +v0.4.23 - November 19th, 2012 +===================== +* Service release - last before major upgrade. +* Changes default host from 127.0.0.1 to 0.0.0.0. [einaros] + +v0.4.22 - October 3rd, 2012 +===================== +* clear failsafe cleanup timeout once cleanup is called [AndreasMadsen] +* added w3c compatible CloseEvent for onclose / addEventListener("close", ...). [einaros] +* fix the sub protocol header handler [sonnyp] +* fix unhandled exception if socket closes and 'error' is emitted [jmatthewsr-ms] + +v0.4.21 - July 14th, 2012 +===================== +* Emit error if server reponds with anything other than status code 101. [einaros] +* Added 'headers' event to server. [rauchg] +* path.exists moved to fs.exists. [blakmatrix] + +v0.4.20 - June 26th, 2012 +===================== +* node v0.8.0 compatibility release. + +v0.4.19 - June 19th, 2012 +===================== +* Change sender to merge buffers for relatively small payloads, may improve perf in some cases [einaros] +* Avoid EventEmitter for Receiver classes. As above this may improve perf. [einaros] +* Renamed fallback files from the somewhat misleading '*Windows'. [einaros] + +v0.4.18 - June 14th 2012 +===================== +* Fixed incorrect md5 digest encoding in Hixie handshake [nicokaiser] +* Added example of use with Express 3 [einaros] +* Change installation procedure to not require --ws:native to build native extensions. They will now build if a compiler is available. [einaros] + +v0.4.17 - June 13th 2012 +===================== +* Improve error handling during connection handshaking [einaros] +* Ensure that errors are caught also after connection teardown [nicokaiser] +* Update 'mocha' version to 1.1.0. [einaros] +* Stop showing 'undefined' for some error logs. [tricknotes] +* Update 'should' version to 0.6.3 [tricknotes] + +v0.4.16 - June 1st 2012 +===================== +* Build fix for Windows. [einaros] + +v0.4.15 - May 20th 2012 +===================== +* Enable fauxe streaming for hixie tansport. [einaros] +* Allow hixie sender to deal with buffers. [einaros/pigne] +* Allow error code 1011. [einaros] +* Fix framing for empty packets (empty pings and pongs might break). [einaros] +* Improve error and close handling, to avoid connections lingering in CLOSING state. [einaros] + +v0.4.14 - Apr 30th 2012 +===================== +* use node-gyp instead of node-waf [TooTallNate] +* remove old windows compatibility makefile, and silently fall back to native modules [einaros] +* ensure connection status [nicokaiser] +* websocket client updated to use port 443 by default for wss:// connections [einaros] +* support unix sockets [kschzt] + +v0.4.13 - Apr 12th 2012 +===================== + +* circumvent node 0.6+ related memory leak caused by Object.defineProperty [nicokaiser] +* improved error handling, improving stability in massive load use cases [nicokaiser] + +v0.4.12 - Mar 30th 2012 +===================== + +* various memory leak / possible memory leak cleanups [einaros] +* api documentation [nicokaiser] +* add option to disable client tracking [nicokaiser] + +v0.4.11 - Mar 24th 2012 +===================== + +* node v0.7 compatibillity release +* gyp support [TooTallNate] +* commander dependency update [jwueller] +* loadbalancer support [nicokaiser] + +v0.4.10 - Mar 22th 2012 +===================== + +* Final hixie close frame fixes. [nicokaiser] + +v0.4.9 - Mar 21st 2012 +===================== + +* Various hixie bugfixes (such as proper close frame handling). [einaros] + +v0.4.8 - Feb 29th 2012 +===================== + +* Allow verifyClient to run asynchronously [karlsequin] +* Various bugfixes and cleanups. [einaros] + +v0.4.7 - Feb 21st 2012 +===================== + +* Exposed bytesReceived from websocket client object, which makes it possible to implement bandwidth sampling. [einaros] +* Updated browser based file upload example to include and output per websocket channel bandwidth sampling. [einaros] +* Changed build scripts to check which architecture is currently in use. Required after the node.js changes to have prebuilt packages target ia32 by default. [einaros] + +v0.4.6 - Feb 9th 2012 +===================== + +* Added browser based file upload example. [einaros] +* Added server-to-browser status push example. [einaros] +* Exposed pause() and resume() on WebSocket object, to enable client stream shaping. [einaros] + +v0.4.5 - Feb 7th 2012 +===================== + +* Corrected regression bug in handling of connections with the initial frame delivered across both http upgrade head and a standalone packet. This would lead to a race condition, which in some cases could cause message corruption. [einaros] + +v0.4.4 - Feb 6th 2012 +===================== + +* Pass original request object to verifyClient, for cookie or authentication verifications. [einaros] +* Implemented addEventListener and slightly improved the emulation API by adding a MessageEvent with a readonly data attribute. [aslakhellesoy] +* Rewrite parts of hybi receiver to avoid stack overflows for large amounts of packets bundled in the same buffer / packet. [einaros] + +v0.4.3 - Feb 4th 2012 +===================== + +* Prioritized update: Corrected issue which would cause sockets to stay open longer than necessary, and resource leakage because of this. [einaros] + +v0.4.2 - Feb 4th 2012 +===================== + +* Breaking change: WebSocketServer's verifyOrigin option has been renamed to verifyClient. [einaros] +* verifyClient now receives { origin: 'origin header', secure: true/false }, where 'secure' will be true for ssl connections. [einaros] +* Split benchmark, in preparation for more thorough case. [einaros] +* Introduced hixie-76 draft support for server, since Safari (iPhone / iPad / OS X) and Opera still aren't updated to use Hybi. [einaros] +* Expose 'supports' object from WebSocket, to indicate e.g. the underlying transport's support for binary data. [einaros] +* Test and code cleanups. [einaros] + +v0.4.1 - Jan 25th 2012 +===================== + +* Use readline in wscat [tricknotes] +* Refactor _state away, in favor of the new _readyState [tricknotes] +* travis-ci integration [einaros] +* Fixed race condition in testsuite, causing a few tests to fail (without actually indicating errors) on travis [einaros] +* Expose pong event [paddybyers] +* Enabled running of WebSocketServer in noServer-mode, meaning that upgrades are passed in manually. [einaros] +* Reworked connection procedure for WebSocketServer, and cleaned up tests. [einaros] + +v0.4.0 - Jan 2nd 2012 +===================== + +* Windows compatibility [einaros] +* Windows compatible test script [einaros] + +v0.3.9 - Jan 1st 2012 +====================== + +* Improved protocol framing performance [einaros] +* WSS support [kazuyukitanimura] +* WSS tests [einaros] +* readyState exposed [justinlatimer, tricknotes] +* url property exposed [justinlatimer] +* Removed old 'state' property [einaros] +* Test cleanups [einaros] + +v0.3.8 - Dec 27th 2011 +====================== + +* Made it possible to listen on specific paths, which is especially good to have for precreated http servers [einaros] +* Extensive WebSocket / WebSocketServer cleanup, including changing all internal properties to unconfigurable, unenumerable properties [einaros] +* Receiver modifications to ensure even better performance with fragmented sends [einaros] +* Fixed issue in sender.js, which would cause SlowBuffer instances (such as returned from the crypto library's randomBytes) to be copied (and thus be dead slow) [einaros] +* Removed redundant buffer copy in sender.js, which should improve server performance [einaros] + +v0.3.7 - Dec 25nd 2011 +====================== + +* Added a browser based API which uses EventEmitters internally [3rd-Eden] +* Expose request information from upgrade event for websocket server clients [mmalecki] + +v0.3.6 - Dec 19th 2011 +====================== + +* Added option to let WebSocket.Server use an already existing http server [mmalecki] +* Migrating various option structures to use options.js module [einaros] +* Added a few more tests, options and handshake verifications to ensure that faulty connections are dealt with [einaros] +* Code cleanups in Sender and Receiver, to ensure even faster parsing [einaros] + +v0.3.5 - Dec 13th 2011 +====================== + +* Optimized Sender.js, Receiver.js and bufferutil.cc: + * Apply loop-unrolling-like small block copies rather than use node.js Buffer#copy() (which is slow). + * Mask blocks of data using combination of 32bit xor and loop-unrolling, instead of single bytes. + * Keep pre-made send buffer for small transfers. +* Leak fixes and code cleanups. + +v0.3.3 - Dec 12th 2011 +====================== + +* Compile fix for Linux. +* Rewrote parts of WebSocket.js, to avoid try/catch and thus avoid optimizer bailouts. + +v0.3.2 - Dec 11th 2011 +====================== + +* Further performance updates, including the additions of a native BufferUtil module, which deals with several of the cpu intensive WebSocket operations. + +v0.3.1 - Dec 8th 2011 +====================== + +* Service release, fixing broken tests. + +v0.3.0 - Dec 8th 2011 +====================== + +* Node.js v0.4.x compatibility. +* Code cleanups and efficiency improvements. +* WebSocket server added, although this will still mainly be a client library. +* WebSocket server certified to pass the Autobahn test suite. +* Protocol improvements and corrections - such as handling (redundant) masks for empty fragments. +* 'wscat' command line utility added, which can act as either client or server. + +v0.2.6 - Dec 3rd 2011 +====================== + +* Renamed to 'ws'. Big woop, right -- but easy-websocket really just doesn't cut it anymore! + +v0.2.5 - Dec 3rd 2011 +====================== + + * Rewrote much of the WebSocket parser, to ensure high speed for highly fragmented messages. + * Added a BufferPool, as a start to more efficiently deal with allocations for WebSocket connections. More work to come, in that area. + * Updated the Autobahn report, at http://einaros.github.com/easy-websocket, with comparisons against WebSocket-Node 1.0.2 and Chrome 16. + +v0.2.0 - Nov 25th 2011 +====================== + + * Major rework to make sure all the Autobahn test cases pass. Also updated the internal tests to cover more corner cases. + +v0.1.2 - Nov 14th 2011 +====================== + + * Back and forth, back and forth: now settled on keeping the api (event names, methods) closer to the websocket browser api. This will stick now. + * Started keeping this history record. Better late than never, right? diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/Makefile new file mode 100644 index 00000000..151aa2ba --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/Makefile @@ -0,0 +1,40 @@ +ALL_TESTS = $(shell find test/ -name '*.test.js') +ALL_INTEGRATION = $(shell find test/ -name '*.integration.js') + +all: + node-gyp configure build + +clean: + node-gyp clean + +run-tests: + @./node_modules/.bin/mocha \ + -t 2000 \ + -s 2400 \ + $(TESTFLAGS) \ + $(TESTS) + +run-integrationtests: + @./node_modules/.bin/mocha \ + -t 5000 \ + -s 6000 \ + $(TESTFLAGS) \ + $(TESTS) + +test: + @$(MAKE) NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests + +integrationtest: + @$(MAKE) NODE_TLS_REJECT_UNAUTHORIZED=0 NODE_PATH=lib TESTS="$(ALL_INTEGRATION)" run-integrationtests + +benchmark: + @node bench/sender.benchmark.js + @node bench/parser.benchmark.js + +autobahn: + @NODE_PATH=lib node test/autobahn.js + +autobahn-server: + @NODE_PATH=lib node test/autobahn-server.js + +.PHONY: test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/README.md new file mode 100644 index 00000000..cf1f1fb8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/README.md @@ -0,0 +1,171 @@ +[![Build Status](https://secure.travis-ci.org/einaros/ws.png)](http://travis-ci.org/einaros/ws) + +# ws: a node.js websocket library # + +`ws` is a simple to use websocket implementation, up-to-date against RFC-6455, and [probably the fastest WebSocket library for node.js](http://web.archive.org/web/20130314230536/http://hobbycoding.posterous.com/the-fastest-websocket-module-for-nodejs). + +Passes the quite extensive Autobahn test suite. See http://einaros.github.com/ws for the full reports. + +Comes with a command line utility, `wscat`, which can either act as a server (--listen), or client (--connect); Use it to debug simple websocket services. + +## Protocol support ## + +* **Hixie draft 76** (Old and deprecated, but still in use by Safari and Opera. Added to ws version 0.4.2, but server only. Can be disabled by setting the `disableHixie` option to true.) +* **HyBi drafts 07-12** (Use the option `protocolVersion: 8`, or argument `-p 8` for wscat) +* **HyBi drafts 13-17** (Current default, alternatively option `protocolVersion: 13`, or argument `-p 13` for wscat) + +_See the echo.websocket.org example below for how to use the `protocolVersion` option._ + +## Usage ## + +### Installing ### + +`npm install ws` + +### Sending and receiving text data ### + +```js +var WebSocket = require('ws'); +var ws = new WebSocket('ws://www.host.com/path'); +ws.on('open', function() { + ws.send('something'); +}); +ws.on('message', function(data, flags) { + // flags.binary will be set if a binary data is received + // flags.masked will be set if the data was masked +}); +``` + +### Sending binary data ### + +```js +var WebSocket = require('ws'); +var ws = new WebSocket('ws://www.host.com/path'); +ws.on('open', function() { + var array = new Float32Array(5); + for (var i = 0; i < array.length; ++i) array[i] = i / 2; + ws.send(array, {binary: true, mask: true}); +}); +``` + +Setting `mask`, as done for the send options above, will cause the data to be masked according to the websocket protocol. The same option applies for text data. + +### Server example ### + +```js +var WebSocketServer = require('ws').Server + , wss = new WebSocketServer({port: 8080}); +wss.on('connection', function(ws) { + ws.on('message', function(message) { + console.log('received: %s', message); + }); + ws.send('something'); +}); +``` + +### Server sending broadcast data ### + +```js +var WebSocketServer = require('ws').Server + , wss = new WebSocketServer({port: 8080}); + +wss.broadcast = function(data) { + for(var i in this.clients) + this.clients[i].send(data); +}; +``` + +### Error handling best practices ### + +```js +// If the WebSocket is closed before the following send is attempted +ws.send('something'); + +// Errors (both immediate and async write errors) can be detected in an optional callback. +// The callback is also the only way of being notified that data has actually been sent. +ws.send('something', function(error) { + // if error is null, the send has been completed, + // otherwise the error object will indicate what failed. +}); + +// Immediate errors can also be handled with try/catch-blocks, but **note** +// that since sends are inherently asynchronous, socket write failures will *not* +// be captured when this technique is used. +try { + ws.send('something'); +} +catch (e) { + // handle error +} +``` + +### echo.websocket.org demo ### + +```js +var WebSocket = require('ws'); +var ws = new WebSocket('ws://echo.websocket.org/', {protocolVersion: 8, origin: 'http://websocket.org'}); +ws.on('open', function() { + console.log('connected'); + ws.send(Date.now().toString(), {mask: true}); +}); +ws.on('close', function() { + console.log('disconnected'); +}); +ws.on('message', function(data, flags) { + console.log('Roundtrip time: ' + (Date.now() - parseInt(data)) + 'ms', flags); + setTimeout(function() { + ws.send(Date.now().toString(), {mask: true}); + }, 500); +}); +``` + +### wscat against echo.websocket.org ### + + $ npm install -g ws + $ wscat -c ws://echo.websocket.org + connected (press CTRL+C to quit) + > hi there + < hi there + > are you a happy parrot? + < are you a happy parrot? + +### Other examples ### + +For a full example with a browser client communicating with a ws server, see the examples folder. + +Note that the usage together with Express 3.0 is quite different from Express 2.x. The difference is expressed in the two different serverstats-examples. + +Otherwise, see the test cases. + +### Running the tests ### + +`make test` + +## API Docs ## + +See the doc/ directory for Node.js-like docs for the ws classes. + +## License ## + +(The MIT License) + +Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/bin/wscat b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/bin/wscat new file mode 100755 index 00000000..7c66600d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/bin/wscat @@ -0,0 +1,222 @@ +#!/usr/bin/env node + +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +/** + * Module dependencies. + */ + +var WebSocket = require('../') + , fs = require('fs') + , program = require('commander') + , util = require('util') + , events = require('events') + , readline = require('readline'); + +/** + * InputReader - processes console input + */ + +function Console() { + this.stdin = process.stdin; + this.stdout = process.stdout; + + this.readlineInterface = readline.createInterface(this.stdin, this.stdout); + + var self = this; + this.readlineInterface.on('line', function(data) { + self.emit('line', data); + }); + this.readlineInterface.on('close', function() { + self.emit('close'); + }); + + this._resetInput = function() { + self.clear(); + } +} +util.inherits(Console, events.EventEmitter); + +Console.Colors = { + Red: '\033[31m', + Green: '\033[32m', + Yellow: '\033[33m', + Blue: '\033[34m', + Default: '\033[39m' +}; + +Console.prototype.prompt = function() { + this.readlineInterface.prompt(); +} + +Console.prototype.print = function(msg, color) { + this.clear(); + color = color || Console.Colors.Default; + this.stdout.write(color + msg + Console.Colors.Default + '\n'); + this.prompt(); +} + +Console.prototype.clear = function() { + this.stdout.write('\033[2K\033[E'); +} + +Console.prototype.pause = function() { + this.stdin.on('keypress', this._resetInput); +} + +Console.prototype.resume = function() { + this.stdin.removeListener('keypress', this._resetInput); +} + +function appender(xs) { + xs = xs || []; + return function (x) { + xs.push(x); + return xs; + } +} + +function into(obj, kvals) { + kvals.forEach(function (kv) { + obj[kv[0]] = kv[1]; + }); + return obj; +} + +function splitOnce(sep, str) { // sep can be either String or RegExp + var tokens = str.split(sep); + return [tokens[0], str.replace(sep, '').substr(tokens[0].length)]; +} + +/** + * The actual application + */ + +var version = JSON.parse(fs.readFileSync(__dirname + '/../package.json', 'utf8')).version; +program + .version(version) + .usage('[options] ') + .option('-l, --listen ', 'listen on port') + .option('-c, --connect ', 'connect to a websocket server') + .option('-p, --protocol ', 'optional protocol version') + .option('-o, --origin ', 'optional origin') + .option('--host ', 'optional host') + .option('-s, --subprotocol ', 'optional subprotocol') + .option('-n, --no-check', 'Do not check for unauthorized certificates') + .option('-H, --header ', 'Set an HTTP header. Repeat to set multiple. (--connect only)', appender(), []) + .option('--auth ', 'Add basic HTTP authentication header. (--connect only)') + .parse(process.argv); + +if (program.listen && program.connect) { + console.error('\033[33merror: use either --listen or --connect\033[39m'); + process.exit(-1); +} +else if (program.listen) { + var wsConsole = new Console(); + wsConsole.pause(); + var options = {}; + if (program.protocol) options.protocolVersion = program.protocol; + if (program.origin) options.origin = program.origin; + if (program.subprotocol) options.protocol = program.subprotocol; + if (!program.check) options.rejectUnauthorized = program.check; + var ws = null; + var wss = new WebSocket.Server({port: program.listen}, function() { + wsConsole.print('listening on port ' + program.listen + ' (press CTRL+C to quit)', Console.Colors.Green); + wsConsole.clear(); + }); + wsConsole.on('close', function() { + if (ws) { + try { + ws.close(); + } + catch (e) {} + } + process.exit(0); + }); + wsConsole.on('line', function(data) { + if (ws) { + ws.send(data, {mask: false}); + wsConsole.prompt(); + } + }); + wss.on('connection', function(newClient) { + if (ws) { + // limit to one client + newClient.terminate(); + return; + }; + ws = newClient; + wsConsole.resume(); + wsConsole.prompt(); + wsConsole.print('client connected', Console.Colors.Green); + ws.on('close', function() { + wsConsole.print('disconnected', Console.Colors.Green); + wsConsole.clear(); + wsConsole.pause(); + ws = null; + }); + ws.on('error', function(code, description) { + wsConsole.print('error: ' + code + (description ? ' ' + description : ''), Console.Colors.Yellow); + }); + ws.on('message', function(data, flags) { + wsConsole.print('< ' + data, Console.Colors.Blue); + }); + }); + wss.on('error', function(error) { + wsConsole.print('error: ' + error.toString(), Console.Colors.Yellow); + process.exit(-1); + }); +} +else if (program.connect) { + var wsConsole = new Console(); + var options = {}; + if (program.protocol) options.protocolVersion = program.protocol; + if (program.origin) options.origin = program.origin; + if (program.subprotocol) options.protocol = program.subprotocol; + if (program.host) options.host = program.host; + if (!program.check) options.rejectUnauthorized = program.check; + var headers = into({}, (program.header || []).map(function (s) { + return splitOnce(':', s) + })); + if (program.auth) { + headers['Authorization'] = 'Basic ' + new Buffer(program.auth).toString('base64'); + } + options.headers = headers; + var ws = new WebSocket(program.connect, options); + ws.on('open', function() { + wsConsole.print('connected (press CTRL+C to quit)', Console.Colors.Green); + wsConsole.on('line', function(data) { + ws.send(data, {mask: true}); + wsConsole.prompt(); + }); + }); + ws.on('close', function() { + wsConsole.print('disconnected', Console.Colors.Green); + wsConsole.clear(); + process.exit(); + }); + ws.on('error', function(code, description) { + wsConsole.print('error: ' + code + (description ? ' ' + description : ''), Console.Colors.Yellow); + process.exit(-1); + }); + ws.on('message', function(data, flags) { + wsConsole.print('< ' + data, Console.Colors.Blue); + }); + wsConsole.on('close', function() { + if (ws) { + try { + ws.close(); + } + catch(e) {} + process.exit(); + } + }); +} +else { + console.error('\033[33merror: use either --listen or --connect\033[39m'); + process.exit(-1); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/binding.gyp b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/binding.gyp new file mode 100644 index 00000000..600f9d10 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/binding.gyp @@ -0,0 +1,16 @@ +{ + 'targets': [ + { + 'target_name': 'validation', + 'include_dirs': ["> $(depfile) +# Add extra rules as in (2). +# We remove slashes and replace spaces with new lines; +# remove blank lines; +# delete the first line and append a colon to the remaining lines. +sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ + grep -v '^$$' |\ + sed -e 1d -e 's|$$|:|' \ + >> $(depfile) +rm $(depfile).raw +endef + +# Command definitions: +# - cmd_foo is the actual command to run; +# - quiet_cmd_foo is the brief-output summary of the command. + +quiet_cmd_cc = CC($(TOOLSET)) $@ +cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_cxx = CXX($(TOOLSET)) $@ +cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< + +quiet_cmd_objc = CXX($(TOOLSET)) $@ +cmd_objc = $(CC.$(TOOLSET)) $(GYP_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< + +quiet_cmd_objcxx = CXX($(TOOLSET)) $@ +cmd_objcxx = $(CXX.$(TOOLSET)) $(GYP_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# Commands for precompiled header files. +quiet_cmd_pch_c = CXX($(TOOLSET)) $@ +cmd_pch_c = $(CC.$(TOOLSET)) $(GYP_PCH_CFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_cc = CXX($(TOOLSET)) $@ +cmd_pch_cc = $(CC.$(TOOLSET)) $(GYP_PCH_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< +quiet_cmd_pch_m = CXX($(TOOLSET)) $@ +cmd_pch_m = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCFLAGS) $(DEPFLAGS) -c -o $@ $< +quiet_cmd_pch_mm = CXX($(TOOLSET)) $@ +cmd_pch_mm = $(CC.$(TOOLSET)) $(GYP_PCH_OBJCXXFLAGS) $(DEPFLAGS) -c -o $@ $< + +# gyp-mac-tool is written next to the root Makefile by gyp. +# Use $(4) for the command, since $(2) and $(3) are used as flag by do_cmd +# already. +quiet_cmd_mac_tool = MACTOOL $(4) $< +cmd_mac_tool = ./gyp-mac-tool $(4) $< "$@" + +quiet_cmd_mac_package_framework = PACKAGE FRAMEWORK $@ +cmd_mac_package_framework = ./gyp-mac-tool package-framework "$@" $(4) + +quiet_cmd_infoplist = INFOPLIST $@ +cmd_infoplist = $(CC.$(TOOLSET)) -E -P -Wno-trigraphs -x c $(INFOPLIST_DEFINES) "$<" -o "$@" + +quiet_cmd_touch = TOUCH $@ +cmd_touch = touch $@ + +quiet_cmd_copy = COPY $@ +# send stderr to /dev/null to ignore messages when linking directories. +cmd_copy = rm -rf "$@" && cp -af "$<" "$@" + +quiet_cmd_alink = LIBTOOL-STATIC $@ +cmd_alink = rm -f $@ && ./gyp-mac-tool filter-libtool libtool $(GYP_LIBTOOLFLAGS) -static -o $@ $(filter %.o,$^) + +quiet_cmd_link = LINK($(TOOLSET)) $@ +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink = SOLINK($(TOOLSET)) $@ +cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o "$@" $(LD_INPUTS) $(LIBS) + +quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ +cmd_solink_module = $(LINK.$(TOOLSET)) -bundle $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ $(filter-out FORCE_DO_CMD, $^) $(LIBS) + + +# Define an escape_quotes function to escape single quotes. +# This allows us to handle quotes properly as long as we always use +# use single quotes and escape_quotes. +escape_quotes = $(subst ','\'',$(1)) +# This comment is here just to include a ' to unconfuse syntax highlighting. +# Define an escape_vars function to escape '$' variable syntax. +# This allows us to read/write command lines with shell variables (e.g. +# $LD_LIBRARY_PATH), without triggering make substitution. +escape_vars = $(subst $$,$$$$,$(1)) +# Helper that expands to a shell command to echo a string exactly as it is in +# make. This uses printf instead of echo because printf's behaviour with respect +# to escape sequences is more portable than echo's across different shells +# (e.g., dash, bash). +exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' + +# Helper to compare the command we're about to run against the command +# we logged the last time we ran the command. Produces an empty +# string (false) when the commands match. +# Tricky point: Make has no string-equality test function. +# The kernel uses the following, but it seems like it would have false +# positives, where one string reordered its arguments. +# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ +# $(filter-out $(cmd_$@), $(cmd_$(1)))) +# We instead substitute each for the empty string into the other, and +# say they're equal if both substitutions produce the empty string. +# .d files contain ? instead of spaces, take that into account. +command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ + $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) + +# Helper that is non-empty when a prerequisite changes. +# Normally make does this implicitly, but we force rules to always run +# so we can check their command lines. +# $? -- new prerequisites +# $| -- order-only dependencies +prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) + +# Helper that executes all postbuilds until one fails. +define do_postbuilds + @E=0;\ + for p in $(POSTBUILDS); do\ + eval $$p;\ + E=$$?;\ + if [ $$E -ne 0 ]; then\ + break;\ + fi;\ + done;\ + if [ $$E -ne 0 ]; then\ + rm -rf "$@";\ + exit $$E;\ + fi +endef + +# do_cmd: run a command via the above cmd_foo names, if necessary. +# Should always run for a given target to handle command-line changes. +# Second argument, if non-zero, makes it do asm/C/C++ dependency munging. +# Third argument, if non-zero, makes it do POSTBUILDS processing. +# Note: We intentionally do NOT call dirx for depfile, since it contains ? for +# spaces already and dirx strips the ? characters. +define do_cmd +$(if $(or $(command_changed),$(prereq_changed)), + @$(call exact_echo, $($(quiet)cmd_$(1))) + @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" + $(if $(findstring flock,$(word 2,$(cmd_$1))), + @$(cmd_$(1)) + @echo " $(quiet_cmd_$(1)): Finished", + @$(cmd_$(1)) + ) + @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) + @$(if $(2),$(fixup_dep)) + $(if $(and $(3), $(POSTBUILDS)), + $(call do_postbuilds) + ) +) +endef + +# Declare the "all" target first so it is the default, +# even though we don't have the deps yet. +.PHONY: all +all: + +# make looks for ways to re-generate included makefiles, but in our case, we +# don't have a direct way. Explicitly telling make that it has nothing to do +# for them makes it go faster. +%.d: ; + +# Use FORCE_DO_CMD to force a target to run. Should be coupled with +# do_cmd. +.PHONY: FORCE_DO_CMD +FORCE_DO_CMD: + +TOOLSET := target +# Suffix rules, putting all outputs into $(obj). +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.m FORCE_DO_CMD + @$(call do_cmd,objc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.mm FORCE_DO_CMD + @$(call do_cmd,objcxx,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +# Try building from generated source, too. +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.m FORCE_DO_CMD + @$(call do_cmd,objc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.mm FORCE_DO_CMD + @$(call do_cmd,objcxx,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + +$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD + @$(call do_cmd,cxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.m FORCE_DO_CMD + @$(call do_cmd,objc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.mm FORCE_DO_CMD + @$(call do_cmd,objcxx,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD + @$(call do_cmd,cc,1) +$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD + @$(call do_cmd,cc,1) + + +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,bufferutil.target.mk)))),) + include bufferutil.target.mk +endif +ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ + $(findstring $(join ^,$(prefix)),\ + $(join ^,validation.target.mk)))),) + include validation.target.mk +endif + +quiet_cmd_regen_makefile = ACTION Regenerating $@ +cmd_regen_makefile = cd $(srcdir); /Users/david/.nvm/v4.1.2/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/david/VSCode-Extensions/vscode-instant-markdown/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/config.gypi -I/Users/david/.nvm/v4.1.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/david/.node-gyp/4.1.2/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/david/.node-gyp/4.1.2" "-Dnode_gyp_dir=/Users/david/.nvm/v4.1.2/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=node.lib" "-Dmodule_root_dir=/Users/david/VSCode-Extensions/vscode-instant-markdown/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws" binding.gyp +Makefile: $(srcdir)/../../../../../../../../../../.nvm/v4.1.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../../../../../../../.node-gyp/4.1.2/include/node/common.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp + $(call do_cmd,regen_makefile) + +# "all" is a concatenation of the "all" targets from all the included +# sub-makefiles. This is just here to clarify. +all: + +# Add in dependency-tracking rules. $(all_deps) is the list of every single +# target in our tree. Only consider the ones with .d (dependency) info: +d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) +ifneq ($(d_files),) + include $(d_files) +endif diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d.raw b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d.raw new file mode 100644 index 00000000..8c2534d7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d.raw @@ -0,0 +1,15 @@ +Release/obj.target/bufferutil/src/bufferutil.o: ../src/bufferutil.cc \ + /Users/david/.node-gyp/4.1.2/include/node/v8.h \ + /Users/david/.node-gyp/4.1.2/include/node/v8-version.h \ + /Users/david/.node-gyp/4.1.2/include/node/v8config.h \ + /Users/david/.node-gyp/4.1.2/include/node/node.h \ + /Users/david/.node-gyp/4.1.2/include/node/node_version.h \ + /Users/david/.node-gyp/4.1.2/include/node/node_buffer.h \ + /Users/david/.node-gyp/4.1.2/include/node/node_object_wrap.h \ + ../node_modules/nan/nan.h \ + /Users/david/.node-gyp/4.1.2/include/node/uv.h \ + /Users/david/.node-gyp/4.1.2/include/node/uv-errno.h \ + /Users/david/.node-gyp/4.1.2/include/node/uv-version.h \ + /Users/david/.node-gyp/4.1.2/include/node/uv-unix.h \ + /Users/david/.node-gyp/4.1.2/include/node/uv-threadpool.h \ + /Users/david/.node-gyp/4.1.2/include/node/uv-darwin.h diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/binding.Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/binding.Makefile new file mode 100644 index 00000000..5d26a451 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/binding.Makefile @@ -0,0 +1,6 @@ +# This file is generated by gyp; do not edit. + +export builddir_name ?= ./build/. +.PHONY: all +all: + $(MAKE) validation bufferutil diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/bufferutil.target.mk b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/bufferutil.target.mk new file mode 100644 index 00000000..036f3d49 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/bufferutil.target.mk @@ -0,0 +1,165 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := bufferutil +DEFS_Debug := \ + '-DNODE_GYP_MODULE_NAME=bufferutil' \ + '-D_DARWIN_USE_64_BIT_INODE=1' \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' \ + '-DDEBUG' \ + '-D_DEBUG' + +# Flags passed to all source files. +CFLAGS_Debug := \ + -O0 \ + -gdwarf-2 \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -Wall \ + -Wendif-labels \ + -W \ + -Wno-unused-parameter + +# Flags passed to only C files. +CFLAGS_C_Debug := \ + -fno-strict-aliasing + +# Flags passed to only C++ files. +CFLAGS_CC_Debug := \ + -std=gnu++0x \ + -fno-rtti \ + -fno-exceptions \ + -fno-threadsafe-statics \ + -fno-strict-aliasing + +# Flags passed to only ObjC files. +CFLAGS_OBJC_Debug := + +# Flags passed to only ObjC++ files. +CFLAGS_OBJCC_Debug := + +INCS_Debug := \ + -I/Users/david/.node-gyp/4.1.2/include/node \ + -I/Users/david/.node-gyp/4.1.2/src \ + -I/Users/david/.node-gyp/4.1.2/deps/uv/include \ + -I/Users/david/.node-gyp/4.1.2/deps/v8/include \ + -I$(srcdir)/node_modules/nan + +DEFS_Release := \ + '-DNODE_GYP_MODULE_NAME=bufferutil' \ + '-D_DARWIN_USE_64_BIT_INODE=1' \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' + +# Flags passed to all source files. +CFLAGS_Release := \ + -Os \ + -gdwarf-2 \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -Wall \ + -Wendif-labels \ + -W \ + -Wno-unused-parameter + +# Flags passed to only C files. +CFLAGS_C_Release := \ + -fno-strict-aliasing + +# Flags passed to only C++ files. +CFLAGS_CC_Release := \ + -std=gnu++0x \ + -fno-rtti \ + -fno-exceptions \ + -fno-threadsafe-statics \ + -fno-strict-aliasing + +# Flags passed to only ObjC files. +CFLAGS_OBJC_Release := + +# Flags passed to only ObjC++ files. +CFLAGS_OBJCC_Release := + +INCS_Release := \ + -I/Users/david/.node-gyp/4.1.2/include/node \ + -I/Users/david/.node-gyp/4.1.2/src \ + -I/Users/david/.node-gyp/4.1.2/deps/uv/include \ + -I/Users/david/.node-gyp/4.1.2/deps/v8/include \ + -I$(srcdir)/node_modules/nan + +OBJS := \ + $(obj).target/$(TARGET)/src/bufferutil.o + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual. +$(OBJS): TOOLSET := $(TOOLSET) +$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) +$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) +$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE)) +$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE)) + +# Suffix rules, putting all outputs into $(obj). + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# Try building from generated source, too. + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# End of this set of suffix rules +### Rules for final target. +LDFLAGS_Debug := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -L$(builddir) + +LIBTOOLFLAGS_Debug := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first + +LDFLAGS_Release := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -L$(builddir) + +LIBTOOLFLAGS_Release := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first + +LIBS := + +$(builddir)/bufferutil.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) +$(builddir)/bufferutil.node: LIBS := $(LIBS) +$(builddir)/bufferutil.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE)) +$(builddir)/bufferutil.node: TOOLSET := $(TOOLSET) +$(builddir)/bufferutil.node: $(OBJS) FORCE_DO_CMD + $(call do_cmd,solink_module) + +all_deps += $(builddir)/bufferutil.node +# Add target alias +.PHONY: bufferutil +bufferutil: $(builddir)/bufferutil.node + +# Short alias for building this executable. +.PHONY: bufferutil.node +bufferutil.node: $(builddir)/bufferutil.node + +# Add executable to "all" target. +.PHONY: all +all: $(builddir)/bufferutil.node + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/config.gypi b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/config.gypi new file mode 100644 index 00000000..78225d26 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/config.gypi @@ -0,0 +1,138 @@ +# Do not edit. File was generated by node-gyp's "configure" step +{ + "target_defaults": { + "cflags": [], + "default_configuration": "Release", + "defines": [], + "include_dirs": [], + "libraries": [] + }, + "variables": { + "asan": 0, + "host_arch": "x64", + "icu_data_file": "icudt55l.dat", + "icu_data_in": "../../deps/icu/source/data/in/icudt55l.dat", + "icu_endianness": "l", + "icu_gyp_path": "tools/icu/icu-generic.gyp", + "icu_locales": "en,root", + "icu_path": "./deps/icu", + "icu_small": "true", + "icu_ver_major": "55", + "llvm_version": "3.6", + "node_byteorder": "little", + "node_install_npm": "true", + "node_prefix": "/", + "node_release_urlbase": "https://nodejs.org/download/release/", + "node_shared_http_parser": "false", + "node_shared_libuv": "false", + "node_shared_openssl": "false", + "node_shared_zlib": "false", + "node_tag": "", + "node_use_dtrace": "true", + "node_use_etw": "false", + "node_use_lttng": "false", + "node_use_openssl": "true", + "node_use_perfctr": "false", + "openssl_fips": "", + "openssl_no_asm": 0, + "python": "/usr/bin/python", + "target_arch": "x64", + "uv_parent_path": "/deps/uv/", + "uv_use_dtrace": "true", + "v8_enable_gdbjit": 0, + "v8_enable_i18n_support": 1, + "v8_no_strict_aliasing": 1, + "v8_optimized_debug": 0, + "v8_random_seed": 0, + "v8_use_snapshot": 1, + "want_separate_host_toolset": 0, + "nodedir": "/Users/david/.node-gyp/4.1.2", + "copy_dev_lib": "true", + "standalone_static_library": 1, + "save_dev": "", + "browser": "", + "viewer": "man", + "rollback": "true", + "usage": "", + "globalignorefile": "/Users/david/.nvm/v4.1.2/etc/npmignore", + "init_author_url": "", + "shell": "/bin/zsh", + "parseable": "", + "shrinkwrap": "true", + "init_license": "ISC", + "if_present": "", + "cache_max": "Infinity", + "init_author_email": "", + "sign_git_tag": "", + "cert": "", + "git_tag_version": "true", + "local_address": "", + "long": "", + "fetch_retries": "2", + "npat": "", + "registry": "https://registry.npmjs.org/", + "key": "", + "message": "%s", + "versions": "", + "globalconfig": "/Users/david/.nvm/v4.1.2/etc/npmrc", + "always_auth": "", + "spin": "true", + "cache_lock_retries": "10", + "cafile": "", + "heading": "npm", + "fetch_retry_mintimeout": "10000", + "proprietary_attribs": "true", + "access": "", + "json": "", + "description": "true", + "engine_strict": "", + "https_proxy": "", + "init_module": "/Users/david/.npm-init.js", + "userconfig": "/Users/david/.npmrc", + "node_version": "4.1.2", + "user": "501", + "editor": "vim", + "save": "", + "tag": "latest", + "global": "", + "optional": "true", + "bin_links": "true", + "force": "", + "searchopts": "", + "depth": "Infinity", + "rebuild_bundle": "true", + "searchsort": "name", + "unicode": "true", + "fetch_retry_maxtimeout": "60000", + "ca": "", + "save_prefix": "^", + "strict_ssl": "true", + "tag_version_prefix": "v", + "dev": "", + "fetch_retry_factor": "10", + "group": "20", + "save_exact": "", + "cache_lock_stale": "60000", + "version": "", + "cache_min": "10", + "cache": "/Users/david/.npm", + "searchexclude": "", + "color": "true", + "save_optional": "", + "user_agent": "npm/2.14.4 node/v4.1.2 darwin x64", + "ignore_scripts": "", + "cache_lock_wait": "10000", + "production": "", + "save_bundle": "", + "init_version": "1.0.0", + "umask": "0022", + "git": "git", + "init_author_name": "", + "scope": "", + "onload_script": "", + "tmp": "/var/folders/4s/zqprhwwn78vbpywp7ws69kv00000gn/T", + "unsafe_perm": "true", + "link": "", + "prefix": "/Users/david/.nvm/v4.1.2" + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/gyp-mac-tool b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/gyp-mac-tool new file mode 100755 index 00000000..976c5987 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/gyp-mac-tool @@ -0,0 +1,612 @@ +#!/usr/bin/env python +# Generated by gyp. Do not edit. +# Copyright (c) 2012 Google Inc. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +"""Utility functions to perform Xcode-style build steps. + +These functions are executed via gyp-mac-tool when using the Makefile generator. +""" + +import fcntl +import fnmatch +import glob +import json +import os +import plistlib +import re +import shutil +import string +import subprocess +import sys +import tempfile + + +def main(args): + executor = MacTool() + exit_code = executor.Dispatch(args) + if exit_code is not None: + sys.exit(exit_code) + + +class MacTool(object): + """This class performs all the Mac tooling steps. The methods can either be + executed directly, or dispatched from an argument list.""" + + def Dispatch(self, args): + """Dispatches a string command to a method.""" + if len(args) < 1: + raise Exception("Not enough arguments") + + method = "Exec%s" % self._CommandifyName(args[0]) + return getattr(self, method)(*args[1:]) + + def _CommandifyName(self, name_string): + """Transforms a tool name like copy-info-plist to CopyInfoPlist""" + return name_string.title().replace('-', '') + + def ExecCopyBundleResource(self, source, dest, convert_to_binary): + """Copies a resource file to the bundle/Resources directory, performing any + necessary compilation on each resource.""" + extension = os.path.splitext(source)[1].lower() + if os.path.isdir(source): + # Copy tree. + # TODO(thakis): This copies file attributes like mtime, while the + # single-file branch below doesn't. This should probably be changed to + # be consistent with the single-file branch. + if os.path.exists(dest): + shutil.rmtree(dest) + shutil.copytree(source, dest) + elif extension == '.xib': + return self._CopyXIBFile(source, dest) + elif extension == '.storyboard': + return self._CopyXIBFile(source, dest) + elif extension == '.strings': + self._CopyStringsFile(source, dest, convert_to_binary) + else: + shutil.copy(source, dest) + + def _CopyXIBFile(self, source, dest): + """Compiles a XIB file with ibtool into a binary plist in the bundle.""" + + # ibtool sometimes crashes with relative paths. See crbug.com/314728. + base = os.path.dirname(os.path.realpath(__file__)) + if os.path.relpath(source): + source = os.path.join(base, source) + if os.path.relpath(dest): + dest = os.path.join(base, dest) + + args = ['xcrun', 'ibtool', '--errors', '--warnings', '--notices', + '--output-format', 'human-readable-text', '--compile', dest, source] + ibtool_section_re = re.compile(r'/\*.*\*/') + ibtool_re = re.compile(r'.*note:.*is clipping its content') + ibtoolout = subprocess.Popen(args, stdout=subprocess.PIPE) + current_section_header = None + for line in ibtoolout.stdout: + if ibtool_section_re.match(line): + current_section_header = line + elif not ibtool_re.match(line): + if current_section_header: + sys.stdout.write(current_section_header) + current_section_header = None + sys.stdout.write(line) + return ibtoolout.returncode + + def _ConvertToBinary(self, dest): + subprocess.check_call([ + 'xcrun', 'plutil', '-convert', 'binary1', '-o', dest, dest]) + + def _CopyStringsFile(self, source, dest, convert_to_binary): + """Copies a .strings file using iconv to reconvert the input into UTF-16.""" + input_code = self._DetectInputEncoding(source) or "UTF-8" + + # Xcode's CpyCopyStringsFile / builtin-copyStrings seems to call + # CFPropertyListCreateFromXMLData() behind the scenes; at least it prints + # CFPropertyListCreateFromXMLData(): Old-style plist parser: missing + # semicolon in dictionary. + # on invalid files. Do the same kind of validation. + import CoreFoundation + s = open(source, 'rb').read() + d = CoreFoundation.CFDataCreate(None, s, len(s)) + _, error = CoreFoundation.CFPropertyListCreateFromXMLData(None, d, 0, None) + if error: + return + + fp = open(dest, 'wb') + fp.write(s.decode(input_code).encode('UTF-16')) + fp.close() + + if convert_to_binary == 'True': + self._ConvertToBinary(dest) + + def _DetectInputEncoding(self, file_name): + """Reads the first few bytes from file_name and tries to guess the text + encoding. Returns None as a guess if it can't detect it.""" + fp = open(file_name, 'rb') + try: + header = fp.read(3) + except e: + fp.close() + return None + fp.close() + if header.startswith("\xFE\xFF"): + return "UTF-16" + elif header.startswith("\xFF\xFE"): + return "UTF-16" + elif header.startswith("\xEF\xBB\xBF"): + return "UTF-8" + else: + return None + + def ExecCopyInfoPlist(self, source, dest, convert_to_binary, *keys): + """Copies the |source| Info.plist to the destination directory |dest|.""" + # Read the source Info.plist into memory. + fd = open(source, 'r') + lines = fd.read() + fd.close() + + # Insert synthesized key/value pairs (e.g. BuildMachineOSBuild). + plist = plistlib.readPlistFromString(lines) + if keys: + plist = dict(plist.items() + json.loads(keys[0]).items()) + lines = plistlib.writePlistToString(plist) + + # Go through all the environment variables and replace them as variables in + # the file. + IDENT_RE = re.compile(r'[/\s]') + for key in os.environ: + if key.startswith('_'): + continue + evar = '${%s}' % key + evalue = os.environ[key] + lines = string.replace(lines, evar, evalue) + + # Xcode supports various suffices on environment variables, which are + # all undocumented. :rfc1034identifier is used in the standard project + # template these days, and :identifier was used earlier. They are used to + # convert non-url characters into things that look like valid urls -- + # except that the replacement character for :identifier, '_' isn't valid + # in a URL either -- oops, hence :rfc1034identifier was born. + evar = '${%s:identifier}' % key + evalue = IDENT_RE.sub('_', os.environ[key]) + lines = string.replace(lines, evar, evalue) + + evar = '${%s:rfc1034identifier}' % key + evalue = IDENT_RE.sub('-', os.environ[key]) + lines = string.replace(lines, evar, evalue) + + # Remove any keys with values that haven't been replaced. + lines = lines.split('\n') + for i in range(len(lines)): + if lines[i].strip().startswith("${"): + lines[i] = None + lines[i - 1] = None + lines = '\n'.join(filter(lambda x: x is not None, lines)) + + # Write out the file with variables replaced. + fd = open(dest, 'w') + fd.write(lines) + fd.close() + + # Now write out PkgInfo file now that the Info.plist file has been + # "compiled". + self._WritePkgInfo(dest) + + if convert_to_binary == 'True': + self._ConvertToBinary(dest) + + def _WritePkgInfo(self, info_plist): + """This writes the PkgInfo file from the data stored in Info.plist.""" + plist = plistlib.readPlist(info_plist) + if not plist: + return + + # Only create PkgInfo for executable types. + package_type = plist['CFBundlePackageType'] + if package_type != 'APPL': + return + + # The format of PkgInfo is eight characters, representing the bundle type + # and bundle signature, each four characters. If that is missing, four + # '?' characters are used instead. + signature_code = plist.get('CFBundleSignature', '????') + if len(signature_code) != 4: # Wrong length resets everything, too. + signature_code = '?' * 4 + + dest = os.path.join(os.path.dirname(info_plist), 'PkgInfo') + fp = open(dest, 'w') + fp.write('%s%s' % (package_type, signature_code)) + fp.close() + + def ExecFlock(self, lockfile, *cmd_list): + """Emulates the most basic behavior of Linux's flock(1).""" + # Rely on exception handling to report errors. + fd = os.open(lockfile, os.O_RDONLY|os.O_NOCTTY|os.O_CREAT, 0o666) + fcntl.flock(fd, fcntl.LOCK_EX) + return subprocess.call(cmd_list) + + def ExecFilterLibtool(self, *cmd_list): + """Calls libtool and filters out '/path/to/libtool: file: foo.o has no + symbols'.""" + libtool_re = re.compile(r'^.*libtool: file: .* has no symbols$') + libtool_re5 = re.compile( + r'^.*libtool: warning for library: ' + + r'.* the table of contents is empty ' + + r'\(no object file members in the library define global symbols\)$') + env = os.environ.copy() + # Ref: + # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c + # The problem with this flag is that it resets the file mtime on the file to + # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on timezone. + env['ZERO_AR_DATE'] = '1' + libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) + _, err = libtoolout.communicate() + for line in err.splitlines(): + if not libtool_re.match(line) and not libtool_re5.match(line): + print >>sys.stderr, line + # Unconditionally touch the output .a file on the command line if present + # and the command succeeded. A bit hacky. + if not libtoolout.returncode: + for i in range(len(cmd_list) - 1): + if cmd_list[i] == "-o" and cmd_list[i+1].endswith('.a'): + os.utime(cmd_list[i+1], None) + break + return libtoolout.returncode + + def ExecPackageFramework(self, framework, version): + """Takes a path to Something.framework and the Current version of that and + sets up all the symlinks.""" + # Find the name of the binary based on the part before the ".framework". + binary = os.path.basename(framework).split('.')[0] + + CURRENT = 'Current' + RESOURCES = 'Resources' + VERSIONS = 'Versions' + + if not os.path.exists(os.path.join(framework, VERSIONS, version, binary)): + # Binary-less frameworks don't seem to contain symlinks (see e.g. + # chromium's out/Debug/org.chromium.Chromium.manifest/ bundle). + return + + # Move into the framework directory to set the symlinks correctly. + pwd = os.getcwd() + os.chdir(framework) + + # Set up the Current version. + self._Relink(version, os.path.join(VERSIONS, CURRENT)) + + # Set up the root symlinks. + self._Relink(os.path.join(VERSIONS, CURRENT, binary), binary) + self._Relink(os.path.join(VERSIONS, CURRENT, RESOURCES), RESOURCES) + + # Back to where we were before! + os.chdir(pwd) + + def _Relink(self, dest, link): + """Creates a symlink to |dest| named |link|. If |link| already exists, + it is overwritten.""" + if os.path.lexists(link): + os.remove(link) + os.symlink(dest, link) + + def ExecCompileXcassets(self, keys, *inputs): + """Compiles multiple .xcassets files into a single .car file. + + This invokes 'actool' to compile all the inputs .xcassets files. The + |keys| arguments is a json-encoded dictionary of extra arguments to + pass to 'actool' when the asset catalogs contains an application icon + or a launch image. + + Note that 'actool' does not create the Assets.car file if the asset + catalogs does not contains imageset. + """ + command_line = [ + 'xcrun', 'actool', '--output-format', 'human-readable-text', + '--compress-pngs', '--notices', '--warnings', '--errors', + ] + is_iphone_target = 'IPHONEOS_DEPLOYMENT_TARGET' in os.environ + if is_iphone_target: + platform = os.environ['CONFIGURATION'].split('-')[-1] + if platform not in ('iphoneos', 'iphonesimulator'): + platform = 'iphonesimulator' + command_line.extend([ + '--platform', platform, '--target-device', 'iphone', + '--target-device', 'ipad', '--minimum-deployment-target', + os.environ['IPHONEOS_DEPLOYMENT_TARGET'], '--compile', + os.path.abspath(os.environ['CONTENTS_FOLDER_PATH']), + ]) + else: + command_line.extend([ + '--platform', 'macosx', '--target-device', 'mac', + '--minimum-deployment-target', os.environ['MACOSX_DEPLOYMENT_TARGET'], + '--compile', + os.path.abspath(os.environ['UNLOCALIZED_RESOURCES_FOLDER_PATH']), + ]) + if keys: + keys = json.loads(keys) + for key, value in keys.iteritems(): + arg_name = '--' + key + if isinstance(value, bool): + if value: + command_line.append(arg_name) + elif isinstance(value, list): + for v in value: + command_line.append(arg_name) + command_line.append(str(v)) + else: + command_line.append(arg_name) + command_line.append(str(value)) + # Note: actool crashes if inputs path are relative, so use os.path.abspath + # to get absolute path name for inputs. + command_line.extend(map(os.path.abspath, inputs)) + subprocess.check_call(command_line) + + def ExecMergeInfoPlist(self, output, *inputs): + """Merge multiple .plist files into a single .plist file.""" + merged_plist = {} + for path in inputs: + plist = self._LoadPlistMaybeBinary(path) + self._MergePlist(merged_plist, plist) + plistlib.writePlist(merged_plist, output) + + def ExecCodeSignBundle(self, key, resource_rules, entitlements, provisioning): + """Code sign a bundle. + + This function tries to code sign an iOS bundle, following the same + algorithm as Xcode: + 1. copy ResourceRules.plist from the user or the SDK into the bundle, + 2. pick the provisioning profile that best match the bundle identifier, + and copy it into the bundle as embedded.mobileprovision, + 3. copy Entitlements.plist from user or SDK next to the bundle, + 4. code sign the bundle. + """ + resource_rules_path = self._InstallResourceRules(resource_rules) + substitutions, overrides = self._InstallProvisioningProfile( + provisioning, self._GetCFBundleIdentifier()) + entitlements_path = self._InstallEntitlements( + entitlements, substitutions, overrides) + subprocess.check_call([ + 'codesign', '--force', '--sign', key, '--resource-rules', + resource_rules_path, '--entitlements', entitlements_path, + os.path.join( + os.environ['TARGET_BUILD_DIR'], + os.environ['FULL_PRODUCT_NAME'])]) + + def _InstallResourceRules(self, resource_rules): + """Installs ResourceRules.plist from user or SDK into the bundle. + + Args: + resource_rules: string, optional, path to the ResourceRules.plist file + to use, default to "${SDKROOT}/ResourceRules.plist" + + Returns: + Path to the copy of ResourceRules.plist into the bundle. + """ + source_path = resource_rules + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['CONTENTS_FOLDER_PATH'], + 'ResourceRules.plist') + if not source_path: + source_path = os.path.join( + os.environ['SDKROOT'], 'ResourceRules.plist') + shutil.copy2(source_path, target_path) + return target_path + + def _InstallProvisioningProfile(self, profile, bundle_identifier): + """Installs embedded.mobileprovision into the bundle. + + Args: + profile: string, optional, short name of the .mobileprovision file + to use, if empty or the file is missing, the best file installed + will be used + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + + Returns: + A tuple containing two dictionary: variables substitutions and values + to overrides when generating the entitlements file. + """ + source_path, provisioning_data, team_id = self._FindProvisioningProfile( + profile, bundle_identifier) + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['CONTENTS_FOLDER_PATH'], + 'embedded.mobileprovision') + shutil.copy2(source_path, target_path) + substitutions = self._GetSubstitutions(bundle_identifier, team_id + '.') + return substitutions, provisioning_data['Entitlements'] + + def _FindProvisioningProfile(self, profile, bundle_identifier): + """Finds the .mobileprovision file to use for signing the bundle. + + Checks all the installed provisioning profiles (or if the user specified + the PROVISIONING_PROFILE variable, only consult it) and select the most + specific that correspond to the bundle identifier. + + Args: + profile: string, optional, short name of the .mobileprovision file + to use, if empty or the file is missing, the best file installed + will be used + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + + Returns: + A tuple of the path to the selected provisioning profile, the data of + the embedded plist in the provisioning profile and the team identifier + to use for code signing. + + Raises: + SystemExit: if no .mobileprovision can be used to sign the bundle. + """ + profiles_dir = os.path.join( + os.environ['HOME'], 'Library', 'MobileDevice', 'Provisioning Profiles') + if not os.path.isdir(profiles_dir): + print >>sys.stderr, ( + 'cannot find mobile provisioning for %s' % bundle_identifier) + sys.exit(1) + provisioning_profiles = None + if profile: + profile_path = os.path.join(profiles_dir, profile + '.mobileprovision') + if os.path.exists(profile_path): + provisioning_profiles = [profile_path] + if not provisioning_profiles: + provisioning_profiles = glob.glob( + os.path.join(profiles_dir, '*.mobileprovision')) + valid_provisioning_profiles = {} + for profile_path in provisioning_profiles: + profile_data = self._LoadProvisioningProfile(profile_path) + app_id_pattern = profile_data.get( + 'Entitlements', {}).get('application-identifier', '') + for team_identifier in profile_data.get('TeamIdentifier', []): + app_id = '%s.%s' % (team_identifier, bundle_identifier) + if fnmatch.fnmatch(app_id, app_id_pattern): + valid_provisioning_profiles[app_id_pattern] = ( + profile_path, profile_data, team_identifier) + if not valid_provisioning_profiles: + print >>sys.stderr, ( + 'cannot find mobile provisioning for %s' % bundle_identifier) + sys.exit(1) + # If the user has multiple provisioning profiles installed that can be + # used for ${bundle_identifier}, pick the most specific one (ie. the + # provisioning profile whose pattern is the longest). + selected_key = max(valid_provisioning_profiles, key=lambda v: len(v)) + return valid_provisioning_profiles[selected_key] + + def _LoadProvisioningProfile(self, profile_path): + """Extracts the plist embedded in a provisioning profile. + + Args: + profile_path: string, path to the .mobileprovision file + + Returns: + Content of the plist embedded in the provisioning profile as a dictionary. + """ + with tempfile.NamedTemporaryFile() as temp: + subprocess.check_call([ + 'security', 'cms', '-D', '-i', profile_path, '-o', temp.name]) + return self._LoadPlistMaybeBinary(temp.name) + + def _MergePlist(self, merged_plist, plist): + """Merge |plist| into |merged_plist|.""" + for key, value in plist.iteritems(): + if isinstance(value, dict): + merged_value = merged_plist.get(key, {}) + if isinstance(merged_value, dict): + self._MergePlist(merged_value, value) + merged_plist[key] = merged_value + else: + merged_plist[key] = value + else: + merged_plist[key] = value + + def _LoadPlistMaybeBinary(self, plist_path): + """Loads into a memory a plist possibly encoded in binary format. + + This is a wrapper around plistlib.readPlist that tries to convert the + plist to the XML format if it can't be parsed (assuming that it is in + the binary format). + + Args: + plist_path: string, path to a plist file, in XML or binary format + + Returns: + Content of the plist as a dictionary. + """ + try: + # First, try to read the file using plistlib that only supports XML, + # and if an exception is raised, convert a temporary copy to XML and + # load that copy. + return plistlib.readPlist(plist_path) + except: + pass + with tempfile.NamedTemporaryFile() as temp: + shutil.copy2(plist_path, temp.name) + subprocess.check_call(['plutil', '-convert', 'xml1', temp.name]) + return plistlib.readPlist(temp.name) + + def _GetSubstitutions(self, bundle_identifier, app_identifier_prefix): + """Constructs a dictionary of variable substitutions for Entitlements.plist. + + Args: + bundle_identifier: string, value of CFBundleIdentifier from Info.plist + app_identifier_prefix: string, value for AppIdentifierPrefix + + Returns: + Dictionary of substitutions to apply when generating Entitlements.plist. + """ + return { + 'CFBundleIdentifier': bundle_identifier, + 'AppIdentifierPrefix': app_identifier_prefix, + } + + def _GetCFBundleIdentifier(self): + """Extracts CFBundleIdentifier value from Info.plist in the bundle. + + Returns: + Value of CFBundleIdentifier in the Info.plist located in the bundle. + """ + info_plist_path = os.path.join( + os.environ['TARGET_BUILD_DIR'], + os.environ['INFOPLIST_PATH']) + info_plist_data = self._LoadPlistMaybeBinary(info_plist_path) + return info_plist_data['CFBundleIdentifier'] + + def _InstallEntitlements(self, entitlements, substitutions, overrides): + """Generates and install the ${BundleName}.xcent entitlements file. + + Expands variables "$(variable)" pattern in the source entitlements file, + add extra entitlements defined in the .mobileprovision file and the copy + the generated plist to "${BundlePath}.xcent". + + Args: + entitlements: string, optional, path to the Entitlements.plist template + to use, defaults to "${SDKROOT}/Entitlements.plist" + substitutions: dictionary, variable substitutions + overrides: dictionary, values to add to the entitlements + + Returns: + Path to the generated entitlements file. + """ + source_path = entitlements + target_path = os.path.join( + os.environ['BUILT_PRODUCTS_DIR'], + os.environ['PRODUCT_NAME'] + '.xcent') + if not source_path: + source_path = os.path.join( + os.environ['SDKROOT'], + 'Entitlements.plist') + shutil.copy2(source_path, target_path) + data = self._LoadPlistMaybeBinary(target_path) + data = self._ExpandVariables(data, substitutions) + if overrides: + for key in overrides: + if key not in data: + data[key] = overrides[key] + plistlib.writePlist(data, target_path) + return target_path + + def _ExpandVariables(self, data, substitutions): + """Expands variables "$(variable)" in data. + + Args: + data: object, can be either string, list or dictionary + substitutions: dictionary, variable substitutions to perform + + Returns: + Copy of data where each references to "$(variable)" has been replaced + by the corresponding value found in substitutions, or left intact if + the key was not found. + """ + if isinstance(data, str): + for key, value in substitutions.iteritems(): + data = data.replace('$(%s)' % key, value) + return data + if isinstance(data, list): + return [self._ExpandVariables(v, substitutions) for v in data] + if isinstance(data, dict): + return dict((k, self._ExpandVariables(data[k], + substitutions)) for k in data) + return data + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/validation.target.mk b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/validation.target.mk new file mode 100644 index 00000000..c2f09c7b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/build/validation.target.mk @@ -0,0 +1,165 @@ +# This file is generated by gyp; do not edit. + +TOOLSET := target +TARGET := validation +DEFS_Debug := \ + '-DNODE_GYP_MODULE_NAME=validation' \ + '-D_DARWIN_USE_64_BIT_INODE=1' \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' \ + '-DDEBUG' \ + '-D_DEBUG' + +# Flags passed to all source files. +CFLAGS_Debug := \ + -O0 \ + -gdwarf-2 \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -Wall \ + -Wendif-labels \ + -W \ + -Wno-unused-parameter + +# Flags passed to only C files. +CFLAGS_C_Debug := \ + -fno-strict-aliasing + +# Flags passed to only C++ files. +CFLAGS_CC_Debug := \ + -std=gnu++0x \ + -fno-rtti \ + -fno-exceptions \ + -fno-threadsafe-statics \ + -fno-strict-aliasing + +# Flags passed to only ObjC files. +CFLAGS_OBJC_Debug := + +# Flags passed to only ObjC++ files. +CFLAGS_OBJCC_Debug := + +INCS_Debug := \ + -I/Users/david/.node-gyp/4.1.2/include/node \ + -I/Users/david/.node-gyp/4.1.2/src \ + -I/Users/david/.node-gyp/4.1.2/deps/uv/include \ + -I/Users/david/.node-gyp/4.1.2/deps/v8/include \ + -I$(srcdir)/node_modules/nan + +DEFS_Release := \ + '-DNODE_GYP_MODULE_NAME=validation' \ + '-D_DARWIN_USE_64_BIT_INODE=1' \ + '-D_LARGEFILE_SOURCE' \ + '-D_FILE_OFFSET_BITS=64' \ + '-DBUILDING_NODE_EXTENSION' + +# Flags passed to all source files. +CFLAGS_Release := \ + -Os \ + -gdwarf-2 \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -Wall \ + -Wendif-labels \ + -W \ + -Wno-unused-parameter + +# Flags passed to only C files. +CFLAGS_C_Release := \ + -fno-strict-aliasing + +# Flags passed to only C++ files. +CFLAGS_CC_Release := \ + -std=gnu++0x \ + -fno-rtti \ + -fno-exceptions \ + -fno-threadsafe-statics \ + -fno-strict-aliasing + +# Flags passed to only ObjC files. +CFLAGS_OBJC_Release := + +# Flags passed to only ObjC++ files. +CFLAGS_OBJCC_Release := + +INCS_Release := \ + -I/Users/david/.node-gyp/4.1.2/include/node \ + -I/Users/david/.node-gyp/4.1.2/src \ + -I/Users/david/.node-gyp/4.1.2/deps/uv/include \ + -I/Users/david/.node-gyp/4.1.2/deps/v8/include \ + -I$(srcdir)/node_modules/nan + +OBJS := \ + $(obj).target/$(TARGET)/src/validation.o + +# Add to the list of files we specially track dependencies for. +all_deps += $(OBJS) + +# CFLAGS et al overrides must be target-local. +# See "Target-specific Variable Values" in the GNU Make manual. +$(OBJS): TOOLSET := $(TOOLSET) +$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) +$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) +$(OBJS): GYP_OBJCFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) $(CFLAGS_OBJC_$(BUILDTYPE)) +$(OBJS): GYP_OBJCXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) $(CFLAGS_OBJCC_$(BUILDTYPE)) + +# Suffix rules, putting all outputs into $(obj). + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# Try building from generated source, too. + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD + @$(call do_cmd,cxx,1) + +# End of this set of suffix rules +### Rules for final target. +LDFLAGS_Debug := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -L$(builddir) + +LIBTOOLFLAGS_Debug := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first + +LDFLAGS_Release := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first \ + -mmacosx-version-min=10.5 \ + -arch x86_64 \ + -L$(builddir) + +LIBTOOLFLAGS_Release := \ + -undefined dynamic_lookup \ + -Wl,-search_paths_first + +LIBS := + +$(builddir)/validation.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) +$(builddir)/validation.node: LIBS := $(LIBS) +$(builddir)/validation.node: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE)) +$(builddir)/validation.node: TOOLSET := $(TOOLSET) +$(builddir)/validation.node: $(OBJS) FORCE_DO_CMD + $(call do_cmd,solink_module) + +all_deps += $(builddir)/validation.node +# Add target alias +.PHONY: validation +validation: $(builddir)/validation.node + +# Short alias for building this executable. +.PHONY: validation.node +validation.node: $(builddir)/validation.node + +# Add executable to "all" target. +.PHONY: all +all: $(builddir)/validation.node + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/builderror.log b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/builderror.log new file mode 100644 index 00000000..61bed554 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/builderror.log @@ -0,0 +1,114 @@ +In file included from ../src/bufferutil.cc:15: +../node_modules/nan/nan.h:337:54: error: too many arguments to function call, expected at most 2, have 4 + return v8::Signature::New(nan_isolate, receiver, argc, argv); + ~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~ +/Users/david/.node-gyp/4.1.2/include/node/v8.h:4675:3: note: 'New' declared here + static Local New( + ^ +In file included from ../src/bufferutil.cc:15: +../node_modules/nan/nan.h:409:19: error: no type named 'ExternalAsciiStringResource' in 'v8::String'; did you mean 'ExternalStringResource'? + v8::String::ExternalAsciiStringResource *resource) { + ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ + ExternalStringResource +/Users/david/.node-gyp/4.1.2/include/node/v8.h:2210:19: note: 'ExternalStringResource' declared here + class V8_EXPORT ExternalStringResource + ^ +In file included from ../src/bufferutil.cc:15: +../node_modules/nan/nan.h:408:36: error: redefinition of 'NanNew' + NAN_INLINE v8::Local NanNew( + ^ +../node_modules/nan/nan.h:403:36: note: previous definition is here + NAN_INLINE v8::Local NanNew( + ^ +../node_modules/nan/nan.h:427:3: error: redefinition of 'NanNew' + NanNew >( + ^ +../node_modules/nan/nan.h:420:3: note: previous definition is here + NanNew >( + ^ +../node_modules/nan/nan.h:444:36: error: redefinition of 'NanNew' + NAN_INLINE v8::Local NanNew( + ^ +../node_modules/nan/nan.h:438:36: note: previous definition is here + NAN_INLINE v8::Local NanNew( + ^ +../node_modules/nan/nan.h:456:36: error: redefinition of 'NanNew' + NAN_INLINE v8::Local NanNew( + ^ +../node_modules/nan/nan.h:450:36: note: previous definition is here + NAN_INLINE v8::Local NanNew( + ^ +../node_modules/nan/nan.h:767:13: error: no member named 'smalloc' in namespace 'node' + , node::smalloc::FreeCallback callback + ~~~~~~^ +../node_modules/nan/nan.h:777:12: error: no matching function for call to 'New' + return node::Buffer::New(nan_isolate, data, size); + ^~~~~~~~~~~~~~~~~ +/Users/david/.node-gyp/4.1.2/include/node/node_buffer.h:31:40: note: candidate function not viable: no known conversion from 'uint32_t' (aka 'unsigned int') to 'enum encoding' for 3rd argument +NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, + ^ +/Users/david/.node-gyp/4.1.2/include/node/node_buffer.h:43:40: note: candidate function not viable: 2nd argument ('const char *') would lose const qualifier +NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, + ^ +/Users/david/.node-gyp/4.1.2/include/node/node_buffer.h:28:40: note: candidate function not viable: requires 2 arguments, but 3 were provided +NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, size_t length); + ^ +/Users/david/.node-gyp/4.1.2/include/node/node_buffer.h:36:40: note: candidate function not viable: requires 5 arguments, but 3 were provided +NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, + ^ +In file included from ../src/bufferutil.cc:15: +../node_modules/nan/nan.h:781:12: error: no viable conversion from 'v8::MaybeLocal' to 'v8::Local' + return node::Buffer::New(nan_isolate, size); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/Users/david/.node-gyp/4.1.2/include/node/v8.h:210:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'v8::MaybeLocal' to 'const v8::Local &' for 1st argument +class Local { + ^ +/Users/david/.node-gyp/4.1.2/include/node/v8.h:210:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'v8::MaybeLocal' to 'v8::Local &&' for 1st argument +class Local { + ^ +/Users/david/.node-gyp/4.1.2/include/node/v8.h:214:13: note: candidate template ignored: could not match 'Local' against 'MaybeLocal' + V8_INLINE Local(Local that) + ^ +/Users/david/.node-gyp/4.1.2/include/node/v8.h:326:13: note: candidate template ignored: could not match 'S *' against 'v8::MaybeLocal' + V8_INLINE Local(S* that) + ^ +In file included from ../src/bufferutil.cc:15: +../node_modules/nan/nan.h:788:26: error: no member named 'Use' in namespace 'node::Buffer' + return node::Buffer::Use(nan_isolate, data, size); + ~~~~~~~~~~~~~~^ +../node_modules/nan/nan.h:1728:12: error: no member named 'IsExternalAscii' in 'v8::String'; did you mean 'IsExternal'? + if (str->IsExternalAscii()) { + ^~~~~~~~~~~~~~~ + IsExternal +/Users/david/.node-gyp/4.1.2/include/node/v8.h:2174:8: note: 'IsExternal' declared here + bool IsExternal() const; + ^ +In file included from ../src/bufferutil.cc:15: +../node_modules/nan/nan.h:1729:23: error: no type named 'ExternalAsciiStringResource' in 'v8::String'; did you mean 'ExternalStringResource'? + const v8::String::ExternalAsciiStringResource* ext; + ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ + ExternalStringResource +/Users/david/.node-gyp/4.1.2/include/node/v8.h:2210:19: note: 'ExternalStringResource' declared here + class V8_EXPORT ExternalStringResource + ^ +In file included from ../src/bufferutil.cc:15: +../node_modules/nan/nan.h:1730:16: error: no member named 'GetExternalAsciiStringResource' in 'v8::String' + ext = str->GetExternalAsciiStringResource(); + ~~~ ^ +../node_modules/nan/nan.h:1731:11: error: assigning to 'const char *' from incompatible type 'const uint16_t *' (aka 'const unsigned short *') + *data = ext->data(); + ^ ~~~~~~~~~~~ +14 errors generated. +make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1 +gyp ERR! build error +gyp ERR! stack Error: `make` failed with exit code: 2 +gyp ERR! stack at ChildProcess.onExit (/Users/david/.nvm/v4.1.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23) +gyp ERR! stack at emitTwo (events.js:87:13) +gyp ERR! stack at ChildProcess.emit (events.js:172:7) +gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) +gyp ERR! System Darwin 15.0.0 +gyp ERR! command "/Users/david/.nvm/v4.1.2/bin/node" "/Users/david/.nvm/v4.1.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" +gyp ERR! cwd /Users/david/VSCode-Extensions/vscode-instant-markdown/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws +gyp ERR! node -v v4.1.2 +gyp ERR! node-gyp -v v3.0.3 +gyp ERR! not ok diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/index.js new file mode 100644 index 00000000..3423ff23 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/index.js @@ -0,0 +1,26 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +module.exports = require('./lib/WebSocket'); +module.exports.Server = require('./lib/WebSocketServer'); +module.exports.Sender = require('./lib/Sender'); +module.exports.Receiver = require('./lib/Receiver'); + +module.exports.createServer = function (options, connectionListener) { + var server = new module.exports.Server(options); + if (typeof connectionListener === 'function') { + server.on('connection', connectionListener); + } + return server; +}; + +module.exports.connect = module.exports.createConnection = function (address, openListener) { + var client = new module.exports(address); + if (typeof openListener === 'function') { + client.on('open', openListener); + } + return client; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferPool.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferPool.js new file mode 100644 index 00000000..faf8637c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferPool.js @@ -0,0 +1,59 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util'); + +function BufferPool(initialSize, growStrategy, shrinkStrategy) { + if (typeof initialSize === 'function') { + shrinkStrategy = growStrategy; + growStrategy = initialSize; + initialSize = 0; + } + else if (typeof initialSize === 'undefined') { + initialSize = 0; + } + this._growStrategy = (growStrategy || function(db, size) { + return db.used + size; + }).bind(null, this); + this._shrinkStrategy = (shrinkStrategy || function(db) { + return initialSize; + }).bind(null, this); + this._buffer = initialSize ? new Buffer(initialSize) : null; + this._offset = 0; + this._used = 0; + this._changeFactor = 0; + this.__defineGetter__('size', function(){ + return this._buffer == null ? 0 : this._buffer.length; + }); + this.__defineGetter__('used', function(){ + return this._used; + }); +} + +BufferPool.prototype.get = function(length) { + if (this._buffer == null || this._offset + length > this._buffer.length) { + var newBuf = new Buffer(this._growStrategy(length)); + this._buffer = newBuf; + this._offset = 0; + } + this._used += length; + var buf = this._buffer.slice(this._offset, this._offset + length); + this._offset += length; + return buf; +} + +BufferPool.prototype.reset = function(forceNewBuffer) { + var len = this._shrinkStrategy(); + if (len < this.size) this._changeFactor -= 1; + if (forceNewBuffer || this._changeFactor < -2) { + this._changeFactor = 0; + this._buffer = len ? new Buffer(len) : null; + } + this._offset = 0; + this._used = 0; +} + +module.exports = BufferPool; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferUtil.fallback.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferUtil.fallback.js new file mode 100644 index 00000000..508542c9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferUtil.fallback.js @@ -0,0 +1,47 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +module.exports.BufferUtil = { + merge: function(mergedBuffer, buffers) { + var offset = 0; + for (var i = 0, l = buffers.length; i < l; ++i) { + var buf = buffers[i]; + buf.copy(mergedBuffer, offset); + offset += buf.length; + } + }, + mask: function(source, mask, output, offset, length) { + var maskNum = mask.readUInt32LE(0, true); + var i = 0; + for (; i < length - 3; i += 4) { + var num = maskNum ^ source.readUInt32LE(i, true); + if (num < 0) num = 4294967296 + num; + output.writeUInt32LE(num, offset + i, true); + } + switch (length % 4) { + case 3: output[offset + i + 2] = source[i + 2] ^ mask[2]; + case 2: output[offset + i + 1] = source[i + 1] ^ mask[1]; + case 1: output[offset + i] = source[i] ^ mask[0]; + case 0:; + } + }, + unmask: function(data, mask) { + var maskNum = mask.readUInt32LE(0, true); + var length = data.length; + var i = 0; + for (; i < length - 3; i += 4) { + var num = maskNum ^ data.readUInt32LE(i, true); + if (num < 0) num = 4294967296 + num; + data.writeUInt32LE(num, i, true); + } + switch (length % 4) { + case 3: data[i + 2] = data[i + 2] ^ mask[2]; + case 2: data[i + 1] = data[i + 1] ^ mask[1]; + case 1: data[i] = data[i] ^ mask[0]; + case 0:; + } + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferUtil.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferUtil.js new file mode 100644 index 00000000..15d35b98 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/BufferUtil.js @@ -0,0 +1,16 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +try { + module.exports = require('../build/Release/bufferutil'); +} catch (e) { try { + module.exports = require('../build/default/bufferutil'); +} catch (e) { try { + module.exports = require('./BufferUtil.fallback'); +} catch (e) { + console.error('bufferutil.node seems to not have been built. Run npm install.'); + throw e; +}}} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/ErrorCodes.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/ErrorCodes.js new file mode 100644 index 00000000..55ebd529 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/ErrorCodes.js @@ -0,0 +1,24 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +module.exports = { + isValidErrorCode: function(code) { + return (code >= 1000 && code <= 1011 && code != 1004 && code != 1005 && code != 1006) || + (code >= 3000 && code <= 4999); + }, + 1000: 'normal', + 1001: 'going away', + 1002: 'protocol error', + 1003: 'unsupported data', + 1004: 'reserved', + 1005: 'reserved for extensions', + 1006: 'reserved for extensions', + 1007: 'inconsistent or invalid data', + 1008: 'policy violation', + 1009: 'message too big', + 1010: 'extension handshake missing', + 1011: 'an unexpected condition prevented the request from being fulfilled', +}; \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Receiver.hixie.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Receiver.hixie.js new file mode 100644 index 00000000..a8e41c47 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Receiver.hixie.js @@ -0,0 +1,180 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util'); + +/** + * State constants + */ + +var EMPTY = 0 + , BODY = 1; +var BINARYLENGTH = 2 + , BINARYBODY = 3; + +/** + * Hixie Receiver implementation + */ + +function Receiver () { + this.state = EMPTY; + this.buffers = []; + this.messageEnd = -1; + this.spanLength = 0; + this.dead = false; + + this.onerror = function() {}; + this.ontext = function() {}; + this.onbinary = function() {}; + this.onclose = function() {}; + this.onping = function() {}; + this.onpong = function() {}; +} + +module.exports = Receiver; + +/** + * Add new data to the parser. + * + * @api public + */ + +Receiver.prototype.add = function(data) { + var self = this; + function doAdd() { + if (self.state === EMPTY) { + if (data.length == 2 && data[0] == 0xFF && data[1] == 0x00) { + self.reset(); + self.onclose(); + return; + } + if (data[0] === 0x80) { + self.messageEnd = 0; + self.state = BINARYLENGTH; + data = data.slice(1); + } else { + + if (data[0] !== 0x00) { + self.error('payload must start with 0x00 byte', true); + return; + } + data = data.slice(1); + self.state = BODY; + + } + } + if (self.state === BINARYLENGTH) { + var i = 0; + while ((i < data.length) && (data[i] & 0x80)) { + self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); + ++i; + } + if (i < data.length) { + self.messageEnd = 128 * self.messageEnd + (data[i] & 0x7f); + self.state = BINARYBODY; + ++i; + } + if (i > 0) + data = data.slice(i); + } + if (self.state === BINARYBODY) { + var dataleft = self.messageEnd - self.spanLength; + if (data.length >= dataleft) { + // consume the whole buffer to finish the frame + self.buffers.push(data); + self.spanLength += dataleft; + self.messageEnd = dataleft; + return self.parse(); + } + // frame's not done even if we consume it all + self.buffers.push(data); + self.spanLength += data.length; + return; + } + self.buffers.push(data); + if ((self.messageEnd = bufferIndex(data, 0xFF)) != -1) { + self.spanLength += self.messageEnd; + return self.parse(); + } + else self.spanLength += data.length; + } + while(data) data = doAdd(); +}; + +/** + * Releases all resources used by the receiver. + * + * @api public + */ + +Receiver.prototype.cleanup = function() { + this.dead = true; + this.state = EMPTY; + this.buffers = []; +}; + +/** + * Process buffered data. + * + * @api public + */ + +Receiver.prototype.parse = function() { + var output = new Buffer(this.spanLength); + var outputIndex = 0; + for (var bi = 0, bl = this.buffers.length; bi < bl - 1; ++bi) { + var buffer = this.buffers[bi]; + buffer.copy(output, outputIndex); + outputIndex += buffer.length; + } + var lastBuffer = this.buffers[this.buffers.length - 1]; + if (this.messageEnd > 0) lastBuffer.copy(output, outputIndex, 0, this.messageEnd); + if (this.state !== BODY) --this.messageEnd; + var tail = null; + if (this.messageEnd < lastBuffer.length - 1) { + tail = lastBuffer.slice(this.messageEnd + 1); + } + this.reset(); + this.ontext(output.toString('utf8')); + return tail; +}; + +/** + * Handles an error + * + * @api private + */ + +Receiver.prototype.error = function (reason, terminate) { + this.reset(); + this.onerror(reason, terminate); + return this; +}; + +/** + * Reset parser state + * + * @api private + */ + +Receiver.prototype.reset = function (reason) { + if (this.dead) return; + this.state = EMPTY; + this.buffers = []; + this.messageEnd = -1; + this.spanLength = 0; +}; + +/** + * Internal api + */ + +function bufferIndex(buffer, byte) { + for (var i = 0, l = buffer.length; i < l; ++i) { + if (buffer[i] === byte) return i; + } + return -1; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Receiver.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Receiver.js new file mode 100644 index 00000000..004cd32c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Receiver.js @@ -0,0 +1,585 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util') + , Validation = require('./Validation').Validation + , ErrorCodes = require('./ErrorCodes') + , BufferPool = require('./BufferPool') + , bufferUtil = require('./BufferUtil').BufferUtil; + +/** + * HyBi Receiver implementation + */ + +function Receiver () { + // memory pool for fragmented messages + var fragmentedPoolPrevUsed = -1; + this.fragmentedBufferPool = new BufferPool(1024, function(db, length) { + return db.used + length; + }, function(db) { + return fragmentedPoolPrevUsed = fragmentedPoolPrevUsed >= 0 ? + (fragmentedPoolPrevUsed + db.used) / 2 : + db.used; + }); + + // memory pool for unfragmented messages + var unfragmentedPoolPrevUsed = -1; + this.unfragmentedBufferPool = new BufferPool(1024, function(db, length) { + return db.used + length; + }, function(db) { + return unfragmentedPoolPrevUsed = unfragmentedPoolPrevUsed >= 0 ? + (unfragmentedPoolPrevUsed + db.used) / 2 : + db.used; + }); + + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0, + fragmentedOperation: false + }; + this.overflow = []; + this.headerBuffer = new Buffer(10); + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.currentMessage = []; + this.expectHeader(2, this.processPacket); + this.dead = false; + + this.onerror = function() {}; + this.ontext = function() {}; + this.onbinary = function() {}; + this.onclose = function() {}; + this.onping = function() {}; + this.onpong = function() {}; +} + +module.exports = Receiver; + +/** + * Add new data to the parser. + * + * @api public + */ + +Receiver.prototype.add = function(data) { + var dataLength = data.length; + if (dataLength == 0) return; + if (this.expectBuffer == null) { + this.overflow.push(data); + return; + } + var toRead = Math.min(dataLength, this.expectBuffer.length - this.expectOffset); + fastCopy(toRead, data, this.expectBuffer, this.expectOffset); + this.expectOffset += toRead; + if (toRead < dataLength) { + this.overflow.push(data.slice(toRead)); + } + while (this.expectBuffer && this.expectOffset == this.expectBuffer.length) { + var bufferForHandler = this.expectBuffer; + this.expectBuffer = null; + this.expectOffset = 0; + this.expectHandler.call(this, bufferForHandler); + } +}; + +/** + * Releases all resources used by the receiver. + * + * @api public + */ + +Receiver.prototype.cleanup = function() { + this.dead = true; + this.overflow = null; + this.headerBuffer = null; + this.expectBuffer = null; + this.expectHandler = null; + this.unfragmentedBufferPool = null; + this.fragmentedBufferPool = null; + this.state = null; + this.currentMessage = null; + this.onerror = null; + this.ontext = null; + this.onbinary = null; + this.onclose = null; + this.onping = null; + this.onpong = null; +}; + +/** + * Waits for a certain amount of header bytes to be available, then fires a callback. + * + * @api private + */ + +Receiver.prototype.expectHeader = function(length, handler) { + if (length == 0) { + handler(null); + return; + } + this.expectBuffer = this.headerBuffer.slice(this.expectOffset, this.expectOffset + length); + this.expectHandler = handler; + var toRead = length; + while (toRead > 0 && this.overflow.length > 0) { + var fromOverflow = this.overflow.pop(); + if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); + var read = Math.min(fromOverflow.length, toRead); + fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); + this.expectOffset += read; + toRead -= read; + } +}; + +/** + * Waits for a certain amount of data bytes to be available, then fires a callback. + * + * @api private + */ + +Receiver.prototype.expectData = function(length, handler) { + if (length == 0) { + handler(null); + return; + } + this.expectBuffer = this.allocateFromPool(length, this.state.fragmentedOperation); + this.expectHandler = handler; + var toRead = length; + while (toRead > 0 && this.overflow.length > 0) { + var fromOverflow = this.overflow.pop(); + if (toRead < fromOverflow.length) this.overflow.push(fromOverflow.slice(toRead)); + var read = Math.min(fromOverflow.length, toRead); + fastCopy(read, fromOverflow, this.expectBuffer, this.expectOffset); + this.expectOffset += read; + toRead -= read; + } +}; + +/** + * Allocates memory from the buffer pool. + * + * @api private + */ + +Receiver.prototype.allocateFromPool = function(length, isFragmented) { + return (isFragmented ? this.fragmentedBufferPool : this.unfragmentedBufferPool).get(length); +}; + +/** + * Start processing a new packet. + * + * @api private + */ + +Receiver.prototype.processPacket = function (data) { + if ((data[0] & 0x70) != 0) { + this.error('reserved fields must be empty', 1002); + return; + } + this.state.lastFragment = (data[0] & 0x80) == 0x80; + this.state.masked = (data[1] & 0x80) == 0x80; + var opcode = data[0] & 0xf; + if (opcode === 0) { + // continuation frame + this.state.fragmentedOperation = true; + this.state.opcode = this.state.activeFragmentedOperation; + if (!(this.state.opcode == 1 || this.state.opcode == 2)) { + this.error('continuation frame cannot follow current opcode', 1002); + return; + } + } + else { + if (opcode < 3 && this.state.activeFragmentedOperation != null) { + this.error('data frames after the initial data frame must have opcode 0', 1002); + return; + } + this.state.opcode = opcode; + if (this.state.lastFragment === false) { + this.state.fragmentedOperation = true; + this.state.activeFragmentedOperation = opcode; + } + else this.state.fragmentedOperation = false; + } + var handler = opcodes[this.state.opcode]; + if (typeof handler == 'undefined') this.error('no handler for opcode ' + this.state.opcode, 1002); + else { + handler.start.call(this, data); + } +}; + +/** + * Endprocessing a packet. + * + * @api private + */ + +Receiver.prototype.endPacket = function() { + if (!this.state.fragmentedOperation) this.unfragmentedBufferPool.reset(true); + else if (this.state.lastFragment) this.fragmentedBufferPool.reset(false); + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + if (this.state.lastFragment && this.state.opcode === this.state.activeFragmentedOperation) { + // end current fragmented operation + this.state.activeFragmentedOperation = null; + } + this.state.lastFragment = false; + this.state.opcode = this.state.activeFragmentedOperation != null ? this.state.activeFragmentedOperation : 0; + this.state.masked = false; + this.expectHeader(2, this.processPacket); +}; + +/** + * Reset the parser state. + * + * @api private + */ + +Receiver.prototype.reset = function() { + if (this.dead) return; + this.state = { + activeFragmentedOperation: null, + lastFragment: false, + masked: false, + opcode: 0, + fragmentedOperation: false + }; + this.fragmentedBufferPool.reset(true); + this.unfragmentedBufferPool.reset(true); + this.expectOffset = 0; + this.expectBuffer = null; + this.expectHandler = null; + this.overflow = []; + this.currentMessage = []; +}; + +/** + * Unmask received data. + * + * @api private + */ + +Receiver.prototype.unmask = function (mask, buf, binary) { + if (mask != null && buf != null) bufferUtil.unmask(buf, mask); + if (binary) return buf; + return buf != null ? buf.toString('utf8') : ''; +}; + +/** + * Concatenates a list of buffers. + * + * @api private + */ + +Receiver.prototype.concatBuffers = function(buffers) { + var length = 0; + for (var i = 0, l = buffers.length; i < l; ++i) length += buffers[i].length; + var mergedBuffer = new Buffer(length); + bufferUtil.merge(mergedBuffer, buffers); + return mergedBuffer; +}; + +/** + * Handles an error + * + * @api private + */ + +Receiver.prototype.error = function (reason, protocolErrorCode) { + this.reset(); + this.onerror(reason, protocolErrorCode); + return this; +}; + +/** + * Buffer utilities + */ + +function readUInt16BE(start) { + return (this[start]<<8) + + this[start+1]; +} + +function readUInt32BE(start) { + return (this[start]<<24) + + (this[start+1]<<16) + + (this[start+2]<<8) + + this[start+3]; +} + +function fastCopy(length, srcBuffer, dstBuffer, dstOffset) { + switch (length) { + default: srcBuffer.copy(dstBuffer, dstOffset, 0, length); break; + case 16: dstBuffer[dstOffset+15] = srcBuffer[15]; + case 15: dstBuffer[dstOffset+14] = srcBuffer[14]; + case 14: dstBuffer[dstOffset+13] = srcBuffer[13]; + case 13: dstBuffer[dstOffset+12] = srcBuffer[12]; + case 12: dstBuffer[dstOffset+11] = srcBuffer[11]; + case 11: dstBuffer[dstOffset+10] = srcBuffer[10]; + case 10: dstBuffer[dstOffset+9] = srcBuffer[9]; + case 9: dstBuffer[dstOffset+8] = srcBuffer[8]; + case 8: dstBuffer[dstOffset+7] = srcBuffer[7]; + case 7: dstBuffer[dstOffset+6] = srcBuffer[6]; + case 6: dstBuffer[dstOffset+5] = srcBuffer[5]; + case 5: dstBuffer[dstOffset+4] = srcBuffer[4]; + case 4: dstBuffer[dstOffset+3] = srcBuffer[3]; + case 3: dstBuffer[dstOffset+2] = srcBuffer[2]; + case 2: dstBuffer[dstOffset+1] = srcBuffer[1]; + case 1: dstBuffer[dstOffset] = srcBuffer[0]; + } +} + +/** + * Opcode handlers + */ + +var opcodes = { + // text + '1': { + start: function(data) { + var self = this; + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['1'].getData.call(self, firstLength); + } + else if (firstLength == 126) { + self.expectHeader(2, function(data) { + opcodes['1'].getData.call(self, readUInt16BE.call(data, 0)); + }); + } + else if (firstLength == 127) { + self.expectHeader(8, function(data) { + if (readUInt32BE.call(data, 0) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported', 1008); + return; + } + opcodes['1'].getData.call(self, readUInt32BE.call(data, 4)); + }); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['1'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['1'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var packet = this.unmask(mask, data, true); + if (packet != null) this.currentMessage.push(packet); + if (this.state.lastFragment) { + var messageBuffer = this.concatBuffers(this.currentMessage); + if (!Validation.isValidUTF8(messageBuffer)) { + this.error('invalid utf8 sequence', 1007); + return; + } + this.ontext(messageBuffer.toString('utf8'), {masked: this.state.masked, buffer: messageBuffer}); + this.currentMessage = []; + } + this.endPacket(); + } + }, + // binary + '2': { + start: function(data) { + var self = this; + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['2'].getData.call(self, firstLength); + } + else if (firstLength == 126) { + self.expectHeader(2, function(data) { + opcodes['2'].getData.call(self, readUInt16BE.call(data, 0)); + }); + } + else if (firstLength == 127) { + self.expectHeader(8, function(data) { + if (readUInt32BE.call(data, 0) != 0) { + self.error('packets with length spanning more than 32 bit is currently not supported', 1008); + return; + } + opcodes['2'].getData.call(self, readUInt32BE.call(data, 4, true)); + }); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['2'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['2'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var packet = this.unmask(mask, data, true); + if (packet != null) this.currentMessage.push(packet); + if (this.state.lastFragment) { + var messageBuffer = this.concatBuffers(this.currentMessage); + this.onbinary(messageBuffer, {masked: this.state.masked, buffer: messageBuffer}); + this.currentMessage = []; + } + this.endPacket(); + } + }, + // close + '8': { + start: function(data) { + var self = this; + if (self.state.lastFragment == false) { + self.error('fragmented close is not supported', 1002); + return; + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['8'].getData.call(self, firstLength); + } + else { + self.error('control frames cannot have more than 125 bytes of data', 1002); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['8'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['8'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + var self = this; + data = self.unmask(mask, data, true); + if (data && data.length == 1) { + self.error('close packets with data must be at least two bytes long', 1002); + return; + } + var code = data && data.length > 1 ? readUInt16BE.call(data, 0) : 1000; + if (!ErrorCodes.isValidErrorCode(code)) { + self.error('invalid error code', 1002); + return; + } + var message = ''; + if (data && data.length > 2) { + var messageBuffer = data.slice(2); + if (!Validation.isValidUTF8(messageBuffer)) { + self.error('invalid utf8 sequence', 1007); + return; + } + message = messageBuffer.toString('utf8'); + } + this.onclose(code, message, {masked: self.state.masked}); + this.reset(); + }, + }, + // ping + '9': { + start: function(data) { + var self = this; + if (self.state.lastFragment == false) { + self.error('fragmented ping is not supported', 1002); + return; + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['9'].getData.call(self, firstLength); + } + else { + self.error('control frames cannot have more than 125 bytes of data', 1002); + } + }, + getData: function(length) { + var self = this; + if (self.state.masked) { + self.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['9'].finish.call(self, mask, data); + }); + }); + } + else { + self.expectData(length, function(data) { + opcodes['9'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + this.onping(this.unmask(mask, data, true), {masked: this.state.masked, binary: true}); + this.endPacket(); + } + }, + // pong + '10': { + start: function(data) { + var self = this; + if (self.state.lastFragment == false) { + self.error('fragmented pong is not supported', 1002); + return; + } + + // decode length + var firstLength = data[1] & 0x7f; + if (firstLength < 126) { + opcodes['10'].getData.call(self, firstLength); + } + else { + self.error('control frames cannot have more than 125 bytes of data', 1002); + } + }, + getData: function(length) { + var self = this; + if (this.state.masked) { + this.expectHeader(4, function(data) { + var mask = data; + self.expectData(length, function(data) { + opcodes['10'].finish.call(self, mask, data); + }); + }); + } + else { + this.expectData(length, function(data) { + opcodes['10'].finish.call(self, null, data); + }); + } + }, + finish: function(mask, data) { + this.onpong(this.unmask(mask, data, true), {masked: this.state.masked, binary: true}); + this.endPacket(); + } + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Sender.hixie.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Sender.hixie.js new file mode 100644 index 00000000..c715dbdc --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Sender.hixie.js @@ -0,0 +1,118 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var events = require('events') + , util = require('util') + , EventEmitter = events.EventEmitter; + +/** + * Hixie Sender implementation + */ + +function Sender(socket) { + this.socket = socket; + this.continuationFrame = false; + this.isClosed = false; +} + +module.exports = Sender; + +/** + * Inherits from EventEmitter. + */ + +util.inherits(Sender, events.EventEmitter); + +/** + * Frames and writes data. + * + * @api public + */ + +Sender.prototype.send = function(data, options, cb) { + if (this.isClosed) return; + + var isString = typeof data == 'string' + , length = isString ? Buffer.byteLength(data) : data.length + , lengthbytes = (length > 127) ? 2 : 1 // assume less than 2**14 bytes + , writeStartMarker = this.continuationFrame == false + , writeEndMarker = !options || !(typeof options.fin != 'undefined' && !options.fin) + , buffer = new Buffer((writeStartMarker ? ((options && options.binary) ? (1 + lengthbytes) : 1) : 0) + length + ((writeEndMarker && !(options && options.binary)) ? 1 : 0)) + , offset = writeStartMarker ? 1 : 0; + + if (writeStartMarker) { + if (options && options.binary) { + buffer.write('\x80', 'binary'); + // assume length less than 2**14 bytes + if (lengthbytes > 1) + buffer.write(String.fromCharCode(128+length/128), offset++, 'binary'); + buffer.write(String.fromCharCode(length&0x7f), offset++, 'binary'); + } else + buffer.write('\x00', 'binary'); + } + + if (isString) buffer.write(data, offset, 'utf8'); + else data.copy(buffer, offset, 0); + + if (writeEndMarker) { + if (options && options.binary) { + // sending binary, not writing end marker + } else + buffer.write('\xff', offset + length, 'binary'); + this.continuationFrame = false; + } + else this.continuationFrame = true; + + try { + this.socket.write(buffer, 'binary', cb); + } catch (e) { + this.error(e.toString()); + } +}; + +/** + * Sends a close instruction to the remote party. + * + * @api public + */ + +Sender.prototype.close = function(code, data, mask, cb) { + if (this.isClosed) return; + this.isClosed = true; + try { + if (this.continuationFrame) this.socket.write(new Buffer([0xff], 'binary')); + this.socket.write(new Buffer([0xff, 0x00]), 'binary', cb); + } catch (e) { + this.error(e.toString()); + } +}; + +/** + * Sends a ping message to the remote party. Not available for hixie. + * + * @api public + */ + +Sender.prototype.ping = function(data, options) {}; + +/** + * Sends a pong message to the remote party. Not available for hixie. + * + * @api public + */ + +Sender.prototype.pong = function(data, options) {}; + +/** + * Handles an error + * + * @api private + */ + +Sender.prototype.error = function (reason) { + this.emit('error', reason); + return this; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Sender.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Sender.js new file mode 100644 index 00000000..bc6ea730 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Sender.js @@ -0,0 +1,227 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var events = require('events') + , util = require('util') + , EventEmitter = events.EventEmitter + , ErrorCodes = require('./ErrorCodes') + , bufferUtil = require('./BufferUtil').BufferUtil; + +/** + * HyBi Sender implementation + */ + +function Sender(socket) { + this._socket = socket; + this.firstFragment = true; +} + +/** + * Inherits from EventEmitter. + */ + +util.inherits(Sender, events.EventEmitter); + +/** + * Sends a close instruction to the remote party. + * + * @api public + */ + +Sender.prototype.close = function(code, data, mask) { + if (typeof code !== 'undefined') { + if (typeof code !== 'number' || + !ErrorCodes.isValidErrorCode(code)) throw new Error('first argument must be a valid error code number'); + } + code = code || 1000; + var dataBuffer = new Buffer(2 + (data ? Buffer.byteLength(data) : 0)); + writeUInt16BE.call(dataBuffer, code, 0); + if (dataBuffer.length > 2) dataBuffer.write(data, 2); + this.frameAndSend(0x8, dataBuffer, true, mask); +}; + +/** + * Sends a ping message to the remote party. + * + * @api public + */ + +Sender.prototype.ping = function(data, options) { + var mask = options && options.mask; + this.frameAndSend(0x9, data || '', true, mask); +}; + +/** + * Sends a pong message to the remote party. + * + * @api public + */ + +Sender.prototype.pong = function(data, options) { + var mask = options && options.mask; + this.frameAndSend(0xa, data || '', true, mask); +}; + +/** + * Sends text or binary data to the remote party. + * + * @api public + */ + +Sender.prototype.send = function(data, options, cb) { + var finalFragment = options && options.fin === false ? false : true; + var mask = options && options.mask; + var opcode = options && options.binary ? 2 : 1; + if (this.firstFragment === false) opcode = 0; + else this.firstFragment = false; + if (finalFragment) this.firstFragment = true + this.frameAndSend(opcode, data, finalFragment, mask, cb); +}; + +/** + * Frames and sends a piece of data according to the HyBi WebSocket protocol. + * + * @api private + */ + +Sender.prototype.frameAndSend = function(opcode, data, finalFragment, maskData, cb) { + var canModifyData = false; + + if (!data) { + try { + this._socket.write(new Buffer([opcode | (finalFragment ? 0x80 : 0), 0 | (maskData ? 0x80 : 0)].concat(maskData ? [0, 0, 0, 0] : [])), 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + return; + } + + if (!Buffer.isBuffer(data)) { + canModifyData = true; + if (data && (typeof data.byteLength !== 'undefined' || typeof data.buffer !== 'undefined')) { + data = getArrayBuffer(data); + } else { + data = new Buffer(data); + } + } + + var dataLength = data.length + , dataOffset = maskData ? 6 : 2 + , secondByte = dataLength; + + if (dataLength >= 65536) { + dataOffset += 8; + secondByte = 127; + } + else if (dataLength > 125) { + dataOffset += 2; + secondByte = 126; + } + + var mergeBuffers = dataLength < 32768 || (maskData && !canModifyData); + var totalLength = mergeBuffers ? dataLength + dataOffset : dataOffset; + var outputBuffer = new Buffer(totalLength); + outputBuffer[0] = finalFragment ? opcode | 0x80 : opcode; + + switch (secondByte) { + case 126: + writeUInt16BE.call(outputBuffer, dataLength, 2); + break; + case 127: + writeUInt32BE.call(outputBuffer, 0, 2); + writeUInt32BE.call(outputBuffer, dataLength, 6); + } + + if (maskData) { + outputBuffer[1] = secondByte | 0x80; + var mask = this._randomMask || (this._randomMask = getRandomMask()); + outputBuffer[dataOffset - 4] = mask[0]; + outputBuffer[dataOffset - 3] = mask[1]; + outputBuffer[dataOffset - 2] = mask[2]; + outputBuffer[dataOffset - 1] = mask[3]; + if (mergeBuffers) { + bufferUtil.mask(data, mask, outputBuffer, dataOffset, dataLength); + try { + this._socket.write(outputBuffer, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + else { + bufferUtil.mask(data, mask, data, 0, dataLength); + try { + this._socket.write(outputBuffer, 'binary'); + this._socket.write(data, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + } + else { + outputBuffer[1] = secondByte; + if (mergeBuffers) { + data.copy(outputBuffer, dataOffset); + try { + this._socket.write(outputBuffer, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + else { + try { + this._socket.write(outputBuffer, 'binary'); + this._socket.write(data, 'binary', cb); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else this.emit('error', e); + } + } + } +}; + +module.exports = Sender; + +function writeUInt16BE(value, offset) { + this[offset] = (value & 0xff00)>>8; + this[offset+1] = value & 0xff; +} + +function writeUInt32BE(value, offset) { + this[offset] = (value & 0xff000000)>>24; + this[offset+1] = (value & 0xff0000)>>16; + this[offset+2] = (value & 0xff00)>>8; + this[offset+3] = value & 0xff; +} + +function getArrayBuffer(data) { + // data is either an ArrayBuffer or ArrayBufferView. + var array = new Uint8Array(data.buffer || data) + , l = data.byteLength || data.length + , o = data.byteOffset || 0 + , buffer = new Buffer(l); + for (var i = 0; i < l; ++i) { + buffer[i] = array[o+i]; + } + return buffer; +} + +function getRandomMask() { + return new Buffer([ + ~~(Math.random() * 255), + ~~(Math.random() * 255), + ~~(Math.random() * 255), + ~~(Math.random() * 255) + ]); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Validation.fallback.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Validation.fallback.js new file mode 100644 index 00000000..2c7c4fd4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Validation.fallback.js @@ -0,0 +1,12 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +module.exports.Validation = { + isValidUTF8: function(buffer) { + return true; + } +}; + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Validation.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Validation.js new file mode 100644 index 00000000..0f3109a0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/Validation.js @@ -0,0 +1,16 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +try { + module.exports = require('../build/Release/validation'); +} catch (e) { try { + module.exports = require('../build/default/validation'); +} catch (e) { try { + module.exports = require('./Validation.fallback'); +} catch (e) { + console.error('validation.node seems to not have been built. Run npm install.'); + throw e; +}}} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocket.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocket.js new file mode 100644 index 00000000..8c304ebb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocket.js @@ -0,0 +1,794 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util') + , events = require('events') + , http = require('http') + , https = require('https') + , crypto = require('crypto') + , url = require('url') + , stream = require('stream') + , Options = require('options') + , Sender = require('./Sender') + , Receiver = require('./Receiver') + , SenderHixie = require('./Sender.hixie') + , ReceiverHixie = require('./Receiver.hixie'); + +/** + * Constants + */ + +// Default protocol version + +var protocolVersion = 13; + +// Close timeout + +var closeTimeout = 30000; // Allow 5 seconds to terminate the connection cleanly + +/** + * WebSocket implementation + */ + +function WebSocket(address, protocols, options) { + + if (protocols && !Array.isArray(protocols) && 'object' == typeof protocols) { + // accept the "options" Object as the 2nd argument + options = protocols; + protocols = null; + } + if ('string' == typeof protocols) { + protocols = [ protocols ]; + } + if (!Array.isArray(protocols)) { + protocols = []; + } + // TODO: actually handle the `Sub-Protocols` part of the WebSocket client + + this._socket = null; + this.bytesReceived = 0; + this.readyState = null; + this.supports = {}; + + if (Array.isArray(address)) { + initAsServerClient.apply(this, address.concat(options)); + } else { + initAsClient.apply(this, [address, protocols, options]); + } +} + +/** + * Inherits from EventEmitter. + */ + +util.inherits(WebSocket, events.EventEmitter); + +/** + * Ready States + */ + +["CONNECTING", "OPEN", "CLOSING", "CLOSED"].forEach(function (state, index) { + WebSocket.prototype[state] = WebSocket[state] = index; +}); + +/** + * Gracefully closes the connection, after sending a description message to the server + * + * @param {Object} data to be sent to the server + * @api public + */ + +WebSocket.prototype.close = function(code, data) { + if (this.readyState == WebSocket.CLOSING || this.readyState == WebSocket.CLOSED) return; + if (this.readyState == WebSocket.CONNECTING) { + this.readyState = WebSocket.CLOSED; + return; + } + try { + this.readyState = WebSocket.CLOSING; + this._closeCode = code; + this._closeMessage = data; + var mask = !this._isServer; + this._sender.close(code, data, mask); + } + catch (e) { + this.emit('error', e); + } + finally { + this.terminate(); + } +} + +/** + * Pause the client stream + * + * @api public + */ + +WebSocket.prototype.pause = function() { + if (this.readyState != WebSocket.OPEN) throw new Error('not opened'); + return this._socket.pause(); +} + +/** + * Sends a ping + * + * @param {Object} data to be sent to the server + * @param {Object} Members - mask: boolean, binary: boolean + * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open + * @api public + */ + +WebSocket.prototype.ping = function(data, options, dontFailWhenClosed) { + if (this.readyState != WebSocket.OPEN) { + if (dontFailWhenClosed === true) return; + throw new Error('not opened'); + } + options = options || {}; + if (typeof options.mask == 'undefined') options.mask = !this._isServer; + this._sender.ping(data, options); +} + +/** + * Sends a pong + * + * @param {Object} data to be sent to the server + * @param {Object} Members - mask: boolean, binary: boolean + * @param {boolean} dontFailWhenClosed indicates whether or not to throw if the connection isnt open + * @api public + */ + +WebSocket.prototype.pong = function(data, options, dontFailWhenClosed) { + if (this.readyState != WebSocket.OPEN) { + if (dontFailWhenClosed === true) return; + throw new Error('not opened'); + } + options = options || {}; + if (typeof options.mask == 'undefined') options.mask = !this._isServer; + this._sender.pong(data, options); +} + +/** + * Resume the client stream + * + * @api public + */ + +WebSocket.prototype.resume = function() { + if (this.readyState != WebSocket.OPEN) throw new Error('not opened'); + return this._socket.resume(); +} + +/** + * Sends a piece of data + * + * @param {Object} data to be sent to the server + * @param {Object} Members - mask: boolean, binary: boolean + * @param {function} Optional callback which is executed after the send completes + * @api public + */ + +WebSocket.prototype.send = function(data, options, cb) { + if (typeof options == 'function') { + cb = options; + options = {}; + } + if (this.readyState != WebSocket.OPEN) { + if (typeof cb == 'function') cb(new Error('not opened')); + else throw new Error('not opened'); + return; + } + if (!data) data = ''; + if (this._queue) { + var self = this; + this._queue.push(function() { self.send(data, options, cb); }); + return; + } + options = options || {}; + options.fin = true; + if (typeof options.binary == 'undefined') { + options.binary = (data instanceof ArrayBuffer || data instanceof Buffer || + data instanceof Uint8Array || + data instanceof Uint16Array || + data instanceof Uint32Array || + data instanceof Int8Array || + data instanceof Int16Array || + data instanceof Int32Array || + data instanceof Float32Array || + data instanceof Float64Array); + } + if (typeof options.mask == 'undefined') options.mask = !this._isServer; + var readable = typeof stream.Readable == 'function' ? stream.Readable : stream.Stream; + if (data instanceof readable) { + startQueue(this); + var self = this; + sendStream(this, data, options, function(error) { + process.nextTick(function() { executeQueueSends(self); }); + if (typeof cb == 'function') cb(error); + }); + } + else this._sender.send(data, options, cb); +} + +/** + * Streams data through calls to a user supplied function + * + * @param {Object} Members - mask: boolean, binary: boolean + * @param {function} 'function (error, send)' which is executed on successive ticks of which send is 'function (data, final)'. + * @api public + */ + +WebSocket.prototype.stream = function(options, cb) { + if (typeof options == 'function') { + cb = options; + options = {}; + } + var self = this; + if (typeof cb != 'function') throw new Error('callback must be provided'); + if (this.readyState != WebSocket.OPEN) { + if (typeof cb == 'function') cb(new Error('not opened')); + else throw new Error('not opened'); + return; + } + if (this._queue) { + this._queue.push(function() { self.stream(options, cb); }); + return; + } + options = options || {}; + if (typeof options.mask == 'undefined') options.mask = !this._isServer; + startQueue(this); + var send = function(data, final) { + try { + if (self.readyState != WebSocket.OPEN) throw new Error('not opened'); + options.fin = final === true; + self._sender.send(data, options); + if (!final) process.nextTick(cb.bind(null, null, send)); + else executeQueueSends(self); + } + catch (e) { + if (typeof cb == 'function') cb(e); + else { + delete self._queue; + self.emit('error', e); + } + } + } + process.nextTick(cb.bind(null, null, send)); +} + +/** + * Immediately shuts down the connection + * + * @api public + */ + +WebSocket.prototype.terminate = function() { + if (this.readyState == WebSocket.CLOSED) return; + if (this._socket) { + try { + // End the connection + this._socket.end(); + } + catch (e) { + // Socket error during end() call, so just destroy it right now + cleanupWebsocketResources.call(this, true); + return; + } + + // Add a timeout to ensure that the connection is completely + // cleaned up within 30 seconds, even if the clean close procedure + // fails for whatever reason + this._closeTimer = setTimeout(cleanupWebsocketResources.bind(this, true), closeTimeout); + } + else if (this.readyState == WebSocket.CONNECTING) { + cleanupWebsocketResources.call(this, true); + } +}; + +/** + * Expose bufferedAmount + * + * @api public + */ + +Object.defineProperty(WebSocket.prototype, 'bufferedAmount', { + get: function get() { + var amount = 0; + if (this._socket) { + amount = this._socket.bufferSize || 0; + } + return amount; + } +}); + +/** + * Emulates the W3C Browser based WebSocket interface using function members. + * + * @see http://dev.w3.org/html5/websockets/#the-websocket-interface + * @api public + */ + +['open', 'error', 'close', 'message'].forEach(function(method) { + Object.defineProperty(WebSocket.prototype, 'on' + method, { + /** + * Returns the current listener + * + * @returns {Mixed} the set function or undefined + * @api public + */ + + get: function get() { + var listener = this.listeners(method)[0]; + return listener ? (listener._listener ? listener._listener : listener) : undefined; + }, + + /** + * Start listening for events + * + * @param {Function} listener the listener + * @returns {Mixed} the set function or undefined + * @api public + */ + + set: function set(listener) { + this.removeAllListeners(method); + this.addEventListener(method, listener); + } + }); +}); + +/** + * Emulates the W3C Browser based WebSocket interface using addEventListener. + * + * @see https://developer.mozilla.org/en/DOM/element.addEventListener + * @see http://dev.w3.org/html5/websockets/#the-websocket-interface + * @api public + */ +WebSocket.prototype.addEventListener = function(method, listener) { + var target = this; + if (typeof listener === 'function') { + if (method === 'message') { + function onMessage (data, flags) { + listener.call(this, new MessageEvent(data, flags.binary ? 'Binary' : 'Text', target)); + } + // store a reference so we can return the original function from the addEventListener hook + onMessage._listener = listener; + this.on(method, onMessage); + } else if (method === 'close') { + function onClose (code, message) { + listener.call(this, new CloseEvent(code, message, target)); + } + // store a reference so we can return the original function from the addEventListener hook + onClose._listener = listener; + this.on(method, onClose); + } else if (method === 'error') { + function onError (event) { + event.target = target; + listener.call(this, event); + } + // store a reference so we can return the original function from the addEventListener hook + onError._listener = listener; + this.on(method, onError); + } else if (method === 'open') { + function onOpen () { + listener.call(this, new OpenEvent(target)); + } + // store a reference so we can return the original function from the addEventListener hook + onOpen._listener = listener; + this.on(method, onOpen); + } else { + this.on(method, listener); + } + } +} + +module.exports = WebSocket; + +/** + * W3C MessageEvent + * + * @see http://www.w3.org/TR/html5/comms.html + * @api private + */ + +function MessageEvent(dataArg, typeArg, target) { + this.data = dataArg; + this.type = typeArg; + this.target = target; +} + +/** + * W3C CloseEvent + * + * @see http://www.w3.org/TR/html5/comms.html + * @api private + */ + +function CloseEvent(code, reason, target) { + this.wasClean = (typeof code == 'undefined' || code == 1000); + this.code = code; + this.reason = reason; + this.target = target; +} + +/** + * W3C OpenEvent + * + * @see http://www.w3.org/TR/html5/comms.html + * @api private + */ + +function OpenEvent(target) { + this.target = target; +} + +/** + * Entirely private apis, + * which may or may not be bound to a sepcific WebSocket instance. + */ + +function initAsServerClient(req, socket, upgradeHead, options) { + options = new Options({ + protocolVersion: protocolVersion, + protocol: null + }).merge(options); + + // expose state properties + this.protocol = options.value.protocol; + this.protocolVersion = options.value.protocolVersion; + this.supports.binary = (this.protocolVersion != 'hixie-76'); + this.upgradeReq = req; + this.readyState = WebSocket.CONNECTING; + this._isServer = true; + + // establish connection + if (options.value.protocolVersion == 'hixie-76') establishConnection.call(this, ReceiverHixie, SenderHixie, socket, upgradeHead); + else establishConnection.call(this, Receiver, Sender, socket, upgradeHead); +} + +function initAsClient(address, protocols, options) { + options = new Options({ + origin: null, + protocolVersion: protocolVersion, + host: null, + headers: null, + protocol: null, + agent: null, + + // ssl-related options + pfx: null, + key: null, + passphrase: null, + cert: null, + ca: null, + ciphers: null, + rejectUnauthorized: null + }).merge(options); + if (options.value.protocolVersion != 8 && options.value.protocolVersion != 13) { + throw new Error('unsupported protocol version'); + } + + // verify url and establish http class + var serverUrl = url.parse(address); + var isUnixSocket = serverUrl.protocol === 'ws+unix:'; + if (!serverUrl.host && !isUnixSocket) throw new Error('invalid url'); + var isSecure = serverUrl.protocol === 'wss:' || serverUrl.protocol === 'https:'; + var httpObj = isSecure ? https : http; + var port = serverUrl.port || (isSecure ? 443 : 80); + var auth = serverUrl.auth; + + // expose state properties + this._isServer = false; + this.url = address; + this.protocolVersion = options.value.protocolVersion; + this.supports.binary = (this.protocolVersion != 'hixie-76'); + + // begin handshake + var key = new Buffer(options.value.protocolVersion + '-' + Date.now()).toString('base64'); + var shasum = crypto.createHash('sha1'); + shasum.update(key + '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'); + var expectedServerKey = shasum.digest('base64'); + + var agent = options.value.agent; + + var headerHost = serverUrl.hostname; + // Append port number to Host and Origin header, only if specified in the url and non-default + if(serverUrl.port) { + if((isSecure && (port != 443)) || (!isSecure && (port != 80))){ + headerHost = headerHost + ':' + port; + } + } + + var requestOptions = { + port: port, + host: serverUrl.hostname, + headers: { + 'Connection': 'Upgrade', + 'Upgrade': 'websocket', + 'Host': headerHost, + 'Origin': headerHost, + 'Sec-WebSocket-Version': options.value.protocolVersion, + 'Sec-WebSocket-Key': key + } + }; + + // If we have basic auth. + if (auth) { + requestOptions.headers['Authorization'] = 'Basic ' + new Buffer(auth).toString('base64'); + } + + if (options.value.protocol) { + requestOptions.headers['Sec-WebSocket-Protocol'] = options.value.protocol; + } + + if (options.value.host) { + requestOptions.headers['Host'] = options.value.host; + } + + if (options.value.headers) { + for (var header in options.value.headers) { + if (options.value.headers.hasOwnProperty(header)) { + requestOptions.headers[header] = options.value.headers[header]; + } + } + } + + if (options.isDefinedAndNonNull('pfx') + || options.isDefinedAndNonNull('key') + || options.isDefinedAndNonNull('passphrase') + || options.isDefinedAndNonNull('cert') + || options.isDefinedAndNonNull('ca') + || options.isDefinedAndNonNull('ciphers') + || options.isDefinedAndNonNull('rejectUnauthorized')) { + + if (options.isDefinedAndNonNull('pfx')) requestOptions.pfx = options.value.pfx; + if (options.isDefinedAndNonNull('key')) requestOptions.key = options.value.key; + if (options.isDefinedAndNonNull('passphrase')) requestOptions.passphrase = options.value.passphrase; + if (options.isDefinedAndNonNull('cert')) requestOptions.cert = options.value.cert; + if (options.isDefinedAndNonNull('ca')) requestOptions.ca = options.value.ca; + if (options.isDefinedAndNonNull('ciphers')) requestOptions.ciphers = options.value.ciphers; + if (options.isDefinedAndNonNull('rejectUnauthorized')) requestOptions.rejectUnauthorized = options.value.rejectUnauthorized; + + if (!agent) { + // global agent ignores client side certificates + agent = new httpObj.Agent(requestOptions); + } + } + + requestOptions.path = serverUrl.path || '/'; + + if (agent) { + requestOptions.agent = agent; + } + + if (isUnixSocket) { + requestOptions.socketPath = serverUrl.pathname; + } + if (options.value.origin) { + if (options.value.protocolVersion < 13) requestOptions.headers['Sec-WebSocket-Origin'] = options.value.origin; + else requestOptions.headers['Origin'] = options.value.origin; + } + + var self = this; + var req = httpObj.request(requestOptions); + + req.on('error', function(error) { + self.emit('error', error); + cleanupWebsocketResources.call(this, error); + }); + + req.once('response', function(res) { + if (!self.emit('unexpected-response', req, res)) { + var error = new Error('unexpected server response (' + res.statusCode + ')'); + req.abort(); + self.emit('error', error); + } + cleanupWebsocketResources.call(this, error); + }); + + req.once('upgrade', function(res, socket, upgradeHead) { + if (self.readyState == WebSocket.CLOSED) { + // client closed before server accepted connection + self.emit('close'); + self.removeAllListeners(); + socket.end(); + return; + } + var serverKey = res.headers['sec-websocket-accept']; + if (typeof serverKey == 'undefined' || serverKey !== expectedServerKey) { + self.emit('error', 'invalid server key'); + self.removeAllListeners(); + socket.end(); + return; + } + + var serverProt = res.headers['sec-websocket-protocol']; + var protList = (options.value.protocol || "").split(/, */); + var protError = null; + if (!options.value.protocol && serverProt) { + protError = 'server sent a subprotocol even though none requested'; + } else if (options.value.protocol && !serverProt) { + protError = 'server sent no subprotocol even though requested'; + } else if (serverProt && protList.indexOf(serverProt) === -1) { + protError = 'server responded with an invalid protocol'; + } + if (protError) { + self.emit('error', protError); + self.removeAllListeners(); + socket.end(); + return; + } else if (serverProt) { + self.protocol = serverProt; + } + + establishConnection.call(self, Receiver, Sender, socket, upgradeHead); + + // perform cleanup on http resources + req.removeAllListeners(); + req = null; + agent = null; + }); + + req.end(); + this.readyState = WebSocket.CONNECTING; +} + +function establishConnection(ReceiverClass, SenderClass, socket, upgradeHead) { + this._socket = socket; + socket.setTimeout(0); + socket.setNoDelay(true); + var self = this; + this._receiver = new ReceiverClass(); + + // socket cleanup handlers + socket.on('end', cleanupWebsocketResources.bind(this)); + socket.on('close', cleanupWebsocketResources.bind(this)); + socket.on('error', cleanupWebsocketResources.bind(this)); + + // ensure that the upgradeHead is added to the receiver + function firstHandler(data) { + if (self.readyState != WebSocket.OPEN) return; + if (upgradeHead && upgradeHead.length > 0) { + self.bytesReceived += upgradeHead.length; + var head = upgradeHead; + upgradeHead = null; + self._receiver.add(head); + } + dataHandler = realHandler; + if (data) { + self.bytesReceived += data.length; + self._receiver.add(data); + } + } + // subsequent packets are pushed straight to the receiver + function realHandler(data) { + if (data) self.bytesReceived += data.length; + self._receiver.add(data); + } + var dataHandler = firstHandler; + // if data was passed along with the http upgrade, + // this will schedule a push of that on to the receiver. + // this has to be done on next tick, since the caller + // hasn't had a chance to set event handlers on this client + // object yet. + process.nextTick(firstHandler); + + // receiver event handlers + self._receiver.ontext = function (data, flags) { + flags = flags || {}; + self.emit('message', data, flags); + }; + self._receiver.onbinary = function (data, flags) { + flags = flags || {}; + flags.binary = true; + self.emit('message', data, flags); + }; + self._receiver.onping = function(data, flags) { + flags = flags || {}; + self.pong(data, {mask: !self._isServer, binary: flags.binary === true}, true); + self.emit('ping', data, flags); + }; + self._receiver.onpong = function(data, flags) { + self.emit('pong', data, flags); + }; + self._receiver.onclose = function(code, data, flags) { + flags = flags || {}; + self.close(code, data); + }; + self._receiver.onerror = function(reason, errorCode) { + // close the connection when the receiver reports a HyBi error code + self.close(typeof errorCode != 'undefined' ? errorCode : 1002, ''); + self.emit('error', reason, errorCode); + }; + + // finalize the client + this._sender = new SenderClass(socket); + this._sender.on('error', function(error) { + self.close(1002, ''); + self.emit('error', error); + }); + this.readyState = WebSocket.OPEN; + this.emit('open'); + + socket.on('data', dataHandler); +} + +function startQueue(instance) { + instance._queue = instance._queue || []; +} + +function executeQueueSends(instance) { + var queue = instance._queue; + if (typeof queue == 'undefined') return; + delete instance._queue; + for (var i = 0, l = queue.length; i < l; ++i) { + queue[i](); + } +} + +function sendStream(instance, stream, options, cb) { + stream.on('data', function(data) { + if (instance.readyState != WebSocket.OPEN) { + if (typeof cb == 'function') cb(new Error('not opened')); + else { + delete instance._queue; + instance.emit('error', new Error('not opened')); + } + return; + } + options.fin = false; + instance._sender.send(data, options); + }); + stream.on('end', function() { + if (instance.readyState != WebSocket.OPEN) { + if (typeof cb == 'function') cb(new Error('not opened')); + else { + delete instance._queue; + instance.emit('error', new Error('not opened')); + } + return; + } + options.fin = true; + instance._sender.send(null, options); + if (typeof cb == 'function') cb(null); + }); +} + +function cleanupWebsocketResources(error) { + if (this.readyState == WebSocket.CLOSED) return; + var emitClose = this.readyState != WebSocket.CONNECTING; + this.readyState = WebSocket.CLOSED; + + clearTimeout(this._closeTimer); + this._closeTimer = null; + if (emitClose) this.emit('close', this._closeCode || 1000, this._closeMessage || ''); + + if (this._socket) { + this._socket.removeAllListeners(); + // catch all socket error after removing all standard handlers + var socket = this._socket; + this._socket.on('error', function() { + try { socket.destroy(); } catch (e) {} + }); + try { + if (!error) this._socket.end(); + else this._socket.destroy(); + } + catch (e) { /* Ignore termination errors */ } + this._socket = null; + } + if (this._sender) { + this._sender.removeAllListeners(); + this._sender = null; + } + if (this._receiver) { + this._receiver.cleanup(); + this._receiver = null; + } + this.removeAllListeners(); + this.on('error', function() {}); // catch all errors after this + delete this._queue; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocketServer.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocketServer.js new file mode 100644 index 00000000..5cbd195b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/WebSocketServer.js @@ -0,0 +1,465 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var util = require('util') + , events = require('events') + , http = require('http') + , crypto = require('crypto') + , Options = require('options') + , WebSocket = require('./WebSocket') + , tls = require('tls') + , url = require('url'); + +/** + * WebSocket Server implementation + */ + +function WebSocketServer(options, callback) { + options = new Options({ + host: '0.0.0.0', + port: null, + server: null, + verifyClient: null, + handleProtocols: null, + path: null, + noServer: false, + disableHixie: false, + clientTracking: true + }).merge(options); + + if (!options.isDefinedAndNonNull('port') && !options.isDefinedAndNonNull('server') && !options.value.noServer) { + throw new TypeError('`port` or a `server` must be provided'); + } + + var self = this; + + if (options.isDefinedAndNonNull('port')) { + this._server = http.createServer(function (req, res) { + res.writeHead(200, {'Content-Type': 'text/plain'}); + res.end('Not implemented'); + }); + this._server.listen(options.value.port, options.value.host, callback); + this._closeServer = function() { if (self._server) self._server.close(); }; + } + else if (options.value.server) { + this._server = options.value.server; + if (options.value.path) { + // take note of the path, to avoid collisions when multiple websocket servers are + // listening on the same http server + if (this._server._webSocketPaths && options.value.server._webSocketPaths[options.value.path]) { + throw new Error('two instances of WebSocketServer cannot listen on the same http server path'); + } + if (typeof this._server._webSocketPaths !== 'object') { + this._server._webSocketPaths = {}; + } + this._server._webSocketPaths[options.value.path] = 1; + } + } + if (this._server) this._server.once('listening', function() { self.emit('listening'); }); + + if (typeof this._server != 'undefined') { + this._server.on('error', function(error) { + self.emit('error', error) + }); + this._server.on('upgrade', function(req, socket, upgradeHead) { + //copy upgradeHead to avoid retention of large slab buffers used in node core + var head = new Buffer(upgradeHead.length); + upgradeHead.copy(head); + + self.handleUpgrade(req, socket, head, function(client) { + self.emit('connection'+req.url, client); + self.emit('connection', client); + }); + }); + } + + this.options = options.value; + this.path = options.value.path; + this.clients = []; +} + +/** + * Inherits from EventEmitter. + */ + +util.inherits(WebSocketServer, events.EventEmitter); + +/** + * Immediately shuts down the connection. + * + * @api public + */ + +WebSocketServer.prototype.close = function() { + // terminate all associated clients + var error = null; + try { + for (var i = 0, l = this.clients.length; i < l; ++i) { + this.clients[i].terminate(); + } + } + catch (e) { + error = e; + } + + // remove path descriptor, if any + if (this.path && this._server._webSocketPaths) { + delete this._server._webSocketPaths[this.path]; + if (Object.keys(this._server._webSocketPaths).length == 0) { + delete this._server._webSocketPaths; + } + } + + // close the http server if it was internally created + try { + if (typeof this._closeServer !== 'undefined') { + this._closeServer(); + } + } + finally { + delete this._server; + } + if (error) throw error; +} + +/** + * Handle a HTTP Upgrade request. + * + * @api public + */ + +WebSocketServer.prototype.handleUpgrade = function(req, socket, upgradeHead, cb) { + // check for wrong path + if (this.options.path) { + var u = url.parse(req.url); + if (u && u.pathname !== this.options.path) return; + } + + if (typeof req.headers.upgrade === 'undefined' || req.headers.upgrade.toLowerCase() !== 'websocket') { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + if (req.headers['sec-websocket-key1']) handleHixieUpgrade.apply(this, arguments); + else handleHybiUpgrade.apply(this, arguments); +} + +module.exports = WebSocketServer; + +/** + * Entirely private apis, + * which may or may not be bound to a sepcific WebSocket instance. + */ + +function handleHybiUpgrade(req, socket, upgradeHead, cb) { + // handle premature socket errors + var errorHandler = function() { + try { socket.destroy(); } catch (e) {} + } + socket.on('error', errorHandler); + + // verify key presence + if (!req.headers['sec-websocket-key']) { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + // verify version + var version = parseInt(req.headers['sec-websocket-version']); + if ([8, 13].indexOf(version) === -1) { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + // verify protocol + var protocols = req.headers['sec-websocket-protocol']; + + // verify client + var origin = version < 13 ? + req.headers['sec-websocket-origin'] : + req.headers['origin']; + + // handler to call when the connection sequence completes + var self = this; + var completeHybiUpgrade2 = function(protocol) { + + // calc key + var key = req.headers['sec-websocket-key']; + var shasum = crypto.createHash('sha1'); + shasum.update(key + "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"); + key = shasum.digest('base64'); + + var headers = [ + 'HTTP/1.1 101 Switching Protocols' + , 'Upgrade: websocket' + , 'Connection: Upgrade' + , 'Sec-WebSocket-Accept: ' + key + ]; + + if (typeof protocol != 'undefined') { + headers.push('Sec-WebSocket-Protocol: ' + protocol); + } + + // allows external modification/inspection of handshake headers + self.emit('headers', headers); + + socket.setTimeout(0); + socket.setNoDelay(true); + try { + socket.write(headers.concat('', '').join('\r\n')); + } + catch (e) { + // if the upgrade write fails, shut the connection down hard + try { socket.destroy(); } catch (e) {} + return; + } + + var client = new WebSocket([req, socket, upgradeHead], { + protocolVersion: version, + protocol: protocol + }); + + if (self.options.clientTracking) { + self.clients.push(client); + client.on('close', function() { + var index = self.clients.indexOf(client); + if (index != -1) { + self.clients.splice(index, 1); + } + }); + } + + // signal upgrade complete + socket.removeListener('error', errorHandler); + cb(client); + } + + // optionally call external protocol selection handler before + // calling completeHybiUpgrade2 + var completeHybiUpgrade1 = function() { + // choose from the sub-protocols + if (typeof self.options.handleProtocols == 'function') { + var protList = (protocols || "").split(/, */); + var callbackCalled = false; + var res = self.options.handleProtocols(protList, function(result, protocol) { + callbackCalled = true; + if (!result) abortConnection(socket, 404, 'Unauthorized') + else completeHybiUpgrade2(protocol); + }); + if (!callbackCalled) { + // the handleProtocols handler never called our callback + abortConnection(socket, 501, 'Could not process protocols'); + } + return; + } else { + if (typeof protocols !== 'undefined') { + completeHybiUpgrade2(protocols.split(/, */)[0]); + } + else { + completeHybiUpgrade2(); + } + } + } + + // optionally call external client verification handler + if (typeof this.options.verifyClient == 'function') { + var info = { + origin: origin, + secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', + req: req + }; + if (this.options.verifyClient.length == 2) { + this.options.verifyClient(info, function(result, code, name) { + if (typeof code === 'undefined') code = 401; + if (typeof name === 'undefined') name = http.STATUS_CODES[code]; + + if (!result) abortConnection(socket, code, name); + else completeHybiUpgrade1(); + }); + return; + } + else if (!this.options.verifyClient(info)) { + abortConnection(socket, 401, 'Unauthorized'); + return; + } + } + + completeHybiUpgrade1(); +} + +function handleHixieUpgrade(req, socket, upgradeHead, cb) { + // handle premature socket errors + var errorHandler = function() { + try { socket.destroy(); } catch (e) {} + } + socket.on('error', errorHandler); + + // bail if options prevent hixie + if (this.options.disableHixie) { + abortConnection(socket, 401, 'Hixie support disabled'); + return; + } + + // verify key presence + if (!req.headers['sec-websocket-key2']) { + abortConnection(socket, 400, 'Bad Request'); + return; + } + + var origin = req.headers['origin'] + , self = this; + + // setup handshake completion to run after client has been verified + var onClientVerified = function() { + var wshost; + if (!req.headers['x-forwarded-host']) + wshost = req.headers.host; + else + wshost = req.headers['x-forwarded-host']; + var location = ((req.headers['x-forwarded-proto'] === 'https' || socket.encrypted) ? 'wss' : 'ws') + '://' + wshost + req.url + , protocol = req.headers['sec-websocket-protocol']; + + // handshake completion code to run once nonce has been successfully retrieved + var completeHandshake = function(nonce, rest) { + // calculate key + var k1 = req.headers['sec-websocket-key1'] + , k2 = req.headers['sec-websocket-key2'] + , md5 = crypto.createHash('md5'); + + [k1, k2].forEach(function (k) { + var n = parseInt(k.replace(/[^\d]/g, '')) + , spaces = k.replace(/[^ ]/g, '').length; + if (spaces === 0 || n % spaces !== 0){ + abortConnection(socket, 400, 'Bad Request'); + return; + } + n /= spaces; + md5.update(String.fromCharCode( + n >> 24 & 0xFF, + n >> 16 & 0xFF, + n >> 8 & 0xFF, + n & 0xFF)); + }); + md5.update(nonce.toString('binary')); + + var headers = [ + 'HTTP/1.1 101 Switching Protocols' + , 'Upgrade: WebSocket' + , 'Connection: Upgrade' + , 'Sec-WebSocket-Location: ' + location + ]; + if (typeof protocol != 'undefined') headers.push('Sec-WebSocket-Protocol: ' + protocol); + if (typeof origin != 'undefined') headers.push('Sec-WebSocket-Origin: ' + origin); + + socket.setTimeout(0); + socket.setNoDelay(true); + try { + // merge header and hash buffer + var headerBuffer = new Buffer(headers.concat('', '').join('\r\n')); + var hashBuffer = new Buffer(md5.digest('binary'), 'binary'); + var handshakeBuffer = new Buffer(headerBuffer.length + hashBuffer.length); + headerBuffer.copy(handshakeBuffer, 0); + hashBuffer.copy(handshakeBuffer, headerBuffer.length); + + // do a single write, which - upon success - causes a new client websocket to be setup + socket.write(handshakeBuffer, 'binary', function(err) { + if (err) return; // do not create client if an error happens + var client = new WebSocket([req, socket, rest], { + protocolVersion: 'hixie-76', + protocol: protocol + }); + if (self.options.clientTracking) { + self.clients.push(client); + client.on('close', function() { + var index = self.clients.indexOf(client); + if (index != -1) { + self.clients.splice(index, 1); + } + }); + } + + // signal upgrade complete + socket.removeListener('error', errorHandler); + cb(client); + }); + } + catch (e) { + try { socket.destroy(); } catch (e) {} + return; + } + } + + // retrieve nonce + var nonceLength = 8; + if (upgradeHead && upgradeHead.length >= nonceLength) { + var nonce = upgradeHead.slice(0, nonceLength); + var rest = upgradeHead.length > nonceLength ? upgradeHead.slice(nonceLength) : null; + completeHandshake.call(self, nonce, rest); + } + else { + // nonce not present in upgradeHead, so we must wait for enough data + // data to arrive before continuing + var nonce = new Buffer(nonceLength); + upgradeHead.copy(nonce, 0); + var received = upgradeHead.length; + var rest = null; + var handler = function (data) { + var toRead = Math.min(data.length, nonceLength - received); + if (toRead === 0) return; + data.copy(nonce, received, 0, toRead); + received += toRead; + if (received == nonceLength) { + socket.removeListener('data', handler); + if (toRead < data.length) rest = data.slice(toRead); + completeHandshake.call(self, nonce, rest); + } + } + socket.on('data', handler); + } + } + + // verify client + if (typeof this.options.verifyClient == 'function') { + var info = { + origin: origin, + secure: typeof req.connection.authorized !== 'undefined' || typeof req.connection.encrypted !== 'undefined', + req: req + }; + if (this.options.verifyClient.length == 2) { + var self = this; + this.options.verifyClient(info, function(result, code, name) { + if (typeof code === 'undefined') code = 401; + if (typeof name === 'undefined') name = http.STATUS_CODES[code]; + + if (!result) abortConnection(socket, code, name); + else onClientVerified.apply(self); + }); + return; + } + else if (!this.options.verifyClient(info)) { + abortConnection(socket, 401, 'Unauthorized'); + return; + } + } + + // no client verification required + onClientVerified(); +} + +function abortConnection(socket, code, name) { + try { + var response = [ + 'HTTP/1.1 ' + code + ' ' + name, + 'Content-type: text/html' + ]; + socket.write(response.concat('', '').join('\r\n')); + } + catch (e) { /* ignore errors - we've aborted this connection */ } + finally { + // ensure that an early aborted connection is shut down completely + try { socket.destroy(); } catch (e) {} + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/browser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/browser.js new file mode 100644 index 00000000..8d3a755c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/lib/browser.js @@ -0,0 +1,43 @@ + +/** + * Module dependencies. + */ + +var global = (function() { return this; })(); + +/** + * WebSocket constructor. + */ + +var WebSocket = global.WebSocket || global.MozWebSocket; + +/** + * Module exports. + */ + +module.exports = WebSocket ? ws : null; + +/** + * WebSocket constructor. + * + * The third `opts` options object gets ignored in web browsers, since it's + * non-standard, and throws a TypeError if passed to the constructor. + * See: https://github.com/einaros/ws/issues/227 + * + * @param {String} uri + * @param {Array} protocols (optional) + * @param {Object) opts (optional) + * @api public + */ + +function ws(uri, protocols, opts) { + var instance; + if (protocols) { + instance = new WebSocket(uri, protocols); + } else { + instance = new WebSocket(uri); + } + return instance; +} + +if (WebSocket) ws.prototype = WebSocket.prototype; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/Readme.md new file mode 100644 index 00000000..d1644012 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/Readme.md @@ -0,0 +1,195 @@ +# Commander.js + + The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander). + + [![Build Status](https://secure.travis-ci.org/visionmedia/commander.js.png)](http://travis-ci.org/visionmedia/commander.js) + +## Installation + + $ npm install commander + +## Option parsing + + Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('commander'); + +program + .version('0.0.1') + .option('-p, --peppers', 'Add peppers') + .option('-P, --pineapple', 'Add pineapple') + .option('-b, --bbq', 'Add bbq sauce') + .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble') + .parse(process.argv); + +console.log('you ordered a pizza with:'); +if (program.peppers) console.log(' - peppers'); +if (program.pineapple) console.log(' - pineapple'); +if (program.bbq) console.log(' - bbq'); +console.log(' - %s cheese', program.cheese); +``` + + Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. + +## Automated --help + + The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: + +``` + $ ./examples/pizza --help + + Usage: pizza [options] + + Options: + + -V, --version output the version number + -p, --peppers Add peppers + -P, --pineapple Add pineapple + -b, --bbq Add bbq sauce + -c, --cheese Add the specified type of cheese [marble] + -h, --help output usage information + +``` + +## Coercion + +```js +function range(val) { + return val.split('..').map(Number); +} + +function list(val) { + return val.split(','); +} + +program + .version('0.0.1') + .usage('[options] ') + .option('-i, --integer ', 'An integer argument', parseInt) + .option('-f, --float ', 'A float argument', parseFloat) + .option('-r, --range ..', 'A range', range) + .option('-l, --list ', 'A list', list) + .option('-o, --optional [value]', 'An optional value') + .parse(process.argv); + +console.log(' int: %j', program.integer); +console.log(' float: %j', program.float); +console.log(' optional: %j', program.optional); +program.range = program.range || []; +console.log(' range: %j..%j', program.range[0], program.range[1]); +console.log(' list: %j', program.list); +console.log(' args: %j', program.args); +``` + +## Custom help + + You can display arbitrary `-h, --help` information + by listening for "--help". Commander will automatically + exit once you are done so that the remainder of your program + does not execute causing undesired behaviours, for example + in the following executable "stuff" will not output when + `--help` is used. + +```js +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +var program = require('../'); + +function list(val) { + return val.split(',').map(Number); +} + +program + .version('0.0.1') + .option('-f, --foo', 'enable some foo') + .option('-b, --bar', 'enable some bar') + .option('-B, --baz', 'enable some baz'); + +// must be before .parse() since +// node's emit() is immediate + +program.on('--help', function(){ + console.log(' Examples:'); + console.log(''); + console.log(' $ custom-help --help'); + console.log(' $ custom-help -h'); + console.log(''); +}); + +program.parse(process.argv); + +console.log('stuff'); +``` + +yielding the following help output: + +``` + +Usage: custom-help [options] + +Options: + + -h, --help output usage information + -V, --version output the version number + -f, --foo enable some foo + -b, --bar enable some bar + -B, --baz enable some baz + +Examples: + + $ custom-help --help + $ custom-help -h + +``` + +## .outputHelp() + + Output help information without exiting. + +## .help() + + Output help information and exit immediately. + +## Links + + - [API documentation](http://visionmedia.github.com/commander.js/) + - [ascii tables](https://github.com/LearnBoost/cli-table) + - [progress bars](https://github.com/visionmedia/node-progress) + - [more progress bars](https://github.com/substack/node-multimeter) + - [examples](https://github.com/visionmedia/commander.js/tree/master/examples) + +## License + +(The MIT License) + +Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/index.js new file mode 100644 index 00000000..790a7519 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/index.js @@ -0,0 +1,851 @@ + +/** + * Module dependencies. + */ + +var EventEmitter = require('events').EventEmitter; +var spawn = require('child_process').spawn; +var fs = require('fs'); +var exists = fs.existsSync; +var path = require('path'); +var dirname = path.dirname; +var basename = path.basename; + +/** + * Expose the root command. + */ + +exports = module.exports = new Command; + +/** + * Expose `Command`. + */ + +exports.Command = Command; + +/** + * Expose `Option`. + */ + +exports.Option = Option; + +/** + * Initialize a new `Option` with the given `flags` and `description`. + * + * @param {String} flags + * @param {String} description + * @api public + */ + +function Option(flags, description) { + this.flags = flags; + this.required = ~flags.indexOf('<'); + this.optional = ~flags.indexOf('['); + this.bool = !~flags.indexOf('-no-'); + flags = flags.split(/[ ,|]+/); + if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); + this.long = flags.shift(); + this.description = description || ''; +} + +/** + * Return option name. + * + * @return {String} + * @api private + */ + +Option.prototype.name = function(){ + return this.long + .replace('--', '') + .replace('no-', ''); +}; + +/** + * Check if `arg` matches the short or long flag. + * + * @param {String} arg + * @return {Boolean} + * @api private + */ + +Option.prototype.is = function(arg){ + return arg == this.short + || arg == this.long; +}; + +/** + * Initialize a new `Command`. + * + * @param {String} name + * @api public + */ + +function Command(name) { + this.commands = []; + this.options = []; + this._execs = []; + this._args = []; + this._name = name; +} + +/** + * Inherit from `EventEmitter.prototype`. + */ + +Command.prototype.__proto__ = EventEmitter.prototype; + +/** + * Add command `name`. + * + * The `.action()` callback is invoked when the + * command `name` is specified via __ARGV__, + * and the remaining arguments are applied to the + * function for access. + * + * When the `name` is "*" an un-matched command + * will be passed as the first arg, followed by + * the rest of __ARGV__ remaining. + * + * Examples: + * + * program + * .version('0.0.1') + * .option('-C, --chdir ', 'change the working directory') + * .option('-c, --config ', 'set config path. defaults to ./deploy.conf') + * .option('-T, --no-tests', 'ignore test hook') + * + * program + * .command('setup') + * .description('run remote setup commands') + * .action(function(){ + * console.log('setup'); + * }); + * + * program + * .command('exec ') + * .description('run the given remote command') + * .action(function(cmd){ + * console.log('exec "%s"', cmd); + * }); + * + * program + * .command('*') + * .description('deploy the given env') + * .action(function(env){ + * console.log('deploying "%s"', env); + * }); + * + * program.parse(process.argv); + * + * @param {String} name + * @param {String} [desc] + * @return {Command} the new command + * @api public + */ + +Command.prototype.command = function(name, desc){ + var args = name.split(/ +/); + var cmd = new Command(args.shift()); + if (desc) cmd.description(desc); + if (desc) this.executables = true; + if (desc) this._execs[cmd._name] = true; + this.commands.push(cmd); + cmd.parseExpectedArgs(args); + cmd.parent = this; + if (desc) return this; + return cmd; +}; + +/** + * Add an implicit `help [cmd]` subcommand + * which invokes `--help` for the given command. + * + * @api private + */ + +Command.prototype.addImplicitHelpCommand = function() { + this.command('help [cmd]', 'display help for [cmd]'); +}; + +/** + * Parse expected `args`. + * + * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. + * + * @param {Array} args + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parseExpectedArgs = function(args){ + if (!args.length) return; + var self = this; + args.forEach(function(arg){ + switch (arg[0]) { + case '<': + self._args.push({ required: true, name: arg.slice(1, -1) }); + break; + case '[': + self._args.push({ required: false, name: arg.slice(1, -1) }); + break; + } + }); + return this; +}; + +/** + * Register callback `fn` for the command. + * + * Examples: + * + * program + * .command('help') + * .description('display verbose help') + * .action(function(){ + * // output help here + * }); + * + * @param {Function} fn + * @return {Command} for chaining + * @api public + */ + +Command.prototype.action = function(fn){ + var self = this; + this.parent.on(this._name, function(args, unknown){ + // Parse any so-far unknown options + unknown = unknown || []; + var parsed = self.parseOptions(unknown); + + // Output help if necessary + outputHelpIfNecessary(self, parsed.unknown); + + // If there are still any unknown options, then we simply + // die, unless someone asked for help, in which case we give it + // to them, and then we die. + if (parsed.unknown.length > 0) { + self.unknownOption(parsed.unknown[0]); + } + + // Leftover arguments need to be pushed back. Fixes issue #56 + if (parsed.args.length) args = parsed.args.concat(args); + + self._args.forEach(function(arg, i){ + if (arg.required && null == args[i]) { + self.missingArgument(arg.name); + } + }); + + // Always append ourselves to the end of the arguments, + // to make sure we match the number of arguments the user + // expects + if (self._args.length) { + args[self._args.length] = self; + } else { + args.push(self); + } + + fn.apply(this, args); + }); + return this; +}; + +/** + * Define option with `flags`, `description` and optional + * coercion `fn`. + * + * The `flags` string should contain both the short and long flags, + * separated by comma, a pipe or space. The following are all valid + * all will output this way when `--help` is used. + * + * "-p, --pepper" + * "-p|--pepper" + * "-p --pepper" + * + * Examples: + * + * // simple boolean defaulting to false + * program.option('-p, --pepper', 'add pepper'); + * + * --pepper + * program.pepper + * // => Boolean + * + * // simple boolean defaulting to false + * program.option('-C, --no-cheese', 'remove cheese'); + * + * program.cheese + * // => true + * + * --no-cheese + * program.cheese + * // => true + * + * // required argument + * program.option('-C, --chdir ', 'change the working directory'); + * + * --chdir /tmp + * program.chdir + * // => "/tmp" + * + * // optional argument + * program.option('-c, --cheese [type]', 'add cheese [marble]'); + * + * @param {String} flags + * @param {String} description + * @param {Function|Mixed} fn or default + * @param {Mixed} defaultValue + * @return {Command} for chaining + * @api public + */ + +Command.prototype.option = function(flags, description, fn, defaultValue){ + var self = this + , option = new Option(flags, description) + , oname = option.name() + , name = camelcase(oname); + + // default as 3rd arg + if ('function' != typeof fn) defaultValue = fn, fn = null; + + // preassign default value only for --no-*, [optional], or + if (false == option.bool || option.optional || option.required) { + // when --no-* we make sure default is true + if (false == option.bool) defaultValue = true; + // preassign only if we have a default + if (undefined !== defaultValue) self[name] = defaultValue; + } + + // register the option + this.options.push(option); + + // when it's passed assign the value + // and conditionally invoke the callback + this.on(oname, function(val){ + // coercion + if (null != val && fn) val = fn(val); + + // unassigned or bool + if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) { + // if no value, bool true, and we have a default, then use it! + if (null == val) { + self[name] = option.bool + ? defaultValue || true + : false; + } else { + self[name] = val; + } + } else if (null !== val) { + // reassign + self[name] = val; + } + }); + + return this; +}; + +/** + * Parse `argv`, settings options and invoking commands when defined. + * + * @param {Array} argv + * @return {Command} for chaining + * @api public + */ + +Command.prototype.parse = function(argv){ + // implicit help + if (this.executables) this.addImplicitHelpCommand(); + + // store raw args + this.rawArgs = argv; + + // guess name + this._name = this._name || basename(argv[1]); + + // process argv + var parsed = this.parseOptions(this.normalize(argv.slice(2))); + var args = this.args = parsed.args; + + var result = this.parseArgs(this.args, parsed.unknown); + + // executable sub-commands + var name = result.args[0]; + if (this._execs[name]) return this.executeSubCommand(argv, args, parsed.unknown); + + return result; +}; + +/** + * Execute a sub-command executable. + * + * @param {Array} argv + * @param {Array} args + * @param {Array} unknown + * @api private + */ + +Command.prototype.executeSubCommand = function(argv, args, unknown) { + args = args.concat(unknown); + + if (!args.length) this.help(); + if ('help' == args[0] && 1 == args.length) this.help(); + + // --help + if ('help' == args[0]) { + args[0] = args[1]; + args[1] = '--help'; + } + + // executable + var dir = dirname(argv[1]); + var bin = basename(argv[1]) + '-' + args[0]; + + // check for ./ first + var local = path.join(dir, bin); + + // run it + args = args.slice(1); + var proc = spawn(local, args, { stdio: 'inherit', customFds: [0, 1, 2] }); + proc.on('error', function(err){ + if (err.code == "ENOENT") { + console.error('\n %s(1) does not exist, try --help\n', bin); + } else if (err.code == "EACCES") { + console.error('\n %s(1) not executable. try chmod or run with root\n', bin); + } + }); + + this.runningCommand = proc; +}; + +/** + * Normalize `args`, splitting joined short flags. For example + * the arg "-abc" is equivalent to "-a -b -c". + * This also normalizes equal sign and splits "--abc=def" into "--abc def". + * + * @param {Array} args + * @return {Array} + * @api private + */ + +Command.prototype.normalize = function(args){ + var ret = [] + , arg + , lastOpt + , index; + + for (var i = 0, len = args.length; i < len; ++i) { + arg = args[i]; + i > 0 && (lastOpt = this.optionFor(args[i-1])); + + if (lastOpt && lastOpt.required) { + ret.push(arg); + } else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) { + arg.slice(1).split('').forEach(function(c){ + ret.push('-' + c); + }); + } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { + ret.push(arg.slice(0, index), arg.slice(index + 1)); + } else { + ret.push(arg); + } + } + + return ret; +}; + +/** + * Parse command `args`. + * + * When listener(s) are available those + * callbacks are invoked, otherwise the "*" + * event is emitted and those actions are invoked. + * + * @param {Array} args + * @return {Command} for chaining + * @api private + */ + +Command.prototype.parseArgs = function(args, unknown){ + var cmds = this.commands + , len = cmds.length + , name; + + if (args.length) { + name = args[0]; + if (this.listeners(name).length) { + this.emit(args.shift(), args, unknown); + } else { + this.emit('*', args); + } + } else { + outputHelpIfNecessary(this, unknown); + + // If there were no args and we have unknown options, + // then they are extraneous and we need to error. + if (unknown.length > 0) { + this.unknownOption(unknown[0]); + } + } + + return this; +}; + +/** + * Return an option matching `arg` if any. + * + * @param {String} arg + * @return {Option} + * @api private + */ + +Command.prototype.optionFor = function(arg){ + for (var i = 0, len = this.options.length; i < len; ++i) { + if (this.options[i].is(arg)) { + return this.options[i]; + } + } +}; + +/** + * Parse options from `argv` returning `argv` + * void of these options. + * + * @param {Array} argv + * @return {Array} + * @api public + */ + +Command.prototype.parseOptions = function(argv){ + var args = [] + , len = argv.length + , literal + , option + , arg; + + var unknownOptions = []; + + // parse options + for (var i = 0; i < len; ++i) { + arg = argv[i]; + + // literal args after -- + if ('--' == arg) { + literal = true; + continue; + } + + if (literal) { + args.push(arg); + continue; + } + + // find matching Option + option = this.optionFor(arg); + + // option is defined + if (option) { + // requires arg + if (option.required) { + arg = argv[++i]; + if (null == arg) return this.optionMissingArgument(option); + this.emit(option.name(), arg); + // optional arg + } else if (option.optional) { + arg = argv[i+1]; + if (null == arg || ('-' == arg[0] && '-' != arg)) { + arg = null; + } else { + ++i; + } + this.emit(option.name(), arg); + // bool + } else { + this.emit(option.name()); + } + continue; + } + + // looks like an option + if (arg.length > 1 && '-' == arg[0]) { + unknownOptions.push(arg); + + // If the next argument looks like it might be + // an argument for this option, we pass it on. + // If it isn't, then it'll simply be ignored + if (argv[i+1] && '-' != argv[i+1][0]) { + unknownOptions.push(argv[++i]); + } + continue; + } + + // arg + args.push(arg); + } + + return { args: args, unknown: unknownOptions }; +}; + +/** + * Argument `name` is missing. + * + * @param {String} name + * @api private + */ + +Command.prototype.missingArgument = function(name){ + console.error(); + console.error(" error: missing required argument `%s'", name); + console.error(); + process.exit(1); +}; + +/** + * `Option` is missing an argument, but received `flag` or nothing. + * + * @param {String} option + * @param {String} flag + * @api private + */ + +Command.prototype.optionMissingArgument = function(option, flag){ + console.error(); + if (flag) { + console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag); + } else { + console.error(" error: option `%s' argument missing", option.flags); + } + console.error(); + process.exit(1); +}; + +/** + * Unknown option `flag`. + * + * @param {String} flag + * @api private + */ + +Command.prototype.unknownOption = function(flag){ + console.error(); + console.error(" error: unknown option `%s'", flag); + console.error(); + process.exit(1); +}; + + +/** + * Set the program version to `str`. + * + * This method auto-registers the "-V, --version" flag + * which will print the version number when passed. + * + * @param {String} str + * @param {String} flags + * @return {Command} for chaining + * @api public + */ + +Command.prototype.version = function(str, flags){ + if (0 == arguments.length) return this._version; + this._version = str; + flags = flags || '-V, --version'; + this.option(flags, 'output the version number'); + this.on('version', function(){ + console.log(str); + process.exit(0); + }); + return this; +}; + +/** + * Set the description `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.description = function(str){ + if (0 == arguments.length) return this._description; + this._description = str; + return this; +}; + +/** + * Set / get the command usage `str`. + * + * @param {String} str + * @return {String|Command} + * @api public + */ + +Command.prototype.usage = function(str){ + var args = this._args.map(function(arg){ + return arg.required + ? '<' + arg.name + '>' + : '[' + arg.name + ']'; + }); + + var usage = '[options' + + (this.commands.length ? '] [command' : '') + + ']' + + (this._args.length ? ' ' + args : ''); + + if (0 == arguments.length) return this._usage || usage; + this._usage = str; + + return this; +}; + +/** + * Return the largest option length. + * + * @return {Number} + * @api private + */ + +Command.prototype.largestOptionLength = function(){ + return this.options.reduce(function(max, option){ + return Math.max(max, option.flags.length); + }, 0); +}; + +/** + * Return help for options. + * + * @return {String} + * @api private + */ + +Command.prototype.optionHelp = function(){ + var width = this.largestOptionLength(); + + // Prepend the help information + return [pad('-h, --help', width) + ' ' + 'output usage information'] + .concat(this.options.map(function(option){ + return pad(option.flags, width) + + ' ' + option.description; + })) + .join('\n'); +}; + +/** + * Return command help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.commandHelp = function(){ + if (!this.commands.length) return ''; + return [ + '' + , ' Commands:' + , '' + , this.commands.map(function(cmd){ + var args = cmd._args.map(function(arg){ + return arg.required + ? '<' + arg.name + '>' + : '[' + arg.name + ']'; + }).join(' '); + + return pad(cmd._name + + (cmd.options.length + ? ' [options]' + : '') + ' ' + args, 22) + + (cmd.description() + ? ' ' + cmd.description() + : ''); + }).join('\n').replace(/^/gm, ' ') + , '' + ].join('\n'); +}; + +/** + * Return program help documentation. + * + * @return {String} + * @api private + */ + +Command.prototype.helpInformation = function(){ + return [ + '' + , ' Usage: ' + this._name + ' ' + this.usage() + , '' + this.commandHelp() + , ' Options:' + , '' + , '' + this.optionHelp().replace(/^/gm, ' ') + , '' + , '' + ].join('\n'); +}; + +/** + * Output help information for this command + * + * @api public + */ + +Command.prototype.outputHelp = function(){ + process.stdout.write(this.helpInformation()); + this.emit('--help'); +}; + +/** + * Output help information and exit. + * + * @api public + */ + +Command.prototype.help = function(){ + this.outputHelp(); + process.exit(); +}; + +/** + * Camel-case the given `flag` + * + * @param {String} flag + * @return {String} + * @api private + */ + +function camelcase(flag) { + return flag.split('-').reduce(function(str, word){ + return str + word[0].toUpperCase() + word.slice(1); + }); +} + +/** + * Pad `str` to `width`. + * + * @param {String} str + * @param {Number} width + * @return {String} + * @api private + */ + +function pad(str, width) { + var len = Math.max(0, width - str.length); + return str + Array(len + 1).join(' '); +} + +/** + * Output help information if necessary + * + * @param {Command} command to output help for + * @param {Array} array of options to search for -h or --help + * @api private + */ + +function outputHelpIfNecessary(cmd, options) { + options = options || []; + for (var i = 0; i < options.length; i++) { + if (options[i] == '--help' || options[i] == '-h') { + cmd.outputHelp(); + process.exit(0); + } + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/package.json new file mode 100644 index 00000000..ec8239f1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/commander/package.json @@ -0,0 +1,58 @@ +{ + "name": "commander", + "version": "2.1.0", + "description": "the complete solution for node.js command-line programs", + "keywords": [ + "command", + "option", + "parser", + "prompt", + "stdin" + ], + "author": { + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/commander.js.git" + }, + "devDependencies": { + "should": ">= 0.0.1" + }, + "scripts": { + "test": "make test" + }, + "main": "index", + "engines": { + "node": ">= 0.6.x" + }, + "files": [ + "index.js" + ], + "bugs": { + "url": "https://github.com/visionmedia/commander.js/issues" + }, + "homepage": "https://github.com/visionmedia/commander.js", + "_id": "commander@2.1.0", + "dist": { + "shasum": "d121bbae860d9992a3d517ba96f56588e47c6781", + "tarball": "http://registry.npmjs.org/commander/-/commander-2.1.0.tgz" + }, + "_from": "commander@>=2.1.0 <2.2.0", + "_npmVersion": "1.3.14", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + } + ], + "directories": {}, + "_shasum": "d121bbae860d9992a3d517ba96f56588e47c6781", + "_resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/.dntrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/.dntrc new file mode 100644 index 00000000..1c3e6243 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/.dntrc @@ -0,0 +1,36 @@ +## DNT config file +## see https://github.com/rvagg/dnt + +NODE_VERSIONS="\ + master \ + v0.11.13 \ + v0.11.10 \ + v0.11.9 \ + v0.11.8 \ + v0.11.7 \ + v0.11.6 \ + v0.11.5 \ + v0.11.4 \ + v0.10.26 \ + v0.10.25 \ + v0.10.24 \ + v0.10.23 \ + v0.10.22 \ + v0.10.21 \ + v0.10.20 \ + v0.10.19 \ + v0.10.18 \ + v0.8.26 \ + v0.8.25 \ + v0.8.24 \ + v0.8.23 \ + v0.8.22 \ +" +OUTPUT_PREFIX="nan-" +TEST_CMD="\ + cd /dnt/test/ && \ + npm install && \ + node_modules/.bin/node-gyp --nodedir /usr/src/node/ rebuild && \ + node_modules/.bin/tap --gc js/*-test.js; \ +" + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/LICENSE new file mode 100644 index 00000000..d502e18a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/LICENSE @@ -0,0 +1,46 @@ +Copyright 2013, NAN contributors: + - Rod Vagg + - Benjamin Byholm + - Trevor Norris + - Nathan Rajlich + - Brett Lawson + - Ben Noordhuis +(the "Original Author") +All rights reserved. + +MIT +no-false-attribs License + +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. + +Distributions of all or part of the Software intended to be used +by the recipients as they would use the unmodified Software, +containing modifications that substantially alter, remove, or +disable functionality of the Software, outside of the documented +configuration mechanisms provided by the Software, shall be +modified such that the Original Author's bug reporting email +addresses and urls are either replaced with the contact information +of the parties responsible for the changes, or removed entirely. + +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. + + +Except where noted, this license applies to any and all software +programs and associated documentation files created by the +Original Author, when distributed with the Software. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/README.md new file mode 100644 index 00000000..7c8d6883 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/README.md @@ -0,0 +1,947 @@ +Native Abstractions for Node.js +=============================== + +**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.11, and eventually 0.12.** + +***Current version: 1.0.0*** *(See [nan.h](https://github.com/rvagg/nan/blob/master/nan.h) for complete ChangeLog)* + +[![NPM](https://nodei.co/npm/nan.png?downloads=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/) + +Thanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle. + +This project also contains some helper utilities that make addon development a bit more pleasant. + + * **[News & Updates](#news)** + * **[Usage](#usage)** + * **[Example](#example)** + * **[API](#api)** + + +## News & Updates + +### May-2013: Major changes for V8 3.25 / Node 0.11.13 + +Node 0.11.11 and 0.11.12 were both broken releases for native add-ons, you simply can't properly compile against either of them for different reasons. But we now have a 0.11.13 release that jumps a couple of versions of V8 ahead and includes some more, major (traumatic) API changes. + +Because we are now nearing Node 0.12 and estimate that the version of V8 we are using in Node 0.11.13 will be close to the API we get for 0.12, we have taken the opportunity to not only *fix* NAN for 0.11.13 but make some major changes to improve the NAN API. + +We have **removed support for Node 0.11 versions prior to 0.11.13**, (although our tests are still passing for 0.11.10). As usual, our tests are run against (and pass) the last 5 versions of Node 0.8 and Node 0.10. We also include Node 0.11.13 obviously. + +The major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew(args)` interface for creating new `Local`s, this replaces `NanNewLocal()` and much more. If you look in [./nan.h](nan.h) you'll see a large number of overloaded versions of this method. In general you should be able to `NanNew(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local NanNew(const Persistent arg)` to replace `NanPersistentToLocal()`. + +We also now have `NanUndefined()`, `NanNull()`, `NanTrue()` and `NanFalse()`. Mainly because of the new requirement for an `Isolate` argument for each of the native V8 versions of this. + +V8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local value)`, although `HandleScope` still exists for when you don't need to return a handle to the caller. For NAN we are exposing it as `NanEscapableScope()` and `NanEscapeScope()`, while `NanScope()` is still how you create a new scope that doesn't need to return handles. For older versions of Node/V8, it'll still map to the older `HandleScope` functionality. + +`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead. + +Because `node::MakeCallback()` now takes an `Isolate`, and because it doesn't exist in older versions of Node, we've introduced `NanMakeCallabck()`. You should *always* use this when calling a JavaScript function from C++. + +There's lots more, check out the Changelog in nan.h or look through [#86](https://github.com/rvagg/nan/pull/86) for all the gory details. + +### Dec-2013: NanCString and NanRawString + +Two new functions have been introduced to replace the functionality that's been provided by `NanFromV8String` until now. NanCString has sensible defaults so it's super easy to fetch a null-terminated c-style string out of a `v8::String`. `NanFromV8String` is still around and has defaults that allow you to pass a single handle to fetch a `char*` while `NanRawString` requires a little more attention to arguments. + +### Nov-2013: Node 0.11.9+ breaking V8 change + +The version of V8 that's shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local::New(isolate, value)`, i.e. introducing the `isolate` argument and therefore breaking all new `Local` declarations for previous versions. NAN 0.6+ now includes a `NanNewLocal(value)` that can be used in place to work around this incompatibility and maintain compatibility with 0.8->0.11.9+ (minus a few early 0.11 releases). + +For example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local::New(v8::Null())` to `NanNewLocal(v8::Null())`. + +### Nov-2013: Change to binding.gyp `"include_dirs"` for NAN + +Inclusion of NAN in a project's binding.gyp is now greatly simplified. You can now just use `" +## Usage + +Simply add **NAN** as a dependency in the *package.json* of your Node addon: + +``` bash +$ npm install --save nan +``` + +Pull in the path to **NAN** in your *binding.gyp* so that you can use `#include ` in your *.cpp* files: + +``` python +"include_dirs" : [ + "` when compiling your addon. + + +## Example + +See **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use. + +For a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**. + +Compare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work). + +Note that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class. + +```c++ +// addon.cc +#include +#include +// ... + +using v8::FunctionTemplate; +using v8::Handle; +using v8::Object; + +void InitAll(Handle exports) { + exports->Set(NanSymbol("calculateSync"), + NanNew(CalculateSync)->GetFunction()); + + exports->Set(NanSymbol("calculateAsync"), + NanNew(CalculateAsync)->GetFunction()); +} + +NODE_MODULE(addon, InitAll) +``` + +```c++ +// sync.h +#include +#include + +NAN_METHOD(CalculateSync); +``` + +```c++ +// sync.cc +#include +#include +#include "./sync.h" +// ... + +using v8::Number; + +// Simple synchronous access to the `Estimate()` function +NAN_METHOD(CalculateSync) { + NanScope(); + + // expect a number as the first argument + int points = args[0]->Uint32Value(); + double est = Estimate(points); + + NanReturnValue(NanNew(est)); +} +``` + +```c++ +// async.cc +#include +#include +#include "./async.h" + +// ... + +using v8::Function; +using v8::Local; +using v8::Null; +using v8::Number; +using v8::Value; + +class PiWorker : public NanAsyncWorker { + public: + PiWorker(NanCallback *callback, int points) + : NanAsyncWorker(callback), points(points) {} + ~PiWorker() {} + + // Executed inside the worker-thread. + // It is not safe to access V8, or V8 data structures + // here, so everything we need for input and output + // should go on `this`. + void Execute () { + estimate = Estimate(points); + } + + // Executed when the async work is complete + // this function will be run inside the main event loop + // so it is safe to use V8 again + void HandleOKCallback () { + NanScope(); + + Local argv[] = { + NanNew(NanNull()) + , NanNew(estimate) + }; + + callback->Call(2, argv); + }; + + private: + int points; + double estimate; +}; + +// Asynchronous access to the `Estimate()` function +NAN_METHOD(CalculateAsync) { + NanScope(); + + int points = args[0]->Uint32Value(); + NanCallback *callback = new NanCallback(args[1].As()); + + NanAsyncQueueWorker(new PiWorker(callback, points)); + NanReturnUndefined(); +} +``` + + +## API + + * NAN_METHOD + * NAN_GETTER + * NAN_SETTER + * NAN_PROPERTY_GETTER + * NAN_PROPERTY_SETTER + * NAN_PROPERTY_ENUMERATOR + * NAN_PROPERTY_DELETER + * NAN_PROPERTY_QUERY + * NAN_INDEX_GETTER + * NAN_INDEX_SETTER + * NAN_INDEX_ENUMERATOR + * NAN_INDEX_DELETER + * NAN_INDEX_QUERY + * NAN_WEAK_CALLBACK + * NAN_DEPRECATED + * NAN_INLINE + * NanNew + * NanUndefined + * NanNull + * NanTrue + * NanFalse + * NanReturnValue + * NanReturnUndefined + * NanReturnNull + * NanReturnEmptyString + * NanScope + * NanEscapableScope + * NanEscapeScope + * NanLocker + * NanUnlocker + * NanGetInternalFieldPointer + * NanSetInternalFieldPointer + * NanObjectWrapHandle + * NanSymbol + * NanGetPointerSafe + * NanSetPointerSafe + * NanRawString + * NanCString + * NanBooleanOptionValue + * NanUInt32OptionValue + * NanError, NanTypeError, NanRangeError + * NanThrowError, NanThrowTypeError, NanThrowRangeError, NanThrowError(Handle), NanThrowError(Handle, int) + * NanNewBufferHandle(char *, size_t, FreeCallback, void *), NanNewBufferHandle(char *, uint32_t), NanNewBufferHandle(uint32_t) + * NanBufferUse(char *, uint32_t) + * NanNewContextHandle + * NanGetCurrentContext + * NanHasInstance + * NanDisposePersistent + * NanAssignPersistent + * NanMakeWeakPersistent + * NanSetTemplate + * NanMakeCallback + * NanCompileScript + * NanRunScript + * NanAdjustExternalMemory + * NanAddGCEpilogueCallback + * NanAddGCPrologueCallback + * NanRemoveGCEpilogueCallback + * NanRemoveGCPrologueCallback + * NanGetHeapStatistics + * NanCallback + * NanAsyncWorker + * NanAsyncQueueWorker + + +### NAN_METHOD(methodname) + +Use `NAN_METHOD` to define your V8 accessible methods: + +```c++ +// .h: +class Foo : public node::ObjectWrap { + ... + + static NAN_METHOD(Bar); + static NAN_METHOD(Baz); +} + + +// .cc: +NAN_METHOD(Foo::Bar) { + ... +} + +NAN_METHOD(Foo::Baz) { + ... +} +``` + +The reason for this macro is because of the method signature change in 0.11: + +```c++ +// 0.10 and below: +Handle name(const Arguments& args) + +// 0.11 and above +void name(const FunctionCallbackInfo& args) +``` + +The introduction of `FunctionCallbackInfo` brings additional complications: + + +### NAN_GETTER(methodname) + +Use `NAN_GETTER` to declare your V8 accessible getters. You get a `Local` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`. + + +### NAN_SETTER(methodname) + +Use `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local` `value` object to work with. + + +### NAN_PROPERTY_GETTER(cbname) +Use `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`. + + +### NAN_PROPERTY_SETTER(cbname) +Use `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local` `value` object to work with. + + +### NAN_PROPERTY_ENUMERATOR(cbname) +Use `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`. + + +### NAN_PROPERTY_DELETER(cbname) +Use `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`. + + +### NAN_PROPERTY_QUERY(cbname) +Use `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`. + + +### NAN_INDEX_GETTER(cbname) +Use `NAN_INDEX_GETTER` to declare your V8 accessible index getters. You get a `uint32_t` `index` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_GETTER`. + + +### NAN_INDEX_SETTER(cbname) +Use `NAN_INDEX_SETTER` to declare your V8 accessible index setters. Same as `NAN_INDEX_GETTER` but you also get a `Local` `value` object to work with. + + +### NAN_INDEX_ENUMERATOR(cbname) +Use `NAN_INDEX_ENUMERATOR` to declare your V8 accessible index enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_INDEX_GETTER` call. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_ENUMERATOR`. + + +### NAN_INDEX_DELETER(cbname) +Use `NAN_INDEX_DELETER` to declare your V8 accessible index deleters. Same as `NAN_INDEX_GETTER`. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_DELETER`. + + +### NAN_INDEX_QUERY(cbname) +Use `NAN_INDEX_QUERY` to declare your V8 accessible index queries. Same as `NAN_INDEX_GETTER`. + +You can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_QUERY`. + + +### NAN_WEAK_CALLBACK(cbname) + +Use `NAN_WEAK_CALLBACK` to define your V8 WeakReference callbacks. Do not use for declaration. There is an argument object `const _NanWeakCallbackData &data` allowing access to the weak object and the supplied parameter through its `GetValue` and `GetParameter` methods. + +```c++ +NAN_WEAK_CALLBACK(weakCallback) { + int *parameter = data.GetParameter(); + NanMakeCallback(NanGetCurrentContext()->Global(), data.GetValue(), 0, NULL); + if ((*parameter)++ == 0) { + data.Revive(); + } else { + delete parameter; + data.Dispose(); + } +} +``` + + +### NAN_DEPRECATED +Declares a function as deprecated. + +```c++ +static NAN_DEPRECATED NAN_METHOD(foo) { + ... +} +``` + + +### NAN_INLINE +Inlines a function. + +```c++ +NAN_INLINE int foo(int bar) { + ... +} +``` + + +### Local<T> NanNew<T>( ... ) + +Use `NanNew` to construct almost all v8 objects and make new local handles. + +```c++ +Local s = NanNew("value"); + +... + +Persistent o; + +... + +Local lo = NanNew(o); + +``` + + +### Handle<Primitive> NanUndefined() + +Use instead of `Undefined()` + + +### Handle<Primitive> NanNull() + +Use instead of `Null()` + + +### Handle<Primitive> NanTrue() + +Use instead of `True()` + + +### Handle<Primitive> NanFalse() + +Use instead of `False()` + + +### NanReturnValue(Handle<Value>) + +Use `NanReturnValue` when you want to return a value from your V8 accessible method: + +```c++ +NAN_METHOD(Foo::Bar) { + ... + + NanReturnValue(NanNew("FooBar!")); +} +``` + +No `return` statement required. + + +### NanReturnUndefined() + +Use `NanReturnUndefined` when you don't want to return anything from your V8 accessible method: + +```c++ +NAN_METHOD(Foo::Baz) { + ... + + NanReturnUndefined(); +} +``` + + +### NanReturnNull() + +Use `NanReturnNull` when you want to return `Null` from your V8 accessible method: + +```c++ +NAN_METHOD(Foo::Baz) { + ... + + NanReturnNull(); +} +``` + + +### NanReturnEmptyString() + +Use `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method: + +```c++ +NAN_METHOD(Foo::Baz) { + ... + + NanReturnEmptyString(); +} +``` + + +### NanScope() + +The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope`: + +```c++ +NAN_METHOD(Foo::Bar) { + NanScope(); + + NanReturnValue(NanNew("FooBar!")); +} +``` + + +### NanEscapableScope() + +The separation of handle scopes into escapable and inescapable scopes makes `NanEscapableScope()` necessary, use it in place of `HandleScope scope` when you later wish to `Close()` the scope: + +```c++ +Handle Foo::Bar() { + NanEscapableScope(); + + return NanEscapeScope(NanNew("FooBar!")); +} +``` + + +### Local<T> NanEscapeScope(Handle<T> value); +Use together with `NanEscapableScope` to escape the scope. Corresponds to `HandleScope::Close` or `EscapableHandleScope::Escape`. + + +### NanLocker() + +The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`: + +```c++ +NAN_METHOD(Foo::Bar) { + NanLocker(); + ... + NanUnlocker(); +} +``` + + +### NanUnlocker() + +The introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`: + +```c++ +NAN_METHOD(Foo::Bar) { + NanLocker(); + ... + NanUnlocker(); +} +``` + + +### void * NanGetInternalFieldPointer(Handle<Object>, int) + +Gets a pointer to the internal field with at `index` from a V8 `Object` handle. + +```c++ +Local obj; +... +NanGetInternalFieldPointer(obj, 0); +``` + +### void NanSetInternalFieldPointer(Handle<Object>, int, void *) + +Sets the value of the internal field at `index` on a V8 `Object` handle. + +```c++ +static Persistent dataWrapperCtor; +... +Local wrapper = NanPersistentToLocal(dataWrapperCtor)->NewInstance(); +NanSetInternalFieldPointer(wrapper, 0, this); +``` + + +### Local<Object> NanObjectWrapHandle(Object) + +When you want to fetch the V8 object handle from a native object you've wrapped with Node's `ObjectWrap`, you should use `NanObjectWrapHandle`: + +```c++ +NanObjectWrapHandle(iterator)->Get(NanSymbol("end")) +``` + + +### String NanSymbol(char *) + +Use to create string symbol objects (i.e. `v8::String::NewSymbol(x)`), for getting and setting object properties, or names of objects. + +```c++ +bool foo = false; +if (obj->Has(NanSymbol("foo"))) + foo = optionsObj->Get(NanSymbol("foo"))->BooleanValue() +``` + + +### Type NanGetPointerSafe(Type *[, Type]) + +A helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`. Otherwise, the function returns the value the pointer points to. + +```c++ +char *plugh(uint32_t *optional) { + char res[] = "xyzzy"; + uint32_t param = NanGetPointerSafe(optional, 0x1337); + switch (param) { + ... + } + NanSetPointerSafe(optional, 0xDEADBEEF); +} +``` + + +### bool NanSetPointerSafe(Type *, Type) + +A helper for setting optional argument pointers. If the pointer is `NULL`, the function simply returns `false`. Otherwise, the value is assigned to the variable the pointer points to. + +```c++ +const char *plugh(size_t *outputsize) { + char res[] = "xyzzy"; + if !(NanSetPointerSafe(outputsize, strlen(res) + 1)) { + ... + } + + ... +} +``` + + +### void* NanRawString(Handle<Value>, enum Nan::Encoding, size_t *, void *, size_t, int) + +When you want to convert a V8 `String` to a `char*` buffer, use `NanRawString`. You have to supply an encoding as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows setting `String::WriteOptions`. +Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: + +```c++ +size_t count; +void* decoded = NanRawString(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED); +char param_copy[count]; +memcpy(param_copy, decoded, count); +delete[] decoded; +``` + + +### char* NanCString(Handle<Value>, size_t *[, char *, size_t, int]) + +When you want to convert a V8 `String` to a null-terminated C `char*` use `NanCString`. The resulting `char*` will be UTF-8-encoded, and you need to supply a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `v8::String::NO_OPTIONS`. +Just remember that you'll end up with an object that you'll need to `delete[]` at some point unless you supply your own buffer: + +```c++ +size_t count; +char* name = NanCString(args[0], &count); +``` + + +### bool NanBooleanOptionValue(Handle<Value>, Handle<String>[, bool]) + +When you have an "options" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`. + +The optional last parameter is the *default* value, which is `false` if left off: + +```c++ +// `foo` is false unless the user supplies a truthy value for it +bool foo = NanBooleanOptionValue(optionsObj, NanSymbol("foo")); +// `bar` is true unless the user supplies a falsy value for it +bool bar = NanBooleanOptionValueDefTrue(optionsObj, NanSymbol("bar"), true); +``` + + +### uint32_t NanUInt32OptionValue(Handle<Value>, Handle<String>, uint32_t) + +Similar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer. + +Requires all 3 arguments as a default is not optional: + +```c++ +uint32_t count = NanUInt32OptionValue(optionsObj, NanSymbol("count"), 1024); +``` + + +### NanError(message), NanTypeError(message), NanRangeError(message) + +For making `Error`, `TypeError` and `RangeError` objects. + +```c++ +Local res = NanError("you must supply a callback argument"); +``` + + +### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local<Value>), NanThrowError(Local<Value>, int) + +For throwing `Error`, `TypeError` and `RangeError` objects. You should `return` this call: + +```c++ +return NanThrowError("you must supply a callback argument"); +``` + +Can also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`. + + +### Local<Object> NanNewBufferHandle(char *, uint32_t), Local<Object> NanNewBufferHandle(uint32_t) + +The `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation: + +```c++ +NanNewBufferHandle((char*)value.data(), value.size()); +``` + +Can also be used to initialize a `Buffer` with just a `size` argument. + +Can also be supplied with a `NanFreeCallback` and a hint for the garbage collector. + + +### Local<Object> NanBufferUse(char*, uint32_t) + +`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data. +While it was possible to get around this, it required a shim by passing a +callback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove +needing to use this shim. + +`NanBufferUse` uses the `char*` passed as the backing data, and will free the +memory automatically when the weak callback is called. Keep this in mind, as +careless use can lead to "double free or corruption" and other cryptic failures. + + +### bool NanHasInstance(Persistent<FunctionTemplate>&, Handle<Value>) + +Can be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent` handle for. + + +### Local<Context> NanNewContextHandle([ExtensionConfiguration*, Handle<ObjectTemplate>, Handle<Value>]) +Creates a new `Local` handle. + +```c++ +Local ftmpl = NanNew(); +Local otmpl = ftmpl->InstanceTemplate(); +Local ctx = NanNewContextHandle(NULL, otmpl); +``` + + +### Local NanGetCurrentContext() + +Gets the current context. + +```c++ +Local ctx = NanGetCurrentContext(); +``` + + +### void NanDisposePersistent(Persistent<T> &) + +Use `NanDisposePersistent` to dispose a `Persistent` handle. + +```c++ +NanDisposePersistent(persistentHandle); +``` + + +### NanAssignPersistent(type, handle, object) + +Use `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier. + +In general it is now better to place anything you want to protect from V8's garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`: + +```c++ +Persistent persistentHandle; + +... + +Local obj = NanNew(); +obj->Set(NanSymbol("key"), keyHandle); // where keyHandle might be a Local +NanAssignPersistent(Object, persistentHandle, obj) +``` + + +### NanMakeWeakPersistent(Handle<T> handle, P* parameter, _NanWeakCallbackInfo<T, P>::Callback callback) + +Creates a weak persistent handle with the supplied parameter and `NAN_WEAK_CALLBACK`. The callback has to be fully specialized to work on all versions of Node. + +```c++ +NAN_WEAK_CALLBACK(weakCallback) { + +... + +} + +Local func; + +... + +int *parameter = new int(0); +NanMakeWeakPersistent(func, parameter, &weakCallback); +``` + + +### NanSetTemplate(templ, name, value) + +Use to add properties on object and function templates. + + +### NanMakeCallback(target, func, argc, argv) + +Use instead of `node::MakeCallback` to call javascript functions. This is the only proper way of calling functions. + + +### NanCompileScript(Handle s [, const ScriptOrigin& origin]) + +Use to create new scripts bound to the current context. + + +### NanRunScript(script) + +Use to run both bound and unbound scripts. + + +### NanAdjustExternalMemory(int change_in_bytes) + +Simply does `AdjustAmountOfExternalAllocatedMemory` + + +### NanAddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter=kGCTypeAll) + +Simply does `AddGCEpilogueCallback` + + +### NanAddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type_filter=kGCTypeAll) + +Simply does `AddGCPrologueCallback` + + +### NanRemoveGCEpilogueCallback(GCEpilogueCallback callback) + +Simply does `RemoveGCEpilogueCallback` + + +### NanRemoveGCPrologueCallback(GCPrologueCallback callback) + +Simply does `RemoveGCPrologueCallback` + + +### NanGetHeapStatistics(HeapStatistics *heap_statistics) + +Simply does `GetHeapStatistics` + + +### NanCallback + +Because of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Handle` is annoyingly tricky. `NanCallback` makes it easier by taking your handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`. + +```c++ +Local callbackHandle = args[0].As(); +NanCallback *callback = new NanCallback(callbackHandle); +// pass `callback` around and it's safe from GC until you: +delete callback; +``` + +You can execute the callback like so: + +```c++ +// no arguments: +callback->Call(0, NULL); + +// an error argument: +Handle argv[] = { + NanError(NanNew("fail!")) +}; +callback->Call(1, argv); + +// a success argument: +Handle argv[] = { + NanNull(), + NanNew("w00t!") +}; +callback->Call(2, argv); +``` + +`NanCallback` also has a `Local GetCallback()` method that you can use +to fetch a local handle to the underlying callback function, as well as a +`void SetFunction(Handle)` for setting the callback on the +`NanCallback`. Additionally a generic constructor is available for using +`NanCallback` without performing heap allocations. + + +### NanAsyncWorker + +`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress. + +See a rough outline of the implementation: + +```c++ +class NanAsyncWorker { +public: + NanAsyncWorker (NanCallback *callback); + + // Clean up persistent handles and delete the *callback + virtual ~NanAsyncWorker (); + + // Check the `char *errmsg` property and call HandleOKCallback() + // or HandleErrorCallback depending on whether it has been set or not + virtual void WorkComplete (); + + // You must implement this to do some async work. If there is an + // error then allocate `errmsg` to a message and the callback will + // be passed that string in an Error object + virtual void Execute (); + + // Save a V8 object in a Persistent handle to protect it from GC + void SavePersistent(const char *key, Local &obj); + + // Fetch a stored V8 object (don't call from within `Execute()`) + Local GetFromPersistent(const char *key); + +protected: + // Set this if there is an error, otherwise it's NULL + const char *errmsg; + + // Default implementation calls the callback function with no arguments. + // Override this to return meaningful data + virtual void HandleOKCallback (); + + // Default implementation calls the callback function with an Error object + // wrapping the `errmsg` string + virtual void HandleErrorCallback (); +}; +``` + + +### NanAsyncQueueWorker(NanAsyncWorker *) + +`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you—most of the logic for this is embedded in `NanAsyncWorker`. + +### Contributors + +NAN is only possible due to the excellent work of the following contributors: + +
'; +html += '
Post Game Log Message
'; +html += '
'; +html += ''; +html += '
Enter your log message here. Plain text only please.
'; +html += '
'; +html += '

'; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + ' ' + large_icon_button('check', 'Post Message', "glog_post('"+game_id+"')") + '
'; +html += '
'; +html += ''; +session.hooks.keys[ESC_KEY] = 'hide_popup_dialog'; +safe_focus( 'fe_glog_body' ); +show_popup_dialog(500, 175, html); +} +function glog_post(game_id) { +var msg = trim( $('fe_glog_body').value ); +if (msg) { +hide_popup_dialog(); +effect_api_send('game_post_log', { +GameID: game_id, +Message: msg +}, [this, 'glog_post_finish'], { _game_id: game_id }); +} +} +function glog_post_finish(response, tx) { +show_glog_widget( tx._game_id ); +} +function hide_glog_widget() { +$('glog_widget').hide(); +} +function get_icon_for_glog_type(type) { +var icon = 'page_white.png'; +switch (type) { +case 'asset': icon = 'folder_page_white.png'; break; +case 'game': icon = 'controller.png'; break; +case 'member': icon = 'user'; break; +case 'comment': icon = 'comment.png'; break; +case 'level': icon = 'world.png'; break; +case 'sprite': icon = 'cog.png'; break; +case 'tile': icon = 'brick.png'; break; +case 'tileset': icon = 'color_swatch.png'; break; +case 'rev': icon = 'cd.png'; break; +case 'revision': icon = 'cd.png'; break; +case 'font': icon = 'style.png'; break; +case 'key': icon = 'keyboard.png'; break; +case 'audio': icon = 'sound'; break; +case 'payment': icon = 'money.png'; break; +case 'env': icon = 'weather.png'; break; +case 'environment': icon = 'weather.png'; break; +} +return icon; +} +function effect_load_script(url) { +Debug.trace('api', 'Loading script: ' + url); +load_script(url); +} +function effect_api_get_ie(cmd, params, userData) { +if (!session.api_state_ie) session.api_state_ie = {}; +var unique_id = get_unique_id(); +session.api_state_ie[unique_id] = userData; +params.format = 'js'; +params.onafter = 'effect_api_response_ie(' + unique_id + ', response);'; +var url = '/effect/api/' + cmd + composeQueryString(params); +Debug.trace('api', "Sending MSIE HTTP GET: " + url); +load_script(url); +} +function effect_api_response_ie(unique_id, tree) { +Debug.trace('api', "Got response from MSIE HTTP GET"); +var tx = session.api_state_ie[unique_id]; +delete session.api_state_ie[unique_id]; +if (tree.Code == 'session') { +do_logout_2(); +return; +} +if (tree.Code == 'access') { +do_notice("Access Denied", tree.Description, 'do_not_pass_go'); +return; +} +if (tree.Code != 0) { +if (tx._on_error) return fire_callback( tx._on_error, tree, tx ); +return do_error( tree.Description ); +} +if (tree.SessionID) { +if (tree.SessionID == '_DELETE_') { +delete session.cookie.tree.effect_session_id; +} +else { +session.cookie.set( 'effect_session_id', tree.SessionID ); +} +session.cookie.save(); +} +if (tx._api_callback) { +fire_callback( tx._api_callback, tree, tx ); +} +} +function effect_api_get(cmd, params, callback, userData) { +if (!userData) userData = {}; +userData._api_callback = callback; +if (!session.api_mod_cache[cmd] && session.username) session.api_mod_cache[cmd] = hires_time_now(); +if (!params.mod && session.api_mod_cache[cmd]) params.mod = session.api_mod_cache[cmd]; +if (ie) return effect_api_get_ie(cmd, params, userData); +var url = '/effect/api/' + cmd + composeQueryString(params); +Debug.trace('api', "Sending HTTP GET: " + url); +ajax.get( url, 'effect_api_response', userData ); +} +function effect_api_send(cmd, xml, callback, userData) { +if (!userData) userData = {}; +userData._api_callback = callback; +var data = compose_xml('EffectRequest', xml); +Debug.trace('api', "Sending API Command: " + cmd + ": " + data); +ajax.send({ +method: 'POST', +url: '/effect/api/' + cmd, +data: data, +headers: { 'Content-Type': 'text/xml' } +}, 'effect_api_response', userData); +} +function effect_api_response(tx) { +Debug.trace('api', "HTTP " + tx.response.code + ": " + tx.response.data); +if (tx.response.code == 999) { +if (tx.request._auto_retry) { +session.net_error = false; +show_progress_dialog(1, "Trying to reestablish connection..."); +session.net_error = true; +setTimeout( function() { ajax.send(tx.request); }, 1000 ); +return; +} +else return do_error( "HTTP ERROR: " + tx.response.code + ": " + tx.response.data + ' (URL: ' + tx.request.url + ')' ); +} +if (session.net_error) { +hide_progress_dialog(); +session.net_error = false; +} +if (tx.response.code != 200) { +if (tx._silent) return; +else return do_error( "HTTP ERROR: " + tx.response.code + ": " + tx.response.data + ' (URL: ' + tx.request.url + ')' ); +} +var tree = null; +if (!tx._raw) { +var parser = new XML({ +preserveAttributes: true, +text: tx.response.data +}); +if (parser.getLastError()) return do_error("XML PARSE ERROR: " + parser.getLastError()); +tree = parser.getTree(); +if (tree.Code == 'session') { +do_logout_2(); +return; +} +if (tree.Code == 'access') { +do_notice("Access Denied", tree.Description, 'do_not_pass_go'); +return; +} +if (tree.Code != 0) { +if (tx._on_error) return fire_callback( tx._on_error, tree, tx ); +return do_error( tree.Description ); +} +if (tree.SessionID) { +if (tree.SessionID == '_DELETE_') { +delete session.cookie.tree.effect_session_id; +} +else { +session.cookie.set( 'effect_session_id', tree.SessionID ); +} +session.cookie.save(); +} +} +if (tx._api_callback) { +fire_callback( tx._api_callback, tree, tx ); +} +} +function effect_api_mod_touch() { +for (var idx = 0, len = arguments.length; idx < len; idx++) { +session.api_mod_cache[ arguments[idx] ] = hires_time_now(); +} +} +function do_not_pass_go() { +Nav.go('Main'); +} +var Nav = { +loc: '', +old_loc: '', +inited: false, +nodes: [], +init: function() { +if (!this.inited) { +this.inited = true; +this.loc = 'init'; +this.monitor(); +} +}, +monitor: function() { +var parts = window.location.href.split(/\#/); +var anchor = parts[1]; +if (!anchor) anchor = 'Main'; +var full_anchor = '' + anchor; +var sub_anchor = ''; +anchor = anchor.replace(/\%7C/, '|'); +if (anchor.match(/\|(\w+)$/)) { +sub_anchor = RegExp.$1.toLowerCase(); +anchor = anchor.replace(/\|(\w+)$/, ''); +} +if ((anchor != this.loc) && !anchor.match(/^_/)) { +Debug.trace('nav', "Caught navigation anchor: " + full_anchor); +var page_name = ''; +var page_args = null; +if (full_anchor.match(/^\w+\?.+/)) { +parts = full_anchor.split(/\?/); +page_name = parts[0]; +page_args = parseQueryString( parts[1] ); +} +else if (full_anchor.match(/^(\w+)\/(.*)$/)) { +page_name = RegExp.$1; +page_args = RegExp.$2; +} +else { +parts = full_anchor.split(/\//); +page_name = parts[0]; +page_args = parts.slice(1); +} +Debug.trace('nav', "Calling page: " + page_name + ": " + serialize(page_args)); +hide_popup_dialog(); +var result = page_manager.click( page_name, page_args ); +if (result) { +if (window.pageTracker && (this.loc != 'init')) { +setTimeout( function() { pageTracker._trackPageview('/effect/' + anchor); }, 1000 ); +} +this.old_loc = this.loc; +if (this.old_loc == 'init') this.old_loc = 'Main'; +this.loc = anchor; +} +else { +this.go( this.loc ); +} +} +else if (sub_anchor != this.sub_anchor) { +Debug.trace('nav', "Caught sub-anchor: " + sub_anchor); +$P().gosub( sub_anchor ); +} +this.sub_anchor = sub_anchor; +setTimeout( 'Nav.monitor()', 100 ); +}, +go: function(anchor, force) { +anchor = anchor.replace(/^\#/, ''); +if (force) this.loc = 'init'; +window.location.href = '#' + anchor; +}, +prev: function() { +this.go( this.old_loc || 'Main' ); +}, +refresh: function() { +this.loc = 'refresh'; +}, +bar: function() { +var nodes = arguments; +var html = ''; +for (var idx = 0, len = nodes.length; idx < len; idx++) { +var node = nodes[idx]; +if (node) this.nodes[idx] = node; +else node = this.nodes[idx]; +if (node != '_ignore_') { +html += ''; +} +} +html += '
'; +$('d_nav_bar').innerHTML = html; +}, +title: function(name) { +if (name) document.title = name + ' | EffectGames.com'; +else document.title = 'EffectGames.com'; +}, +currentAnchor: function() { +var parts = window.location.href.split(/\#/); +var anchor = parts[1] || ''; +var sub_anchor = ''; +anchor = anchor.replace(/\%7C/, '|'); +if (anchor.match(/\|(\w+)$/)) { +sub_anchor = RegExp.$1.toLowerCase(); +anchor = anchor.replace(/\|(\w+)$/, ''); +} +return anchor; +} +}; +var Blog = { +edit_caption: '
*Bold*  |Italic|  {monospace}  [http://link]  Formatting Guide...
', +search: function(args) { +if (!args.mode) args.mode = 'and'; +if (!args.offset) args.offset = 0; +if (!args.limit) args.limit = 10; +if (!args.format) args.format = 'xml'; +var query_args = copy_object( args ); +delete query_args.callback; +effect_api_get( 'article_search', query_args, [this, 'search_response'], { _search_args: args } ); +}, +get_article_preview: function(row, args) { +var html = ''; +Debug.trace('blog', 'Row: ' + dumper(row)); +html += '
'; +var ext_article_url = 'http://' + location.hostname + '/effect/article.psp.html' + row.Path + '/' + row.ArticleID; +var article_url = '#Article' + row.Path + '/' + row.ArticleID; +html += ''; +if (!args.title_only) { +html += '
'; +html += row.Preview; +html += '  ' + (args.link_title || 'Read Full Story...') + ''; +html += '
'; +html += ''; +html += '
'; +var elem_class = args.footer_element_class || 'blog_preview_footer_element'; +if ((session.username == row.Username) || is_admin()) { +html += '
' + +icon('page_white_edit.png', "Edit", '#ArticleEdit?path=' + row.Path + '&id=' + row.ArticleID) + '
'; +} +html += '
' + get_user_display(row.Username) + '
'; +html += '
' + icon('calendar', get_short_date_time(row.Published)) + '
'; +html += '
' + icon('talk', row.Comments) + '
'; +if (0 && row.Tags) html += '
' + icon('note.png', make_tag_links(row.Tags, 3)) + '
'; +html += '
' + icon('facebook.png', 'Facebook', "window.open('http://www.facebook.com/sharer.php?u="+encodeURIComponent(ext_article_url)+'&t='+encodeURIComponent(row.Title)+"','sharer','toolbar=0,status=0,width=626,height=436')", "Share on Facebook") + '
'; +html += '
' + icon('twitter.png', 'Twitter', "window.open('http://twitter.com/home?status=Reading%20" + encodeURIComponent(row.Title) + "%3A%20" + encodeURIComponent(ext_article_url)+"')", "Share on Twitter") + '
'; +html += '
'; +html += '
'; +html += '
'; +} +html += '
'; +return html; +}, +search_response: function(response, tx) { +var args = tx._search_args; +if (args.callback) return fire_callback(args.callback, response, args); +var div = $(args.target); +assert(div, "Could not find target DIV: " + args.target); +var html = ''; +if (response.Rows && response.Rows.Row) { +var rows = always_array( response.Rows.Row ); +for (var idx = 0, len = rows.length; idx < len; idx++) { +var row = rows[idx]; +html += this.get_article_preview( row, args ); +} +if (args.more && (rows.length == args.limit)) { +html += large_icon_button('page_white_put.png', 'More...', "Blog.more(this, "+encode_object(args)+")") + '
'; +html += spacer(1,15) + '
'; +} +if (args.after) html += args.after; +} +else if (response.Code != 0) { +html = 'Search Error: ' . response.Code + ': ' + response.Description; +} +else { +html = args.none_found_msg || 'No articles found.'; +} +div.innerHTML = html; +}, +more: function(div, args) { +args.offset += args.limit; +Debug.trace('blog', "More Args: " + dumper(args)); +div.innerHTML = ''; +effect_api_get( 'article_search', args, [this, 'more_response'], { _search_args: args, _div: div } ); +}, +more_response: function(response, tx) { +var args = tx._search_args; +var button = tx._div; +var html = ''; +if (response.Rows && response.Rows.Row) { +var rows = always_array( response.Rows.Row ); +for (var idx = 0, len = rows.length; idx < len; idx++) { +var row = rows[idx]; +html += this.get_article_preview( row, args ); +} +if (args.more && (rows.length == args.limit)) { +html += large_icon_button('page_white_put.png', 'More...', "Blog.more(this, "+encode_object(args)+")") + '
'; +html += spacer(1,15) + '
'; +} +} +else if (response.Code != 0) { +html = 'Search Error: ' . response.Code + ': ' + response.Description; +} +else { +html = args.none_found_msg || 'No more articles found.'; +} +var div = document.createElement('div'); +div.innerHTML = html; +button.parentNode.replaceChild( div, button ); +} +}; +function make_tag_links(csv, max, base_url) { +if (!base_url) base_url = ''; +var tags = csv.split(/\,\s*/); +var append = ''; +if (max && (tags.length > max)) { +tags.length = max; +append = '...'; +} +var html = ''; +for (var idx = 0, len = tags.length; idx < len; idx++) { +html += ''+tags[idx]+''; +if (idx < len - 1) html += ', '; +} +html += append; +return html; +} +function get_url_friendly_title(title) { +title = title.toString().replace(/\W+/g, '_'); +if (title.length > 40) title = title.substring(0, 40); +title = title.replace(/^_+/, ''); +title = title.replace(/_+$/, ''); +return title; +} +function get_full_url(url) { +if (url.match(/^\#/)) { +var parts = window.location.href.split(/\#/); +url = parts[0] + url; +} +return url; +} +var Comments = { +comments_per_page: 10, +get: function(page_id) { +var html = ''; +html += '
'; +html += '
Comments'; +html += '
'; +html += '
'; +html += '
'; +setTimeout( function() { Comments.search({ page_id: page_id }); }, 1 ); +return html; +}, +search: function(args) { +if (!args.limit) args.limit = this.comments_per_page; +if (!args.offset) args.offset = 0; +assert(args.page_id, "Comments.search: No page_id specified"); +args.format = 'xml'; +this.last_search = args; +effect_api_get( 'comments_get', args, [this, 'search_response'], { _search_args: args } ); +}, +research: function(offset) { +var args = this.last_search; +if (!args) return; +args.offset = offset; +effect_api_get( 'comments_get', args, [this, 'search_response'], { _search_args: args } ); +}, +search_response: function(response, tx) { +this.comments = []; +var args = tx._search_args; +if (args.callback) return fire_callback(args.callback, response, args); +var html = ''; +html += '
' + +large_icon_button( 'comment_edit.png', 'Post Comment...', "Comments.add('"+args.page_id+"')" ) + '
'; +if (args.page_id.match(/^Article\//)) { +html += '
' + icon('feed.png', 'RSS', '/effect/api/comment_feed/' + args.page_id + '.rss', 'Comments RSS Feed') + '
'; +} +if (response.Items && response.Items.Item && response.List && response.List.length) { +html += ''; +html += '
'; +var items = this.comments = always_array( response.Items.Item ); +for (var idx = 0, len = items.length; idx < len; idx++) { +var item = items[idx]; +var extra_classes = (args.highlight && (args.highlight == item.ID)) ? ' highlight' : ''; +html += '
'; +html += '
'; +if (item.Username) html += ''; +html += '' + item.Name.toString().toUpperCase() + ''; +if (item.Username) html += ''; +html += ', ' + get_short_date_time(item.Date) + '
'; +html += '
'; +html += this.get_comment_controls( args.page_id, item ); +html += '
'; +html += '
'; +html += '
' + item.Comment + '
'; +html += '
'; +html += ''; +if (item.LastReply && ((item.LastReply >= time_now() - (86400 * 7)) || (session.username && (session.username == item.Username)))) { +setTimeout( "Comments.show_replies('"+args.page_id+"','"+item.ID+"')", 1 ); +} +} +} +else { +} +$( 'd_comments_' + args.page_id ).innerHTML = html; +}, +get_control: function(icon, code, text, status_text) { +if (!icon.match(/\.\w+$/)) icon += '.gif'; +return '' + code_link(code, text, status_text) + ''; +}, +get_comment_controls: function(page_id, comment) { +var html = ''; +var spacer_txt = '  |  '; +if (session.user) { +html += this.get_control('comment', "Comments.reply('"+page_id+"','"+comment.ID+"')", 'Reply') + spacer_txt; +} +if (comment.Replies) { +if (comment._replies_visible) html += this.get_control('magnify_minus', "Comments.hide_replies('"+page_id+"','"+comment.ID+"')", 'Hide Replies'); +else html += this.get_control('magnify_plus', "Comments.show_replies('"+page_id+"','"+comment.ID+"')", 'Show Replies ('+comment.Replies+')'); +if (session.user) html += spacer_txt; +} +if (session.user) { +html += this.get_control( +'star', +"Comments.like('"+page_id+"','"+comment.ID+"')", +'Like' + (comment.Like ? (' ('+comment.Like+')') : ''), +comment.Like ? (comment.Like + ' ' + ((comment.Like == 1) ? 'person likes this' : 'people like this')) : 'I like this comment' +) + spacer_txt; +if (is_admin()) html += this.get_control('trash', "Comments._delete('"+page_id+"','"+comment.ID+"')", 'Delete') + spacer_txt; +html += this.get_control('warning', "Comments.report('"+page_id+"','"+comment.ID+"')", 'Report Abuse'); +} +return html; +}, +reply: function(page_id, comment_id) { +hide_popup_dialog(); +delete session.progress; +var comment = find_object( this.comments, { ID: comment_id } ); +var html = ''; +html += '
'; +html += '\n \n \n \n'); + }; + __out.push('\n\n'); + __out.push(require('templates/clients/modules/sub_header').call(this, { + heading: t("Ride Request") + })); + __out.push('\n\n\n
\n
\n
\n
\n \n \n \n \n
\n\n
'; +html += '
Reply to Comment by "'+comment.Name+'"
'; +html += '
'; +var name = this.get_name(); +html += '

Posted by: ' + name; +if (!session.user) html += ' → Create Account'; +html += '


'; +html += ''; +html += Blog.edit_caption; +html += '
'; +html += '

'; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + ' ' + large_icon_button('check', 'Post Reply', "Comments.post_reply('"+page_id+"','"+comment_id+"')") + '
'; +html += '
'; +html += ''; +session.hooks.keys[ESC_KEY] = 'hide_popup_dialog'; +safe_focus( 'fe_comment_body' ); +show_popup_dialog(600, 300, html); +}, +post_reply: function(page_id, comment_id) { +var value = $('fe_comment_body').value; +if (!value) return; +hide_popup_dialog(); +show_progress_dialog(1, "Posting reply..."); +var name = this.get_name(); +effect_api_mod_touch('comment_replies_get'); +effect_api_send('comment_post_reply', { +PageID: page_id, +CommentID: comment_id, +Username: session.username || '', +Name: name, +Comment: value, +PageURL: location.href +}, [this, 'post_reply_finish'], { _page_id: page_id, _comment_id: comment_id } ); +}, +post_reply_finish: function(response, tx) { +hide_popup_dialog(); +var page_id = tx._page_id; +var comment_id = tx._comment_id; +var comment = find_object( this.comments, { ID: comment_id } ); +do_message('success', "Comment reply posted successfully."); +this.show_replies(page_id, comment_id); +if (!comment.Replies) comment.Replies = 1; else comment.Replies++; +$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment ); +}, +show_replies: function(page_id, comment_id) { +var comment = find_object( this.comments, { ID: comment_id } ); +if (!comment._replies_visible) { +$('d_comment_replies_' + comment_id).show().innerHTML = ''; +} +var args = { page_id: page_id, comment_id: comment_id, offset: 0, limit: 100 }; +effect_api_get( 'comment_replies_get', args, [this, 'receive_replies_response'], { _search_args: args } ); +}, +receive_replies_response: function(response, tx) { +var page_id = tx._search_args.page_id; +var comment_id = tx._search_args.comment_id; +var comment = find_object( this.comments, { ID: comment_id } ); +var html = ''; +var replies = always_array( response.Items.Item ); +for (var idx = 0, len = replies.length; idx < len; idx++) { +var reply = replies[idx]; +html += get_chat_balloon( +(reply.Username == session.username) ? 'blue' : 'grey', +reply.Username, +reply.Comment.replace(/^]*?>(.+)<\/div>$/i, '$1') +); +} +$('d_comment_replies_' + comment_id).innerHTML = html; +if (!comment._replies_visible) { +$('d_comment_replies_' + comment_id).hide(); +animate_div_visibility( 'd_comment_replies_' + comment_id, true ); +} +comment._replies_visible = true; +$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment ); +}, +hide_replies: function(page_id, comment_id) { +var comment = find_object( this.comments, { ID: comment_id } ); +if (comment._replies_visible) { +animate_div_visibility( 'd_comment_replies_' + comment_id, false ); +comment._replies_visible = false; +$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment ); +} +}, +like: function(page_id, comment_id) { +effect_api_mod_touch('comments_get'); +effect_api_send('comment_like', { +PageID: page_id, +CommentID: comment_id +}, [this, 'like_finish'], { _page_id: page_id, _comment_id: comment_id, _on_error: [this, 'like_error'] } ); +}, +like_error: function(response, tx) { +if (response.Code == 'comment_already_like') do_message('error', "You already like this comment."); +else do_error( response.Description ); +}, +like_finish: function(resopnse, tx) { +var page_id = tx._page_id; +var comment_id = tx._comment_id; +var comment = find_object( this.comments, { ID: comment_id } ); +do_message('success', "You now like this comment."); +if (!comment.Like) comment.Like = 1; else comment.Like++; +$('d_comment_controls_'+comment_id).innerHTML = this.get_comment_controls( page_id, comment ); +}, +add: function(page_id) { +hide_popup_dialog(); +delete session.progress; +var html = ''; +html += '
'; +html += '\n \n \n \n \n \n \n \n \n \n '); + }, this); + __out.push('\n\n
\n
'; +html += '
Post New Comment
'; +html += '
'; +var name = this.get_name(); +html += '

Posted by: ' + name; +if (!session.user) html += ' → Create Account'; +html += '


'; +html += ''; +html += Blog.edit_caption; +html += '
'; +html += '

'; +html += ''; +html += ''; +html += ''; +html += '
' + large_icon_button('x', 'Cancel', "hide_popup_dialog()") + ' ' + large_icon_button('check', 'Post Comment', "Comments.post('"+page_id+"')") + '
'; +html += '
'; +html += ''; +session.hooks.keys[ESC_KEY] = 'hide_popup_dialog'; +safe_focus( 'fe_comment_body' ); +show_popup_dialog(600, 300, html); +}, +report: function(page_id, comment_id) { +if (confirm('Are you sure you want to report this comment to the site administrators as abusive and/or spam?')) { +effect_api_send('comment_report_abuse', { +PageID: page_id, +CommentID: comment_id +}, [this, 'report_finish'], { _page_id: page_id, _comment_id: comment_id } ); +} +}, +report_finish: function(response, tx) { +do_message('success', 'Your abuse report has been received, and will be evaluated by the site administrators.'); +}, +_delete: function(page_id, comment_id) { +if (confirm('Are you sure you want to permanently delete this comment?')) { +effect_api_mod_touch('comments_get'); +effect_api_send('comment_delete', { +PageID: page_id, +CommentID: comment_id +}, [this, 'delete_finish'], { _page_id: page_id, _comment_id: comment_id } ); +} +}, +delete_finish: function(response, tx) { +do_message('success', 'The comment was deleted successfully.'); +var page_id = tx._page_id; +this.search({ page_id: page_id }); +}, +get_name: function() { +var name = '(Anonymous)'; +if (session.user) { +if (get_bool_pref('public_profile')) name = session.user.FullName; +else name = session.username; +} +return name; +}, +post: function(page_id) { +var value = $('fe_comment_body').value; +if (!value) return; +hide_popup_dialog(); +show_progress_dialog(1, "Posting comment..."); +var name = this.get_name(); +effect_api_mod_touch('comments_get'); +effect_api_send('comment_post', { +PageID: page_id, +Username: session.username || '', +Name: name, +Comment: value +}, [this, 'post_finish'], { _page_id: page_id } ); +}, +post_finish: function(response, tx) { +hide_popup_dialog(); +var comment_id = response.CommentID; +var page_id = tx._page_id; +this.search({ page_id: page_id, highlight: comment_id }); +} +}; +Class.create( 'Menu', { +id: '', +menu: null, +__construct: function(id) { +this.id = id; +}, +load: function() { +if (!this.menu) { +this.menu = $(this.id); +assert( !!this.menu, "Could not locate DOM element: " + this.id ); +} +}, +get_value: function() { +this.load(); +return this.menu.options[this.menu.selectedIndex].value; +}, +set_value: function(value, auto_add) { +value = str_value(value); +this.load(); +for (var idx = 0, len = this.menu.options.length; idx < len; idx++) { +if (this.menu.options[idx].value == value) { +this.menu.selectedIndex = idx; +return true; +} +} +if (auto_add) { +this.menu.options[this.menu.options.length] = new Option(value, value); +this.menu.selectedIndex = this.menu.options.length - 1; +return true; +} +return false; +}, +disable: function() { +this.load(); +this.menu.disabled = true; +this.menu.setAttribute( 'disabled', 'disabled' ); +}, +enable: function() { +this.load(); +this.menu.setAttribute( 'disabled', '' ); +this.menu.disabled = false; +}, +populate: function(items, sel_value) { +this.load(); +this.menu.options.length = 0; +for (var idx = 0, len = items.length; idx < len; idx++) { +var item = items[idx]; +var item_name = ''; +var item_value = ''; +if (isa_hash(item)) { +item_name = item.label; +item_value = item.data; +} +else if (isa_array(item)) { +item_name = item[0]; +item_value = item[1]; +} +else { +item_name = item_value = item; +} +this.menu.options[ this.menu.options.length ] = new Option( item_name, item_value ); +if (item_value == sel_value) this.menu.selectedIndex = idx; +} +} +} ); +Class.subclass( Menu, 'MultiMenu', { +__static: { +toggle_type: function(id) { +var menu = $(id); +assert(menu, "Could not find menu in DOM: " + id); +if (menu.disabled) return; +var obj = MenuManager.find(id); +assert(obj, "Could not find menu in MenuManager: " + id); +var div = $( 'd_inner_' + id ); +var ic = $( 'ic_' + id ); +var is_multiple = (ic.src.indexOf('contract') > -1); +obj.multi = !is_multiple; +var multiple_tag = !is_multiple ? +' multiple="multiple" size=5' : ''; +var items = []; +for (var idx = 0; idx < menu.options.length; idx++) { +var option = menu.options[idx]; +array_push( items, { +value: option.value, +text: option.text, +selected: option.selected +}); +} +var html = ''; +html += ''; +div.innerHTML = html; +ic.src = images_uri + '/menu_' + (is_multiple ? 'expand' : 'contract') + '.gif'; +obj.menu = null; +} +}, +attribs: null, +multi: false, +toggle: true, +__construct: function(id, attribs) { +this.id = id; +if (attribs) this.attribs = attribs; +}, +get_html: function(items, selected_csv, attribs) { +if (!items) items = []; +if (!selected_csv) selected_csv = ''; +if (attribs) this.attribs = attribs; +var selected = csv_to_hash(selected_csv); +this.menu = null; +if (num_keys(selected) > 1) this.multi = true; +var html = '
'; +html += ''; +html += ''; +html += ''; +if (this.toggle) html += ''; +html += '
' + spacer(1,1) + '
'+spacer(1,2)+'
'; +html += '
'; +return html; +}, +get_value: function() { +this.load(); +var value = ''; +for (var idx = 0; idx < this.menu.options.length; idx++) { +var option = this.menu.options[idx]; +if (option.selected && option.value.length) { +if (value.length > 0) value += ','; +value += option.value; +} +} +return value; +}, +set_value: function(value, auto_add) { +value = '' + value; +this.load(); +if (!value) { +value = ''; +for (var idx = 0; idx < this.menu.options.length; idx++) { +var option = this.menu.options[idx]; +option.selected = (option.value == value); +} +return; +} +var selected = csv_to_hash(value); +if ((num_keys(selected) > 1) && !this.multi) { +MultiMenu.toggle_type(this.id); +var self = this; +setTimeout( function() { +self.set_value(value, auto_add); +}, 1 ); +return; +} +for (var idx = 0; idx < this.menu.options.length; idx++) { +var option = this.menu.options[idx]; +option.selected = selected[option.value] ? true : false; +} +}, +populate: function(items, value) { +this.load(); +this.menu.options.length = 0; +if (!value) value = ''; +var selected = csv_to_hash(value); +for (var idx = 0, len = items.length; idx < len; idx++) { +var item = items[idx]; +var item_name = ''; +var item_value = ''; +if (isa_hash(item)) { +item_name = item.label; +item_value = item.data; +} +else if (isa_array(item)) { +item_name = item[0]; +item_value = item[1]; +} +else { +item_name = item_value = item; +} +var opt = new Option( item_name, item_value ); +this.menu.options[ this.menu.options.length ] = opt; +opt.selected = selected[item_value] ? true : false; +} +}, +collapse: function() { +if (this.multi) MultiMenu.toggle_type(this.id); +}, +expand: function() { +if (!this.multi) MultiMenu.toggle_type(this.id); +} +} ); +Class.create( 'MenuManager', { +__static: { +menus: {}, +register: function(menu) { +this.menus[ menu.id ] = menu; +return menu; +}, +find: function(id) { +return this.menus[id]; +} +} +} ); +Class.create( 'GrowlManager', { +lifetime: 10, +marginRight: 0, +marginTop: 0, +__construct: function() { +this.growls = []; +}, +growl: function(type, msg) { +if (find_object(this.growls, { type: type, msg: msg })) return; +var div = $(document.createElement('div')); +div.className = 'growl_message ' + type; +div.setOpacity(0.0); +div.innerHTML = '
' + msg + '
' + spacer(1,5) + '
'; +$('d_growl_wrapper').insertBefore( div, $('d_growl_top').nextSibling ); +var growl = { id:get_unique_id(), type: type, msg: msg, opacity:0.0, start:hires_time_now(), div:div }; +this.growls.push(growl); +this.handle_resize(); +this.animate(growl); +var self = this; +div.onclick = function() { +delete_object(self.growls, { id: growl.id }); +$('d_growl_wrapper').removeChild( div ); +}; +}, +animate: function(growl) { +if (growl.deleted) return; +var now = hires_time_now(); +var div = growl.div; +if (now - growl.start <= 0.5) { +div.setOpacity( tweenFrame(0.0, 1.0, (now - growl.start) * 2, 'EaseOut', 'Quadratic') ); +} +else if (now - growl.start <= this.lifetime) { +if (!growl._fully_opaque) { +div.setOpacity( 1.0 ); +growl._fully_opaque = true; +} +} +else if (now - growl.start <= this.lifetime + 1.0) { +div.setOpacity( tweenFrame(1.0, 0.0, (now - growl.start) - this.lifetime, 'EaseOut', 'Quadratic') ); +} +else { +delete_object(this.growls, { id: growl.id }); +$('d_growl_wrapper').removeChild( div ); +return; +} +var self = this; +setTimeout( function() { self.animate(growl); }, 33 ); +}, +handle_resize: function() { +var div = $('d_growl_wrapper'); +if (this.growls.length) { +var size = getInnerWindowSize(); +div.style.top = '' + (10 + this.marginTop) + 'px'; +div.style.left = '' + Math.floor((size.width - 310) - this.marginRight) + 'px'; +} +else { +div.style.left = '-2000px'; +} +} +} ); +window.$GR = new GrowlManager(); +if (window.addEventListener) { +window.addEventListener( "resize", function() { +$GR.handle_resize(); +}, false ); +} +else if (window.attachEvent && !ie6) { +window.attachEvent("onresize", function() { +$GR.handle_resize(); +}); +} +Class.create( 'Effect.Page', { +ID: '', +data: null, +active: false, +__construct: function(config) { +if (!config) return; +this.data = {}; +if (!config) config = {}; +for (var key in config) this[key] = config[key]; +this.div = $('page_' + this.ID); +assert(this.div, "Cannot find page div: page_" + this.ID); +}, +onInit: function() { +}, +onActivate: function() { +return true; +}, +onDeactivate: function() { +return true; +}, +show: function() { +this.div.show(); +}, +hide: function() { +this.div.hide(); +}, +gosub: function(anchor) { +} +} ); +Class.require( 'Effect.Page' ); +Class.create( 'Effect.PageManager', { +pages: null, +current_page_id: '', +on_demand: {}, +__construct: function(page_list) { +this.pages = []; +this.page_list = page_list; +for (var idx = 0, len = page_list.length; idx < len; idx++) { +Debug.trace( 'page', "Initializing page: " + page_list[idx].ID ); +if (Effect.Page[ page_list[idx].ID ]) { +var page = new Effect.Page[ page_list[idx].ID ]( page_list[idx] ); +page.onInit(); +this.pages.push(page); +} +else { +Debug.trace( 'page', 'Page ' + page_list[idx].ID + ' will be loaded on-demand' ); +} +} +}, +find: function(id) { +var page = find_object( this.pages, { ID: id } ); +if (!page) Debug.trace('PageManager', "Could not find page: " + id); +return page; +}, +notify_load: function(file, id) { +for (var idx = 0, len = this.page_list.length; idx < len; idx++) { +var page_config = this.page_list[idx]; +if (page_config.File == file) { +Debug.trace( 'page', "Initializing page on-demand: " + page_config.ID ); +var page = new Effect.Page[ page_config.ID ]( page_config ); +page.onInit(); +this.pages.push(page); +} +} +var self = this; +setTimeout( function() { +var result = self.activate(id, self.temp_args); +delete self.temp_args; +$('d_page_loading').hide(); +if (!result) { +$('page_'+id).hide(); +self.current_page_id = ''; +} +}, 1 ); +}, +activate: function(id, args) { +if (!find_object( this.pages, { ID: id } )) { +var page_config = find_object( this.page_list, { ID: id } ); +assert(!!page_config, "Page config not found: " + id ); +Debug.trace('page', "Loading file on-demand: " + page_config.File + " for page: " + id); +var url = '/effect/api/load_page/' + page_config.File + '?onafter=' + escape('page_manager.notify_load(\''+page_config.File+'\',\''+id+'\')'); +if (page_config.Requires) { +var files = page_config.Requires.split(/\,\s*/); +for (var idx = 0, len = files.length; idx < len; idx++) { +var filename = files[idx]; +if (!this.on_demand[filename]) { +Debug.trace('page', "Also loading file: " + filename); +url += '&file=' + filename; +this.on_demand[filename] = 1; +} +} +} +$('d_page_loading').show(); +this.temp_args = args; +load_script( url ); +return true; +} +$('page_'+id).show(); +var page = this.find(id); +page.active = true; +if (!args) args = []; +if (!isa_array(args)) args = [ args ]; +var result = page.onActivate.apply(page, args); +if (typeof(result) == 'boolean') return result; +else return alert("Page " + id + " onActivate did not return a boolean!"); +}, +deactivate: function(id, new_id) { +var page = this.find(id); +var result = page.onDeactivate(new_id); +if (result) { +$('page_'+id).hide(); +page.active = false; +} +return result; +}, +click: function(id, args) { +Debug.trace('page', "Switching pages to: " + id); +var old_id = this.current_page_id; +if (this.current_page_id) { +var result = this.deactivate( this.current_page_id, id ); +if (!result) return false; +} +this.current_page_id = id; +this.old_page_id = old_id; +window.scrollTo( 0, 0 ); +var result = this.activate(id, args); +if (!result) { +$('page_'+id).hide(); +this.current_page_id = ''; +} +return true; +} +} ); +Class.subclass( Effect.Page, "Effect.Page.Main", { +inited: false, +onActivate: function() { +Nav.bar( ['Main', 'EffectGames.com'] ); +Nav.title(''); +$('d_blog_news').innerHTML = loading_image(); +$('d_blog_community').innerHTML = loading_image(); +$('d_blog_featured').innerHTML = loading_image(); +Blog.search({ +stag: 'featured_game', +limit: 4, +full: 1, +callback: [this, 'receive_featured_games'] +}); +effect_api_get( 'get_site_info', { cat: 'pop_pub_games' }, [this, 'receive_pop_pub_games'], { } ); +Blog.search({ +stag: 'front_page', +limit: 5, +target: 'd_blog_news', +more: 1 +}); +Blog.search({ +path: '/community', +limit: 5, +target: 'd_blog_community', +more: 1 +}); +if (!this.inited) { +this.inited = true; +config.Strings.MainSlideshow.Slide = always_array( config.Strings.MainSlideshow.Slide ); +this.slide_idx = 0; +this.num_slides = config.Strings.MainSlideshow.Slide.length; +this.slide_div_num = 0; +this.slide_dir = 1; +this.bk_pos = -340; +this.bk_pos_target = -340; +this.slide_images = []; +for (var idx = 0, len = this.num_slides; idx < len; idx++) { +var url = images_uri + '/' + config.Strings.MainSlideshow.Slide[idx].Photo; +this.slide_images[idx] = new Image(); +this.slide_images[idx].src = png(url, true); +} +} +this.height_target = 470; +this.height_start = $('d_header').offsetHeight; +this.time_start = hires_time_now(); +this.duration = 0.75; +if (!this.timer) this.timer = setTimeout( '$P("Main").animate_mhs()', 33 ); +if (session.user) $('d_blurb_main').hide(); +else { +$('d_blurb_main').innerHTML = get_string('/Main/Blurb'); +$('d_blurb_main').show(); +} +return true; +}, +receive_pop_pub_games: function(response, tx) { +var html = ''; +if (response.Data && response.Data.Games && response.Data.Games.Game) { +var games = always_array( response.Data.Games.Game ); +for (var idx = 0, len = Math.min(games.length, 16); idx < len; idx++) { +var game = games[idx]; +html += '
' + +(game.Logo ? +user_image_thumbnail(game.Logo, 80, 60) : +'' +) + '
' + ww_fit_box(game.Title, 80, 2, session.em_width, 1) + '
'; +} +html += '
'; +} +else { +html += 'No active public games found! Why not create a new one?'; +} +$('d_main_pop_pub_games').innerHTML = html; +}, +receive_featured_games: function(response, tx) { +var html = ''; +if (response.Rows && response.Rows.Row) { +html += ''; +var rows = always_array( response.Rows.Row ); +for (var idx = 0, len = rows.length; idx < len; idx++) { +var row = rows[idx]; +var image_url = row.Params.featured_image; +if (image_url && image_url.match(/^(\w+)\/(\w+\.\w+)$/)) { +image_url = '/effect/api/view/users/' + RegExp.$1 + '/images/' + RegExp.$2; +} +if (idx % 2 == 0) html += ''; +html += ''; +if (idx % 2 == 1) html += ''; +} +if (rows.length % 2 == 1) { +html += ''; +html += ''; +} +html += '
'; +html += ''; +html += ''; +html += ''; +html += ''; +html += ''; +html += '
'; +html += ''; +html += '' + spacer(10,1) + ''; +html += ''; +html += ''; +html += '' + spacer(15,1) + '
'; +html += spacer(1,20); +html += '
'; +} +$('d_blog_featured').innerHTML = html; +}, +animate_mhs: function() { +var now = hires_time_now(); +if (now - this.time_start >= this.duration) { +$('d_header').style.height = '' + this.height_target + 'px'; +$('d_shadow').style.height = '' + this.height_target + 'px'; +delete this.timer; +} +else { +var height = tweenFrame(this.height_start, this.height_target, (now - this.time_start) / this.duration, 'EaseOut', 'Circular'); +$('d_header').style.height = '' + height + 'px'; +$('d_shadow').style.height = '' + height + 'px'; +this.timer = setTimeout( '$P("Main").animate_mhs()', 33 ); +} +}, +onDeactivate: function() { +$('d_blog_news').innerHTML = ''; +$('d_blog_community').innerHTML = ''; +this.height_target = 75; +this.height_start = $('d_header').offsetHeight; +this.time_start = hires_time_now(); +if (!this.timer) this.timer = setTimeout( '$P("Main").animate_mhs()', 33 ); +return true; +}, +draw_slide: function() { +if (this.slide_timer) return; +var slide = config.Strings.MainSlideshow.Slide[ this.slide_idx ]; +this.old_photo = $('d_header_slideshow_photo_' + this.slide_div_num); +this.old_text = $('d_header_slideshow_text_' + this.slide_div_num); +this.slide_div_num = 1 - this.slide_div_num; +this.new_photo = $('d_header_slideshow_photo_' + this.slide_div_num); +this.new_text = $('d_header_slideshow_text_' + this.slide_div_num); +this.new_photo.style.backgroundImage = 'url('+png(images_uri+'/'+slide.Photo, true)+')'; +this.new_photo.setOpacity(0.0); +var html = ''; +html += slide.Text; +this.slide_width = this.new_text.offsetWidth; +this.new_text.innerHTML = html; +if (this.slide_dir == 1) this.new_text.style.left = '' + this.slide_width + 'px'; +else this.new_text.style.left = '-' + this.slide_width + 'px'; +this.slide_time_start = hires_time_now(); +this.slide_timer = setTimeout( '$P("Main").animate_mhs_slide()', 33 ); +}, +animate_mhs_slide: function() { +var now = hires_time_now(); +if (now - this.slide_time_start >= this.duration) { +this.new_text.style.left = '0px'; +this.old_text.style.left = '-' + this.slide_width + 'px'; +this.new_photo.setOpacity( 1.0 ); +this.old_photo.setOpacity( 0.0 ); +delete this.slide_timer; +this.bk_pos = this.bk_pos_target; +} +else { +var value = tweenFrame(0.0, 1.0, (now - this.slide_time_start) / this.duration, 'EaseOut', 'Circular'); +if (this.slide_dir == 1) { +this.new_text.style.left = '' + Math.floor( this.slide_width - (this.slide_width * value) ) + 'px'; +this.old_text.style.left = '-' + Math.floor( this.slide_width * value ) + 'px'; +} +else { +this.new_text.style.left = '-' + Math.floor( this.slide_width - (this.slide_width * value) ) + 'px'; +this.old_text.style.left = '' + Math.floor( this.slide_width * value ) + 'px'; +} +this.new_photo.setOpacity( value ); +this.old_photo.setOpacity( 1.0 - value ); +var bkp = Math.floor( this.bk_pos + ((this.bk_pos_target - this.bk_pos) * value) ); +$('d_header').style.backgroundPosition = '' + bkp + 'px 0px'; +this.slide_timer = setTimeout( '$P("Main").animate_mhs_slide()', 33 ); +} +}, +prev_slide: function() { +this.bk_pos_target += 200; +this.slide_idx--; +if (this.slide_idx < 0) this.slide_idx += this.num_slides; +this.slide_dir = -1; +this.draw_slide(); +}, +next_slide: function() { +this.bk_pos_target -= 200; +this.slide_idx++; +if (this.slide_idx >= this.num_slides) this.slide_idx -= this.num_slides; +this.slide_dir = 1; +this.draw_slide(); +} +} ); +Class.subclass( Effect.Page, "Effect.Page.PublicGameList", { +onActivate: function() { +Nav.bar( +['Main', 'EffectGames.com'], +['PublicGameList', "All Public Games"] +); +Nav.title( "List of All Public Game Projects" ); +effect_api_get( 'get_site_info', { cat: 'all_pub_games' }, [this, 'receive_all_pub_games'], { } ); +this.div.innerHTML = loading_image(); +return true; +}, +onDeactivate: function() { +this.div.innerHTML = ''; +return true; +}, +receive_all_pub_games: function(response, tx) { +var html = ''; +html += '

List of All Public Game Projects

'; +html += '
This is the complete list of public games currently being built by our users, presented in alphabetical order. Maybe they could use some help! Check out the game project pages and see (requires user account).
'; +if (response.Data && response.Data.Games && response.Data.Games.Game) { +var games = always_array( response.Data.Games.Game ); +for (var idx = 0, len = games.length; idx < len; idx++) { +var game = games[idx]; +html += '
' + +(game.Logo ? +user_image_thumbnail(game.Logo, 80, 60) : +'' +) + '
' + ww_fit_box(game.Title, 80, 2, session.em_width, 1) + '
'; +} +html += '
'; +} +else { +html += 'No public games found! Why not create a new one?'; +} +this.div.innerHTML = html; +} +} ); +Class.subclass( Effect.Page, "Effect.Page.Search", { +onActivate: function(args) { +if (!args) args = {}; +var search_text = args.q; +var start = args.s || 0; +if (!start) start = 0; +var title = 'Search results for "'+search_text+'"'; +Nav.bar( +['Main', 'EffectGames.com'], +['Search?q=' + escape(search_text), "Search Results"] +); +Nav.title( title ); +this.last_search_text = search_text; +$('d_article_search').innerHTML = loading_image(); +load_script( 'http://www.google.com/uds/GwebSearch?callback=receive_google_search_results&context=0&lstkp=0&rsz=large&hl=en&source=gsc&gss=.com&sig=&q='+escape(search_text)+'%20site%3Ahttp%3A%2F%2Fwww.effectgames.com%2F&key=notsupplied&v=1.0&start='+start+'&nocache=' + (new Date()).getTime() ); +$('h_article_search').innerHTML = title; +return true; +}, +onDeactivate: function(new_page) { +$('fe_search_bar').value = ''; +$('d_article_search').innerHTML = ''; +return true; +} +} ); +function do_search_bar() { +var search_text = $('fe_search_bar').value; +if (search_text.length) { +Nav.go('Search?q=' + escape(search_text)); +} +} +function receive_google_search_results(context, response) { +var html = ''; +html += '
Powered by
'; +if (response.results.length) { +for (var idx = 0, len = response.results.length; idx < len; idx++) { +var row = response.results[idx]; +var url = row.unescapedUrl.replace(/^.+article\.psp\.html/, '#Article'); +html += '
'; +html += ''; +html += '
' + row.content + '
'; +html += '
'; +} +} +else { +html += 'No results found.'; +} +if (response.cursor.pages) { +html += '
Page: '; +for (var idx = 0, len = response.cursor.pages.length; idx < len; idx++) { +html += ''; +var page = response.cursor.pages[idx]; +var url = '#Search?q=' + escape($P('Search').last_search_text) + '&s=' + page.start; +if (response.cursor.currentPageIndex != idx) html += ''; +else html += ''; +html += page.label; +if (response.cursor.currentPageIndex != idx) html += ''; +else html += ''; +html += ''; +} +html += '
'; +} +$('d_article_search').innerHTML = html; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/index.js new file mode 100644 index 00000000..8b164a42 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/index.js @@ -0,0 +1 @@ +exports.ZeParser = require('./ZeParser').ZeParser; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/package.json new file mode 100644 index 00000000..b42447d2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/package.json @@ -0,0 +1,51 @@ +{ + "author": { + "name": "Peter van der Zee", + "url": "http://qfox.nl/" + }, + "name": "zeparser", + "description": "My JavaScript parser", + "version": "0.0.5", + "homepage": "https://github.com/qfox/ZeParser/", + "repository": { + "type": "git", + "url": "git://github.com/qfox/ZeParser.git" + }, + "main": "./index", + "engines": { + "node": "*" + }, + "dependencies": {}, + "devDependencies": {}, + "_npmUser": { + "name": "evilhackerdude", + "email": "evilhackerdude@gmail.com" + }, + "_id": "zeparser@0.0.5", + "_engineSupported": true, + "_npmVersion": "1.0.105", + "_nodeVersion": "v0.6.5", + "_defaultsLoaded": true, + "dist": { + "shasum": "03726561bc268f2e5444f54c665b7fd4a8c029e2", + "tarball": "http://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz" + }, + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + }, + { + "name": "evilhackerdude", + "email": "evilhackerdude@gmail.com" + } + ], + "directories": {}, + "_shasum": "03726561bc268f2e5444f54c665b7fd4a8c029e2", + "_resolved": "https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz", + "_from": "zeparser@0.0.5", + "bugs": { + "url": "https://github.com/qfox/ZeParser/issues" + }, + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/test-parser.html b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/test-parser.html new file mode 100755 index 00000000..1ff5ff43 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/test-parser.html @@ -0,0 +1,26 @@ + + + + Parser Test Suite Page + + + + (c) qfox.nl
+ Parser test suite
+
Running...
+ + + + + + + \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/test-tokenizer.html b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/test-tokenizer.html new file mode 100755 index 00000000..0e0d1b1a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/test-tokenizer.html @@ -0,0 +1,23 @@ + + + + Tokenizer Test Suite Page + + + + (c) qfox.nl
+ + + + + + \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/tests.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/tests.js new file mode 100644 index 00000000..8a4138be --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/active-x-obfuscator/node_modules/zeparser/tests.js @@ -0,0 +1,478 @@ +// tests for both the tokenizer and parser. Parser test results could be checked tighter. +// api: [input, token-output-count, ?regex-hints, desc] +// regex-hints are for tokenizer, will tell for each token whether it might parse regex or not (parser's job) +var Tests = [ + +["var abc;", 4, "Variable Declaration"], +["var abc = 5;", 8, "Variable Declaration, Assignment"], +["/* */", 1, "Block Comment"], +["/** **/", 1, "JSDoc-style Comment"], +["var f = function(){;};", 13, "Assignment, Function Expression"], +["hi; // moo", 4, "Trailing Line Comment"], +["hi; // moo\n;", 6, "Trailing Line Comment, Linefeed, `;`"], +["var varwithfunction;", 4, "Variable Declaration, Identifier Containing Reserved Words, `;`"], +["a + b;", 6, "Addition/Concatenation"], + +["'a'", 1, "Single-Quoted String"], +["'a';", 2, "Single-Quoted String, `;`"], // Taken from the parser test suite. + +["'a\\n'", 1, "Single-Quoted String With Escaped Linefeed"], +["'a\\n';", 2, "Single-Quoted String With Escaped Linefeed, `;`"], // Taken from the parser test suite. + +["\"a\"", 1, "Double-Quoted String"], +["\"a\";", 2, "Double-Quoted String, `;`"], // Taken from the parser test suite. + +["\"a\\n\"", 1, "Double-Quoted String With Escaped Linefeed"], +["\"a\\n\";", 2, "Double-Quoted String With Escaped Linefeed, `;`"], // Taken from the parser test suite. + +["500", 1, "Integer"], +["500;", 2, "Integer, `;`"], // Taken from the parser test suite. + +["500.", 1, "Double With Trailing Decimal Point"], +["500.;", 2, "Double With Trailing Decimal Point"], // Taken from the parser test suite. + +["500.432", 1, "Double With Decimal Component"], +["500.432;", 2, "Double With Decimal Component, `;`"], // Taken from the parser test suite. + +[".432432", 1, "Number, 0 < Double < 1"], +[".432432;", 2, "Number, 0 < Double < 1, `;`"], // Taken from the parser test suite. + +["(a,b,c)", 7, "Parentheses, Comma-separated identifiers"], +["(a,b,c);", 8, "Parentheses, Comma-separated identifiers, `;`"], // Taken from the parser test suite. + +["[1,2,abc]", 7, "Array literal"], +["[1,2,abc];", 8, "Array literal, `;`"], // Taken from the parser test suite. + +["{a:1,\"b\":2,c:c}", 13, "Object literal"], +["var o = {a:1,\"b\":2,c:c};", 20, "Assignment, Object Literal, `;`"], // Taken from the parser test suite. + +["var x;\nvar y;", 9, "2 Variable Declarations, Multiple lines"], +["var x;\nfunction n(){ }", 13, "Variable, Linefeed, Function Declaration"], +["var x;\nfunction n(abc){ }", 14, "Variable, Linefeed, Function Declaration With One Argument"], +["var x;\nfunction n(abc, def){ }", 17, "Variable, Linefeed, Function Declaration With Multiple Arguments"], +["function n(){ \"hello\"; }", 11, "Function Declaration, Body"], + +["/a/;", 2, [true, false], "RegExp Literal, `;`"], +["/a/b;", 2, [true, true], "RegExp Literal, Flags, `;`"], +["++x;", 3, "Unary Increment, Prefix, `;`"], +[" / /;", 3, [true, true, false], "RegExp, Leading Whitespace, `;`"], +["/ / / / /", 5, [true, false, false, false, true], "RegExp Containing One Space, Space, Division, Space, RegExp Containing One Space"], + +// Taken from the parser test suite. + +["\"var\";", 2, "Keyword String, `;`"], +["\"variable\";", 2, "String Beginning With Keyword, `;`"], +["\"somevariable\";", 2, "String Containing Keyword, `;`"], +["\"somevar\";", 2, "String Ending With Keyword, `;`"], + +["var varwithfunction;", 4, "Keywords should not be matched in identifiers"], + +["var o = {a:1};", 12, "Object Literal With Unquoted Property"], +["var o = {\"b\":2};", 12, "Object Literal With Quoted Property"], +["var o = {c:c};", 12, "Object Literal With Equivalent Property Name and Identifier"], + +["/a/ / /b/;", 6, [true, true, false, false, true, false], "RegExp, Division, RegExp, `;`"], +["a/b/c;", 6, "Triple Division (Identifier / Identifier / Identifier)"], + +["+function(){/regex/;};", 9, [false, false, false, false, false, true, false, false, false], "Unary `+` Operator, Function Expression Containing RegExp and Semicolon, `;`"], + +// Line Terminators. +["\r\n", 1, "CRLF Line Ending = 1 Linefeed"], +["\r", 1, "CR Line Ending = 1 Linefeed"], +["\n", 1, "LF Line Ending = 1 Linefeed"], +["\r\n\n\u2028\u2029\r", 5, "Various Line Terminators"], + +// Whitespace. +["a \t\u000b\u000c\u00a0\uFFFFb", 8, "Whitespace"], + +// Comments. +["//foo!@#^&$1234\nbar;", 4, "Line Comment, Linefeed, Identifier, `;`"], +["/* abcd!@#@$* { } && null*/;", 2, "Single-Line Block Comment, `;`"], +["/*foo\nbar*/;", 2, "Multi-Line Block Comment, `;`"], +["/*x*x*/;", 2, "Block Comment With Asterisks, `;`"], +["/**/;", 2, "Empty Comment, `;`"], + +// Identifiers. +["x;", 2, "Single-Character Identifier, `;`"], +["_x;", 2, "Identifier With Leading `_`, `;`"], +["xyz;", 2, "Identifier With Letters Only, `;`"], +["$x;", 2, "Identifier With Leading `$`, `;`"], +["x5;", 2, "Identifier With Number As Second Character, `;`"], +["x_y;", 2, "Identifier Containing `_`, `;`"], +["x+5;", 4, "Identifier, Binary `+` Operator, Identifier, `;`"], +["xyz123;", 2, "Alphanumeric Identifier, `;`"], +["x1y1z1;", 2, "Alternating Alphanumeric Identifier, `;`"], +["foo\\u00d8bar;", 2, "Identifier With Unicode Escape Sequence (`\\uXXXX`), `;`"], +["f\u00d8\u00d8bar;", 2, "Identifier With Embedded Unicode Character"], + +// Numbers. +["5;", 2, "Integer, `;`"], +["5.5;", 2, "Double, `;`"], +["0;", 2, "Integer Zero, `;`"], +["0.0;", 2, "Double Zero, `;`"], +["0.001;", 2, "0 < Decimalized Double < 1, `;`"], +["1.e2;", 2, "Integer With Decimal and Exponential Component (`e`), `;`"], +["1.e-2;", 2, "Integer With Decimal and Negative Exponential Component, `;`"], +["1.E2;", 2, "Integer With Decimal and Uppercase Exponential Component (`E`), `;`"], +["1.E-2;", 2, "Integer With Decimal and Uppercase Negative Exponential Component, `;`"], +[".5;", 2, "0 < Double < 1, `;`"], +[".5e3;", 2, "(0 < Double < 1) With Exponential Component"], +[".5e-3;", 2, "(0 < Double < 1) With Negative Exponential Component"], +["0.5e3;", 2, "(0 < Decimalized Double < 1) With Exponential Component"], +["55;", 2, "Two-Digit Integer, `;`"], +["123;", 2, "Three-Digit Integer, `;`"], +["55.55;", 2, "Two-Digit Double, `;`"], +["55.55e10;", 2, "Two-Digit Double With Exponential Component, `;`"], +["123.456;", 2, "Three-Digit Double, `;`"], +["1+e;", 4, "Additive Expression, `;`"], +["0x01;", 2, "Hexadecimal `1` With 1 Leading Zero, `;`"], +["0xcafe;", 2, "Hexadecimal `51966`, `;`"], +["0x12345678;", 2, "Hexadecimal `305419896`, `;`"], +["0x1234ABCD;", 2, "Hexadecimal `305441741` With Uppercase Letters, `;`"], +["0x0001;", 2, "Hexadecimal `1` with 3 Leading Zeros, `;`"], + +// Strings. +["\"foo\";", 2, "Multi-Character Double-Quoted String, `;`"], +["\"a\\n\";", 2, "Double-Quoted String Containing Linefeed, `;`"], +["\'foo\';", 2, "Single-Quoted String, `;`"], +["'a\\n';", 2, "Single-Quoted String Containing Linefeed, `;`"], +["\"x\";", 2, "Single-Character Double-Quoted String, `;`"], +["'';", 2, "Empty Single-Quoted String, `;`"], +["\"foo\\tbar\";", 2, "Double-Quoted String With Tab Character, `;`"], +["\"!@#$%^&*()_+{}[]\";", 2, "Double-Quoted String Containing Punctuators, `;`"], +["\"/*test*/\";", 2, "Double-Quoted String Containing Block Comment, `;`"], +["\"//test\";", 2, "Double-Quoted String Containing Line Comment, `;`"], +["\"\\\\\";", 2, "Double-Quoted String Containing Reverse Solidus, `;`"], +["\"\\u0001\";", 2, "Double-Quoted String Containing Numeric Unicode Escape Sequence, `;`"], +["\"\\uFEFF\";", 2, "Double-Quoted String Containing Alphanumeric Unicode Escape Sequence, `;`"], +["\"\\u10002\";", 2, "Double-Quoted String Containing 5-Digit Unicode Escape Sequence, `;`"], +["\"\\x55\";", 2, "Double-Quoted String Containing Hex Escape Sequence, `;`"], +["\"\\x55a\";", 2, "Double-Quoted String Containing Hex Escape Sequence and Additional Character, `;`"], +["\"a\\\\nb\";", 2, "Double-Quoted String Containing Escaped Linefeed, `;`"], +["\";\"", 1, "Double-Quoted String Containing `;`"], +["\"a\\\nb\";", 2, "Double-Quoted String Containing Reverse Solidus and Linefeed, `;`"], +["'\\\\'+ ''", 4, "Single-Quoted String Containing Reverse Solidus, `+`, Empty Single-Quoted String"], + +// `null`, `true`, and `false`. +["null;", 2, "`null`, `;`"], +["true;", 2, "`true`, `;`"], +["false;", 2, "`false`, `;`"], + +// RegExps +["/a/;", 2, [true, true], "Single-Character RegExp, `;`"], +["/abc/;", 2, [true, true], "Multi-Character RegExp, `;`"], +["/abc[a-z]*def/g;", 2, [true, true], "RegExp Containing Character Range and Quantifier, `;`"], +["/\\b/;", 2, [true, true], "RegExp Containing Control Character, `;`"], +["/[a-zA-Z]/;", 2, [true, true], "RegExp Containing Extended Character Range, `;`"], +["/foo(.*)/g;", 2, [true, false], "RegExp Containing Capturing Group and Quantifier, `;`"], + +// Array Literals. +["[];", 3, "Empty Array, `;`"], +["[\b\n\f\r\t\x20];", 9, "Array Containing Whitespace, `;`"], +["[1];", 4, "Array Containing 1 Element, `;`"], +["[1,2];", 6, "Array Containing 2 Elements, `;`"], +["[1,2,,];", 8, "Array Containing 2 Elisions, `;`"], +["[1,2,3];", 8, "Array Containing 3 Elements, `;`"], +["[1,2,3,,,];", 11, "Array Containing 3 Elisions, `;`"], + +// Object Literals. +["({x:5});", 8, "Object Literal Containing 1 Member; `;`"], +["({x:5,y:6});", 12, "Object Literal Containing 2 Members, `;`"], +["({x:5,});", 9, "Object Literal Containing 1 Member and Trailing Comma, `;`"], +["({if:5});", 8, "Object Literal Containing Reserved Word Property Name, `;`"], +["({ get x() {42;} });", 17, "Object Literal Containing Getter, `;`"], +["({ set y(a) {1;} });", 18, "Object Literal Containing Setter, `;`"], + +// Member Expressions. +["o.m;", 4, "Dot Member Accessor, `;`"], +["o['m'];", 5, "Square Bracket Member Accessor, `;`"], +["o['n']['m'];", 8, "Nested Square Bracket Member Accessor, `;`"], +["o.n.m;", 6, "Nested Dot Member Accessor, `;`"], +["o.if;", 4, "Dot Reserved Property Name Accessor, `;`"], + +// Function Calls. +["f();", 4, "Function Call Operator, `;`"], +["f(x);", 5, "Function Call Operator With 1 Argument, `;`"], +["f(x,y);", 7, "Function Call Operator With Multiple Arguments, `;`"], +["o.m();", 6, "Dot Member Accessor, Function Call, `;`"], +["o['m']();", 7, "Square Bracket Member Accessor, Function Call, `;`"], +["o.m(x);", 7, "Dot Member Accessor, Function Call With 1 Argument, `;`"], +["o['m'](x);", 8, "Square Bracket Member Accessor, Function Call With 1 Argument, `;`"], +["o.m(x,y);", 9, "Dot Member Accessor, Function Call With 2 Arguments, `;`"], +["o['m'](x,y);", 10, "Square Bracket Member Accessor, Function Call With 2 Arguments, `;`"], +["f(x)(y);", 8, "Nested Function Call With 1 Argument Each, `;`"], +["f().x;", 6, "Function Call, Dot Member Accessor, `;`"], + +// `eval` Function. +["eval('x');", 5, "`eval` Invocation With 1 Argument, `;`"], +["(eval)('x');", 7, "Direct `eval` Call Example, `;`"], +["(1,eval)('x');", 9, "Indirect `eval` Call Example, `;`"], +["eval(x,y);", 7, "`eval` Invocation With 2 Arguments, `;`"], + +// `new` Operator. +["new f();", 6, "`new` Operator, Function Call, `;`"], +["new o;", 4, "`new` Operator, Identifier, `;`"], +["new o.m;", 6, "`new` Operator, Dot Member Accessor, `;`"], +["new o.m(x);", 9, "`new` Operator, Dot Member Accessor, Function Call With 1 Argument, `;`"], +["new o.m(x,y);", 11, "``new` Operator, Dot Member Accessor, Function Call With 2 Arguments , `;`"], + +// Prefix and Postfix Increment. +["++x;", 3, "Prefix Increment, Identifier, `;`"], +["x++;", 3, "Identifier, Postfix Increment, `;`"], +["--x;", 3, "Prefix Decrement, Identifier, `;`"], +["x--;", 3, "Postfix Decrement, Identifier, `;`"], +["x ++;", 4, "Identifier, Space, Postfix Increment, `;`"], +["x /* comment */ ++;", 6, "Identifier, Block Comment, Postfix Increment, `;`"], +["++ /* comment */ x;", 6, "Prefix Increment, Block Comment, Identifier, `;`"], + +// Unary Operators. +["delete x;", 4, "`delete` Operator, Space, Identifier, `;`"], +["void x;", 4, "`void` Operator, Space, Identifier, `;`"], +["typeof x;", 4, "`typeof` Operator, Space, Identifier, `;`"], +["+x;", 3, "Unary `+` Operator, Identifier, `;`"], +["-x;", 3, "Unary Negation Operator, Identifier, `;`"], +["~x;", 3, "Bitwise NOT Operator, Identifier, `;`"], +["!x;", 3, "Logical NOT Operator, Identifier, `;`"], + +// Comma Operator. +["x, y;", 5, "Comma Operator"], + +// Miscellaneous. +["new Date++;", 5, "`new` Operator, Identifier, Postfix Increment, `;`"], +["+x++;", 4, "Unary `+`, Identifier, Postfix Increment, `;`"], + +// Expressions. +["1 * 2;", 6, "Integer, Multiplication, Integer, `;`"], +["1 / 2;", 6, "Integer, Division, Integer, `;`"], +["1 % 2;", 6, "Integer, Modulus, Integer, `;`"], +["1 + 2;", 6, "Integer, Addition, Integer, `;`"], +["1 - 2;", 6, "Integer, Subtraction, Integer, `;`"], +["1 << 2;", 6, "Integer, Bitwise Left Shift, Integer, `;`"], +["1 >>> 2;", 6, "Integer, Bitwise Zero-fill Right Shift, Integer, `;`"], +["1 >> 2;", 6, "Integer, Bitwise Sign-Propagating Right Shift, Integer, `;`"], +["1 * 2 + 3;", 10, "Order-of-Operations Expression, `;`"], +["(1+2)*3;", 8, "Parenthesized Additive Expression, Multiplication, `;`"], +["1*(2+3);", 8, "Multiplication, Parenthesized Additive Expression, `;`"], +["xy;", 4, "Greater-Than Relational Operator, `;`"], +["x<=y;", 4, "Less-Than-or-Equal-To Relational Operator, `;`"], +["x>=y;", 4, "Greater-Than-or-Equal-To Relational Operator, `;`"], +["x instanceof y;", 6, "`instanceof` Operator, `;`"], +["x in y;", 6, "`in` Operator, `;`"], +["x&y;", 4, "Bitwise AND Operator, `;`"], +["x^y;", 4, "Bitwise XOR Operator, `;`"], +["x|y;", 4, "Bitwise OR Operator, `;`"], +["x+y>>= y;", 6, "Bitwise Zero-Fill Right Shift Assignment, `;`"], +["x <<= y;", 6, "Bitwise Left Shift Assignment, `;`"], +["x += y;", 6, "Additive Assignment, `;`"], +["x -= y;", 6, "Subtractive Assignment, `;`"], +["x *= y;", 6, "Multiplicative Assignment, `;`"], +["x /= y;", 6, "Divisive Assignment, `;`"], +["x %= y;", 6, "Modulus Assignment, `;`"], +["x >>= y;", 6, "Bitwise Sign-Propagating Right Shift Assignment, `;`"], +["x &= y;", 6, "Bitwise AND Assignment, `;`"], +["x ^= y;", 6, "Bitwise XOR Assignment, `;`"], +["x |= y;", 6, "Bitwise OR Assignment, `;`"], + +// Blocks. +["{};", 3, "Empty Block, `;`"], +["{x;};", 5, "Block Containing 1 Identifier, `;`"], +["{x;y;};", 7, "Block Containing 2 Identifiers, `;`"], + +// Variable Declarations. +["var abc;", 4, "Variable Declaration"], +["var x,y;", 6, "Comma-Separated Variable Declarations, `;`"], +["var x=1,y=2;", 10, "Comma-Separated Variable Initializations, `;`"], +["var x,y=2;", 8, "Variable Declaration, Variable Initialization, `;`"], + +// Empty Statements. +[";", 1, "Empty Statement"], +["\n;", 2, "Linefeed, `;`"], + +// Expression Statements. +["x;", 2, "Identifier, `;`"], +["5;", 2, "Integer, `;`"], +["1+2;", 4, "Additive Statement, `;`"], + +// `if...else` Statements. +["if (c) x; else y;", 13, "Space-Delimited `if...else` Statement"], +["if (c) x;", 8, "Space-Delimited `if` Statement, `;`"], +["if (c) {} else {};", 14, "Empty Block-Delimited `if...else` Statement"], +["if (c1) if (c2) s1; else s2;", 19, "Nested `if...else` Statement Without Dangling `else`"], + +// `while` and `do...while` Loops. +["do s; while (e);", 11, "Space-Delimited `do...while` Loop"], +["do { s; } while (e);", 15, "Block-Delimited `do...while` Loop"], +["while (e) s;", 8, "Space-Delimited `while` Loop"], +["while (e) { s; };", 13, "Block-Delimited `while` Loop"], + +// `for` and `for...in` Loops. +["for (;;) ;", 8, "Infinite Space-Delimited `for` Loop"], +["for (;c;x++) x;", 12, "`for` Loop: Empty Initialization Condition; Space-Delimited Body"], +["for (i;i + + + +UglifyJS – a JavaScript parser/compressor/beautifier + + + + + + + + + + + + + +
+ +
+ +
+

UglifyJS – a JavaScript parser/compressor/beautifier

+ + + + +
+

1 UglifyJS — a JavaScript parser/compressor/beautifier

+
+ + +

+This package implements a general-purpose JavaScript +parser/compressor/beautifier toolkit. It is developed on NodeJS, but it +should work on any JavaScript platform supporting the CommonJS module system +(and if your platform of choice doesn't support CommonJS, you can easily +implement it, or discard the exports.* lines from UglifyJS sources). +

+

+The tokenizer/parser generates an abstract syntax tree from JS code. You +can then traverse the AST to learn more about the code, or do various +manipulations on it. This part is implemented in parse-js.js and it's a +port to JavaScript of the excellent parse-js Common Lisp library from Marijn Haverbeke. +

+

+( See cl-uglify-js if you're looking for the Common Lisp version of +UglifyJS. ) +

+

+The second part of this package, implemented in process.js, inspects and +manipulates the AST generated by the parser to provide the following: +

+
    +
  • ability to re-generate JavaScript code from the AST. Optionally + indented—you can use this if you want to “beautify” a program that has + been compressed, so that you can inspect the source. But you can also run + our code generator to print out an AST without any whitespace, so you + achieve compression as well. + +
  • +
  • shorten variable names (usually to single characters). Our mangler will + analyze the code and generate proper variable names, depending on scope + and usage, and is smart enough to deal with globals defined elsewhere, or + with eval() calls or with{} statements. In short, if eval() or + with{} are used in some scope, then all variables in that scope and any + variables in the parent scopes will remain unmangled, and any references + to such variables remain unmangled as well. + +
  • +
  • various small optimizations that may lead to faster code but certainly + lead to smaller code. Where possible, we do the following: + +
      +
    • foo["bar"] ==> foo.bar + +
    • +
    • remove block brackets {} + +
    • +
    • join consecutive var declarations: + var a = 10; var b = 20; ==> var a=10,b=20; + +
    • +
    • resolve simple constant expressions: 1 +2 * 3 ==> 7. We only do the + replacement if the result occupies less bytes; for example 1/3 would + translate to 0.333333333333, so in this case we don't replace it. + +
    • +
    • consecutive statements in blocks are merged into a sequence; in many + cases, this leaves blocks with a single statement, so then we can remove + the block brackets. + +
    • +
    • various optimizations for IF statements: + +
        +
      • if (foo) bar(); else baz(); ==> foo?bar():baz(); +
      • +
      • if (!foo) bar(); else baz(); ==> foo?baz():bar(); +
      • +
      • if (foo) bar(); ==> foo&&bar(); +
      • +
      • if (!foo) bar(); ==> foo||bar(); +
      • +
      • if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); +
      • +
      • if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} + +
      • +
      + +
    • +
    • remove some unreachable code and warn about it (code that follows a + return, throw, break or continue statement, except + function/variable declarations). + +
    • +
    • act a limited version of a pre-processor (c.f. the pre-processor of + C/C++) to allow you to safely replace selected global symbols with + specified values. When combined with the optimisations above this can + make UglifyJS operate slightly more like a compilation process, in + that when certain symbols are replaced by constant values, entire code + blocks may be optimised away as unreachable. +
    • +
    + +
  • +
+ + + +
+ +
+

1.1 Unsafe transformations

+
+ + +

+The following transformations can in theory break code, although they're +probably safe in most practical cases. To enable them you need to pass the +--unsafe flag. +

+ +
+ +
+

1.1.1 Calls involving the global Array constructor

+
+ + +

+The following transformations occur: +

+ + + +
new Array(1, 2, 3, 4)  => [1,2,3,4]
+Array(a, b, c)         => [a,b,c]
+new Array(5)           => Array(5)
+new Array(a)           => Array(a)
+
+ + +

+These are all safe if the Array name isn't redefined. JavaScript does allow +one to globally redefine Array (and pretty much everything, in fact) but I +personally don't see why would anyone do that. +

+

+UglifyJS does handle the case where Array is redefined locally, or even +globally but with a function or var declaration. Therefore, in the +following cases UglifyJS doesn't touch calls or instantiations of Array: +

+ + + +
// case 1.  globally declared variable
+  var Array;
+  new Array(1, 2, 3);
+  Array(a, b);
+
+  // or (can be declared later)
+  new Array(1, 2, 3);
+  var Array;
+
+  // or (can be a function)
+  new Array(1, 2, 3);
+  function Array() { ... }
+
+// case 2.  declared in a function
+  (function(){
+    a = new Array(1, 2, 3);
+    b = Array(5, 6);
+    var Array;
+  })();
+
+  // or
+  (function(Array){
+    return Array(5, 6, 7);
+  })();
+
+  // or
+  (function(){
+    return new Array(1, 2, 3, 4);
+    function Array() { ... }
+  })();
+
+  // etc.
+
+ + +
+ +
+ +
+

1.1.2 obj.toString() ==> obj+“”

+
+ + +
+
+ +
+ +
+

1.2 Install (NPM)

+
+ + +

+UglifyJS is now available through NPM — npm install uglify-js should do +the job. +

+
+ +
+ +
+

1.3 Install latest code from GitHub

+
+ + + + + +
## clone the repository
+mkdir -p /where/you/wanna/put/it
+cd /where/you/wanna/put/it
+git clone git://github.com/mishoo/UglifyJS.git
+
+## make the module available to Node
+mkdir -p ~/.node_libraries/
+cd ~/.node_libraries/
+ln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js
+
+## and if you want the CLI script too:
+mkdir -p ~/bin
+cd ~/bin
+ln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs
+  # (then add ~/bin to your $PATH if it's not there already)
+
+ + +
+ +
+ +
+

1.4 Usage

+
+ + +

+There is a command-line tool that exposes the functionality of this library +for your shell-scripting needs: +

+ + + +
uglifyjs [ options... ] [ filename ]
+
+ + +

+filename should be the last argument and should name the file from which +to read the JavaScript code. If you don't specify it, it will read code +from STDIN. +

+

+Supported options: +

+
    +
  • -b or --beautify — output indented code; when passed, additional + options control the beautifier: + +
      +
    • -i N or --indent N — indentation level (number of spaces) + +
    • +
    • -q or --quote-keys — quote keys in literal objects (by default, + only keys that cannot be identifier names will be quotes). + +
    • +
    + +
  • +
  • --ascii — pass this argument to encode non-ASCII characters as + \uXXXX sequences. By default UglifyJS won't bother to do it and will + output Unicode characters instead. (the output is always encoded in UTF8, + but if you pass this option you'll only get ASCII). + +
  • +
  • -nm or --no-mangle — don't mangle names. + +
  • +
  • -nmf or --no-mangle-functions – in case you want to mangle variable + names, but not touch function names. + +
  • +
  • -ns or --no-squeeze — don't call ast_squeeze() (which does various + optimizations that result in smaller, less readable code). + +
  • +
  • -mt or --mangle-toplevel — mangle names in the toplevel scope too + (by default we don't do this). + +
  • +
  • --no-seqs — when ast_squeeze() is called (thus, unless you pass + --no-squeeze) it will reduce consecutive statements in blocks into a + sequence. For example, "a = 10; b = 20; foo();" will be written as + "a=10,b=20,foo();". In various occasions, this allows us to discard the + block brackets (since the block becomes a single statement). This is ON + by default because it seems safe and saves a few hundred bytes on some + libs that I tested it on, but pass --no-seqs to disable it. + +
  • +
  • --no-dead-code — by default, UglifyJS will remove code that is + obviously unreachable (code that follows a return, throw, break or + continue statement and is not a function/variable declaration). Pass + this option to disable this optimization. + +
  • +
  • -nc or --no-copyright — by default, uglifyjs will keep the initial + comment tokens in the generated code (assumed to be copyright information + etc.). If you pass this it will discard it. + +
  • +
  • -o filename or --output filename — put the result in filename. If + this isn't given, the result goes to standard output (or see next one). + +
  • +
  • --overwrite — if the code is read from a file (not from STDIN) and you + pass --overwrite then the output will be written in the same file. + +
  • +
  • --ast — pass this if you want to get the Abstract Syntax Tree instead + of JavaScript as output. Useful for debugging or learning more about the + internals. + +
  • +
  • -v or --verbose — output some notes on STDERR (for now just how long + each operation takes). + +
  • +
  • -d SYMBOL[=VALUE] or --define SYMBOL[=VALUE] — will replace + all instances of the specified symbol where used as an identifier + (except where symbol has properly declared by a var declaration or + use as function parameter or similar) with the specified value. This + argument may be specified multiple times to define multiple + symbols - if no value is specified the symbol will be replaced with + the value true, or you can specify a numeric value (such as + 1024), a quoted string value (such as ="object"= or + ='https://github.com'), or the name of another symbol or keyword (such as =null or document). + This allows you, for example, to assign meaningful names to key + constant values but discard the symbolic names in the uglified + version for brevity/efficiency, or when used wth care, allows + UglifyJS to operate as a form of conditional compilation + whereby defining appropriate values may, by dint of the constant + folding and dead code removal features above, remove entire + superfluous code blocks (e.g. completely remove instrumentation or + trace code for production use). + Where string values are being defined, the handling of quotes are + likely to be subject to the specifics of your command shell + environment, so you may need to experiment with quoting styles + depending on your platform, or you may find the option + --define-from-module more suitable for use. + +
  • +
  • -define-from-module SOMEMODULE — will load the named module (as + per the NodeJS require() function) and iterate all the exported + properties of the module defining them as symbol names to be defined + (as if by the --define option) per the name of each property + (i.e. without the module name prefix) and given the value of the + property. This is a much easier way to handle and document groups of + symbols to be defined rather than a large number of --define + options. + +
  • +
  • --unsafe — enable other additional optimizations that are known to be + unsafe in some contrived situations, but could still be generally useful. + For now only these: + +
      +
    • foo.toString() ==> foo+"" +
    • +
    • new Array(x,…) ==> [x,…] +
    • +
    • new Array(x) ==> Array(x) + +
    • +
    + +
  • +
  • --max-line-len (default 32K characters) — add a newline after around + 32K characters. I've seen both FF and Chrome croak when all the code was + on a single line of around 670K. Pass –max-line-len 0 to disable this + safety feature. + +
  • +
  • --reserved-names — some libraries rely on certain names to be used, as + pointed out in issue #92 and #81, so this option allow you to exclude such + names from the mangler. For example, to keep names require and $super + intact you'd specify –reserved-names "require,$super". + +
  • +
  • --inline-script – when you want to include the output literally in an + HTML <script> tag you can use this option to prevent </script from + showing up in the output. + +
  • +
  • --lift-vars – when you pass this, UglifyJS will apply the following + transformations (see the notes in API, ast_lift_variables): + +
      +
    • put all var declarations at the start of the scope +
    • +
    • make sure a variable is declared only once +
    • +
    • discard unused function arguments +
    • +
    • discard unused inner (named) functions +
    • +
    • finally, try to merge assignments into that one var declaration, if + possible. +
    • +
    + +
  • +
+ + + +
+ +
+

1.4.1 API

+
+ + +

+To use the library from JavaScript, you'd do the following (example for +NodeJS): +

+ + + +
var jsp = require("uglify-js").parser;
+var pro = require("uglify-js").uglify;
+
+var orig_code = "... JS code here";
+var ast = jsp.parse(orig_code); // parse code and get the initial AST
+ast = pro.ast_mangle(ast); // get a new AST with mangled names
+ast = pro.ast_squeeze(ast); // get an AST with compression optimizations
+var final_code = pro.gen_code(ast); // compressed code here
+
+ + +

+The above performs the full compression that is possible right now. As you +can see, there are a sequence of steps which you can apply. For example if +you want compressed output but for some reason you don't want to mangle +variable names, you would simply skip the line that calls +pro.ast_mangle(ast). +

+

+Some of these functions take optional arguments. Here's a description: +

+
    +
  • jsp.parse(code, strict_semicolons) – parses JS code and returns an AST. + strict_semicolons is optional and defaults to false. If you pass + true then the parser will throw an error when it expects a semicolon and + it doesn't find it. For most JS code you don't want that, but it's useful + if you want to strictly sanitize your code. + +
  • +
  • pro.ast_lift_variables(ast) – merge and move var declarations to the + scop of the scope; discard unused function arguments or variables; discard + unused (named) inner functions. It also tries to merge assignments + following the var declaration into it. + +

    + If your code is very hand-optimized concerning var declarations, this + lifting variable declarations might actually increase size. For me it + helps out. On jQuery it adds 865 bytes (243 after gzip). YMMV. Also + note that (since it's not enabled by default) this operation isn't yet + heavily tested (please report if you find issues!). +

    +

    + Note that although it might increase the image size (on jQuery it gains + 865 bytes, 243 after gzip) it's technically more correct: in certain + situations, dead code removal might drop variable declarations, which + would not happen if the variables are lifted in advance. +

    +

    + Here's an example of what it does: +

  • +
+ + + + + +
function f(a, b, c, d, e) {
+    var q;
+    var w;
+    w = 10;
+    q = 20;
+    for (var i = 1; i < 10; ++i) {
+        var boo = foo(a);
+    }
+    for (var i = 0; i < 1; ++i) {
+        var boo = bar(c);
+    }
+    function foo(){ ... }
+    function bar(){ ... }
+    function baz(){ ... }
+}
+
+// transforms into ==>
+
+function f(a, b, c) {
+    var i, boo, w = 10, q = 20;
+    for (i = 1; i < 10; ++i) {
+        boo = foo(a);
+    }
+    for (i = 0; i < 1; ++i) {
+        boo = bar(c);
+    }
+    function foo() { ... }
+    function bar() { ... }
+}
+
+ + +
    +
  • pro.ast_mangle(ast, options) – generates a new AST containing mangled + (compressed) variable and function names. It supports the following + options: + +
      +
    • toplevel – mangle toplevel names (by default we don't touch them). +
    • +
    • except – an array of names to exclude from compression. +
    • +
    • defines – an object with properties named after symbols to + replace (see the --define option for the script) and the values + representing the AST replacement value. + +
    • +
    + +
  • +
  • pro.ast_squeeze(ast, options) – employs further optimizations designed + to reduce the size of the code that gen_code would generate from the + AST. Returns a new AST. options can be a hash; the supported options + are: + +
      +
    • make_seqs (default true) which will cause consecutive statements in a + block to be merged using the "sequence" (comma) operator + +
    • +
    • dead_code (default true) which will remove unreachable code. + +
    • +
    + +
  • +
  • pro.gen_code(ast, options) – generates JS code from the AST. By + default it's minified, but using the options argument you can get nicely + formatted output. options is, well, optional :-) and if you pass it it + must be an object and supports the following properties (below you can see + the default values): + +
      +
    • beautify: false – pass true if you want indented output +
    • +
    • indent_start: 0 (only applies when beautify is true) – initial + indentation in spaces +
    • +
    • indent_level: 4 (only applies when beautify is true) -- + indentation level, in spaces (pass an even number) +
    • +
    • quote_keys: false – if you pass true it will quote all keys in + literal objects +
    • +
    • space_colon: false (only applies when beautify is true) – wether + to put a space before the colon in object literals +
    • +
    • ascii_only: false – pass true if you want to encode non-ASCII + characters as \uXXXX. +
    • +
    • inline_script: false – pass true to escape occurrences of + </script in strings +
    • +
    + +
  • +
+ + +
+ +
+ +
+

1.4.2 Beautifier shortcoming – no more comments

+
+ + +

+The beautifier can be used as a general purpose indentation tool. It's +useful when you want to make a minified file readable. One limitation, +though, is that it discards all comments, so you don't really want to use it +to reformat your code, unless you don't have, or don't care about, comments. +

+

+In fact it's not the beautifier who discards comments — they are dumped at +the parsing stage, when we build the initial AST. Comments don't really +make sense in the AST, and while we could add nodes for them, it would be +inconvenient because we'd have to add special rules to ignore them at all +the processing stages. +

+
+ +
+ +
+

1.4.3 Use as a code pre-processor

+
+ + +

+The --define option can be used, particularly when combined with the +constant folding logic, as a form of pre-processor to enable or remove +particular constructions, such as might be used for instrumenting +development code, or to produce variations aimed at a specific +platform. +

+

+The code below illustrates the way this can be done, and how the +symbol replacement is performed. +

+ + + +
CLAUSE1: if (typeof DEVMODE === 'undefined') {
+    DEVMODE = true;
+}
+
+CLAUSE2: function init() {
+    if (DEVMODE) {
+        console.log("init() called");
+    }
+    ....
+    DEVMODE &amp;&amp; console.log("init() complete");
+}
+
+CLAUSE3: function reportDeviceStatus(device) {
+    var DEVMODE = device.mode, DEVNAME = device.name;
+    if (DEVMODE === 'open') {
+        ....
+    }
+}
+
+ + +

+When the above code is normally executed, the undeclared global +variable DEVMODE will be assigned the value true (see CLAUSE1) +and so the init() function (CLAUSE2) will write messages to the +console log when executed, but in CLAUSE3 a locally declared +variable will mask access to the DEVMODE global symbol. +

+

+If the above code is processed by UglifyJS with an argument of +--define DEVMODE=false then UglifyJS will replace DEVMODE with the +boolean constant value false within CLAUSE1 and CLAUSE2, but it +will leave CLAUSE3 as it stands because there DEVMODE resolves to +a validly declared variable. +

+

+And more so, the constant-folding features of UglifyJS will recognise +that the if condition of CLAUSE1 is thus always false, and so will +remove the test and body of CLAUSE1 altogether (including the +otherwise slightly problematical statement false = true; which it +will have formed by replacing DEVMODE in the body). Similarly, +within CLAUSE2 both calls to console.log() will be removed +altogether. +

+

+In this way you can mimic, to a limited degree, the functionality of +the C/C++ pre-processor to enable or completely remove blocks +depending on how certain symbols are defined - perhaps using UglifyJS +to generate different versions of source aimed at different +environments +

+

+It is recommmended (but not made mandatory) that symbols designed for +this purpose are given names consisting of UPPER_CASE_LETTERS to +distinguish them from other (normal) symbols and avoid the sort of +clash that CLAUSE3 above illustrates. +

+
+
+ +
+ +
+

1.5 Compression – how good is it?

+
+ + +

+Here are updated statistics. (I also updated my Google Closure and YUI +installations). +

+

+We're still a lot better than YUI in terms of compression, though slightly +slower. We're still a lot faster than Closure, and compression after gzip +is comparable. +

+ + ++ + + + + + + + + + +
FileUglifyJSUglifyJS+gzipClosureClosure+gzipYUIYUI+gzip
jquery-1.6.2.js91001 (0:01.59)3189690678 (0:07.40)31979101527 (0:01.82)34646
paper.js142023 (0:01.65)43334134301 (0:07.42)42495173383 (0:01.58)48785
prototype.js88544 (0:01.09)2668086955 (0:06.97)2632692130 (0:00.79)28624
thelib-full.js (DynarchLIB)251939 (0:02.55)72535249911 (0:09.05)72696258869 (0:01.94)76584
+ + +
+ +
+ +
+

1.6 Bugs?

+
+ + +

+Unfortunately, for the time being there is no automated test suite. But I +ran the compressor manually on non-trivial code, and then I tested that the +generated code works as expected. A few hundred times. +

+

+DynarchLIB was started in times when there was no good JS minifier. +Therefore I was quite religious about trying to write short code manually, +and as such DL contains a lot of syntactic hacks1 such as “foo == bar ? a += 10 : b = 20”, though the more readable version would clearly be to use +“if/else”. +

+

+Since the parser/compressor runs fine on DL and jQuery, I'm quite confident +that it's solid enough for production use. If you can identify any bugs, +I'd love to hear about them (use the Google Group or email me directly). +

+
+ +
+ +
+

1.7 Links

+
+ + + + + +
+ +
+ +
+

1.8 License

+
+ + +

+UglifyJS is released under the BSD license: +

+ + + +
Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>
+Based on parse-js (http://marijn.haverbeke.nl/parse-js/).
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    * Redistributions of source code must retain the above
+      copyright notice, this list of conditions and the following
+      disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials
+      provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+ + +
+

Footnotes:

+
+

1 I even reported a few bugs and suggested some fixes in the original + parse-js library, and Marijn pushed fixes literally in minutes. +

+
+
+ +
+
+
+ +
+

Date: 2011-12-09 14:59:08 EET

+

Author: Mihai Bazon

+

Org version 7.7 with Emacs version 23

+Validate XHTML 1.0 + +
+ + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/README.org b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/README.org new file mode 100644 index 00000000..4d01fdfd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/uglify-js/README.org @@ -0,0 +1,574 @@ +#+TITLE: UglifyJS -- a JavaScript parser/compressor/beautifier +#+KEYWORDS: javascript, js, parser, compiler, compressor, mangle, minify, minifier +#+DESCRIPTION: a JavaScript parser/compressor/beautifier in JavaScript +#+STYLE: +#+AUTHOR: Mihai Bazon +#+EMAIL: mihai.bazon@gmail.com + +* UglifyJS --- a JavaScript parser/compressor/beautifier + +This package implements a general-purpose JavaScript +parser/compressor/beautifier toolkit. It is developed on [[http://nodejs.org/][NodeJS]], but it +should work on any JavaScript platform supporting the CommonJS module system +(and if your platform of choice doesn't support CommonJS, you can easily +implement it, or discard the =exports.*= lines from UglifyJS sources). + +The tokenizer/parser generates an abstract syntax tree from JS code. You +can then traverse the AST to learn more about the code, or do various +manipulations on it. This part is implemented in [[../lib/parse-js.js][parse-js.js]] and it's a +port to JavaScript of the excellent [[http://marijn.haverbeke.nl/parse-js/][parse-js]] Common Lisp library from [[http://marijn.haverbeke.nl/][Marijn +Haverbeke]]. + +( See [[http://github.com/mishoo/cl-uglify-js][cl-uglify-js]] if you're looking for the Common Lisp version of +UglifyJS. ) + +The second part of this package, implemented in [[../lib/process.js][process.js]], inspects and +manipulates the AST generated by the parser to provide the following: + +- ability to re-generate JavaScript code from the AST. Optionally + indented---you can use this if you want to “beautify” a program that has + been compressed, so that you can inspect the source. But you can also run + our code generator to print out an AST without any whitespace, so you + achieve compression as well. + +- shorten variable names (usually to single characters). Our mangler will + analyze the code and generate proper variable names, depending on scope + and usage, and is smart enough to deal with globals defined elsewhere, or + with =eval()= calls or =with{}= statements. In short, if =eval()= or + =with{}= are used in some scope, then all variables in that scope and any + variables in the parent scopes will remain unmangled, and any references + to such variables remain unmangled as well. + +- various small optimizations that may lead to faster code but certainly + lead to smaller code. Where possible, we do the following: + + - foo["bar"] ==> foo.bar + + - remove block brackets ={}= + + - join consecutive var declarations: + var a = 10; var b = 20; ==> var a=10,b=20; + + - resolve simple constant expressions: 1 +2 * 3 ==> 7. We only do the + replacement if the result occupies less bytes; for example 1/3 would + translate to 0.333333333333, so in this case we don't replace it. + + - consecutive statements in blocks are merged into a sequence; in many + cases, this leaves blocks with a single statement, so then we can remove + the block brackets. + + - various optimizations for IF statements: + + - if (foo) bar(); else baz(); ==> foo?bar():baz(); + - if (!foo) bar(); else baz(); ==> foo?baz():bar(); + - if (foo) bar(); ==> foo&&bar(); + - if (!foo) bar(); ==> foo||bar(); + - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); + - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} + + - remove some unreachable code and warn about it (code that follows a + =return=, =throw=, =break= or =continue= statement, except + function/variable declarations). + + - act a limited version of a pre-processor (c.f. the pre-processor of + C/C++) to allow you to safely replace selected global symbols with + specified values. When combined with the optimisations above this can + make UglifyJS operate slightly more like a compilation process, in + that when certain symbols are replaced by constant values, entire code + blocks may be optimised away as unreachable. + +** <> + +The following transformations can in theory break code, although they're +probably safe in most practical cases. To enable them you need to pass the +=--unsafe= flag. + +*** Calls involving the global Array constructor + +The following transformations occur: + +#+BEGIN_SRC js +new Array(1, 2, 3, 4) => [1,2,3,4] +Array(a, b, c) => [a,b,c] +new Array(5) => Array(5) +new Array(a) => Array(a) +#+END_SRC + +These are all safe if the Array name isn't redefined. JavaScript does allow +one to globally redefine Array (and pretty much everything, in fact) but I +personally don't see why would anyone do that. + +UglifyJS does handle the case where Array is redefined locally, or even +globally but with a =function= or =var= declaration. Therefore, in the +following cases UglifyJS *doesn't touch* calls or instantiations of Array: + +#+BEGIN_SRC js +// case 1. globally declared variable + var Array; + new Array(1, 2, 3); + Array(a, b); + + // or (can be declared later) + new Array(1, 2, 3); + var Array; + + // or (can be a function) + new Array(1, 2, 3); + function Array() { ... } + +// case 2. declared in a function + (function(){ + a = new Array(1, 2, 3); + b = Array(5, 6); + var Array; + })(); + + // or + (function(Array){ + return Array(5, 6, 7); + })(); + + // or + (function(){ + return new Array(1, 2, 3, 4); + function Array() { ... } + })(); + + // etc. +#+END_SRC + +*** =obj.toString()= ==> =obj+“”= + +** Install (NPM) + +UglifyJS is now available through NPM --- =npm install uglify-js= should do +the job. + +** Install latest code from GitHub + +#+BEGIN_SRC sh +## clone the repository +mkdir -p /where/you/wanna/put/it +cd /where/you/wanna/put/it +git clone git://github.com/mishoo/UglifyJS.git + +## make the module available to Node +mkdir -p ~/.node_libraries/ +cd ~/.node_libraries/ +ln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js + +## and if you want the CLI script too: +mkdir -p ~/bin +cd ~/bin +ln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs + # (then add ~/bin to your $PATH if it's not there already) +#+END_SRC + +** Usage + +There is a command-line tool that exposes the functionality of this library +for your shell-scripting needs: + +#+BEGIN_SRC sh +uglifyjs [ options... ] [ filename ] +#+END_SRC + +=filename= should be the last argument and should name the file from which +to read the JavaScript code. If you don't specify it, it will read code +from STDIN. + +Supported options: + +- =-b= or =--beautify= --- output indented code; when passed, additional + options control the beautifier: + + - =-i N= or =--indent N= --- indentation level (number of spaces) + + - =-q= or =--quote-keys= --- quote keys in literal objects (by default, + only keys that cannot be identifier names will be quotes). + +- =--ascii= --- pass this argument to encode non-ASCII characters as + =\uXXXX= sequences. By default UglifyJS won't bother to do it and will + output Unicode characters instead. (the output is always encoded in UTF8, + but if you pass this option you'll only get ASCII). + +- =-nm= or =--no-mangle= --- don't mangle names. + +- =-nmf= or =--no-mangle-functions= -- in case you want to mangle variable + names, but not touch function names. + +- =-ns= or =--no-squeeze= --- don't call =ast_squeeze()= (which does various + optimizations that result in smaller, less readable code). + +- =-mt= or =--mangle-toplevel= --- mangle names in the toplevel scope too + (by default we don't do this). + +- =--no-seqs= --- when =ast_squeeze()= is called (thus, unless you pass + =--no-squeeze=) it will reduce consecutive statements in blocks into a + sequence. For example, "a = 10; b = 20; foo();" will be written as + "a=10,b=20,foo();". In various occasions, this allows us to discard the + block brackets (since the block becomes a single statement). This is ON + by default because it seems safe and saves a few hundred bytes on some + libs that I tested it on, but pass =--no-seqs= to disable it. + +- =--no-dead-code= --- by default, UglifyJS will remove code that is + obviously unreachable (code that follows a =return=, =throw=, =break= or + =continue= statement and is not a function/variable declaration). Pass + this option to disable this optimization. + +- =-nc= or =--no-copyright= --- by default, =uglifyjs= will keep the initial + comment tokens in the generated code (assumed to be copyright information + etc.). If you pass this it will discard it. + +- =-o filename= or =--output filename= --- put the result in =filename=. If + this isn't given, the result goes to standard output (or see next one). + +- =--overwrite= --- if the code is read from a file (not from STDIN) and you + pass =--overwrite= then the output will be written in the same file. + +- =--ast= --- pass this if you want to get the Abstract Syntax Tree instead + of JavaScript as output. Useful for debugging or learning more about the + internals. + +- =-v= or =--verbose= --- output some notes on STDERR (for now just how long + each operation takes). + +- =-d SYMBOL[=VALUE]= or =--define SYMBOL[=VALUE]= --- will replace + all instances of the specified symbol where used as an identifier + (except where symbol has properly declared by a var declaration or + use as function parameter or similar) with the specified value. This + argument may be specified multiple times to define multiple + symbols - if no value is specified the symbol will be replaced with + the value =true=, or you can specify a numeric value (such as + =1024=), a quoted string value (such as ="object"= or + ='https://github.com'=), or the name of another symbol or keyword + (such as =null= or =document=). + This allows you, for example, to assign meaningful names to key + constant values but discard the symbolic names in the uglified + version for brevity/efficiency, or when used wth care, allows + UglifyJS to operate as a form of *conditional compilation* + whereby defining appropriate values may, by dint of the constant + folding and dead code removal features above, remove entire + superfluous code blocks (e.g. completely remove instrumentation or + trace code for production use). + Where string values are being defined, the handling of quotes are + likely to be subject to the specifics of your command shell + environment, so you may need to experiment with quoting styles + depending on your platform, or you may find the option + =--define-from-module= more suitable for use. + +- =-define-from-module SOMEMODULE= --- will load the named module (as + per the NodeJS =require()= function) and iterate all the exported + properties of the module defining them as symbol names to be defined + (as if by the =--define= option) per the name of each property + (i.e. without the module name prefix) and given the value of the + property. This is a much easier way to handle and document groups of + symbols to be defined rather than a large number of =--define= + options. + +- =--unsafe= --- enable other additional optimizations that are known to be + unsafe in some contrived situations, but could still be generally useful. + For now only these: + + - foo.toString() ==> foo+"" + - new Array(x,...) ==> [x,...] + - new Array(x) ==> Array(x) + +- =--max-line-len= (default 32K characters) --- add a newline after around + 32K characters. I've seen both FF and Chrome croak when all the code was + on a single line of around 670K. Pass --max-line-len 0 to disable this + safety feature. + +- =--reserved-names= --- some libraries rely on certain names to be used, as + pointed out in issue #92 and #81, so this option allow you to exclude such + names from the mangler. For example, to keep names =require= and =$super= + intact you'd specify --reserved-names "require,$super". + +- =--inline-script= -- when you want to include the output literally in an + HTML = + + + */ + +(function() { + this.loggly = function(opts) { + this.user_agent = get_agent(); + this.browser_size = get_size(); + log_methods = {'error': 5, 'warn': 4, 'info': 3, 'debug': 2, 'log': 1}; + if (!opts.url) throw new Error("Please include a Loggly HTTP URL."); + if (!opts.level) { + this.level = log_methods['info']; + } else { + this.level = log_methods[opts.level]; + } + this.log = function(data) { + if (log_methods['log'] == this.level) { + opts.data = data; + janky(opts); + } + }; + this.debug = function(data) { + if (log_methods['debug'] >= this.level) { + opts.data = data; + janky(opts); + } + }; + this.info = function(data) { + if (log_methods['info'] >= this.level) { + opts.data = data; + janky(opts); + } + }; + this.warn = function(data) { + if (log_methods['warn'] >= this.level) { + opts.data = data; + janky(opts); + } + }; + this.error = function(data) { + if (log_methods['error'] >= this.level) { + opts.data = data; + janky(opts); + } + }; + }; + this.janky = function(opts) { + janky._form(function(iframe, form) { + form.setAttribute("action", opts.url); + form.setAttribute("method", "post"); + janky._input(iframe, form, opts.data); + form.submit(); + setTimeout(function(){ + document.body.removeChild(iframe); + }, 2000); + }); + }; + this.janky._form = function(cb) { + var iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + iframe.style.display = "none"; + setTimeout(function() { + var form = iframe.contentWindow.document.createElement("form"); + iframe.contentWindow.document.body.appendChild(form); + cb(iframe, form); + }, 0); + }; + this.janky._input = function(iframe, form, data) { + var inp = iframe.contentWindow.document.createElement("input"); + inp.setAttribute("type", "hidden"); + inp.setAttribute("name", "source"); + inp.value = "castor " + data; + form.appendChild(inp); + }; + this.get_agent = function () { + return navigator.appCodeName + navigator.appName + navigator.appVersion; + }; + this.get_size = function () { + var width = 0; var height = 0; + if( typeof( window.innerWidth ) == 'number' ) { + width = window.innerWidth; height = window.innerHeight; + } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) { + width = document.documentElement.clientWidth; height = document.documentElement.clientHeight; + } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) { + width = document.body.clientWidth; height = document.body.clientHeight; + } + return {'height': height, 'width': width}; + }; +})(); + + +jsworld={};jsworld.formatIsoDateTime=function(a,b){if(typeof a==="undefined")a=new Date;if(typeof b==="undefined")b=false;var c=jsworld.formatIsoDate(a)+" "+jsworld.formatIsoTime(a);if(b){var d=a.getHours()-a.getUTCHours();var e=Math.abs(d);var f=a.getUTCMinutes();var g=a.getMinutes();if(g!=f&&f<30&&d<0)e--;if(g!=f&&f>30&&d>0)e--;var h;if(g!=f)h=":30";else h=":00";var i;if(e<10)i="0"+e+h;else i=""+e+h;if(d<0)i="-"+i;else i="+"+i;c=c+i}return c};jsworld.formatIsoDate=function(a){if(typeof a==="undefined")a=new Date;var b=a.getFullYear();var c=a.getMonth()+1;var d=a.getDate();return b+"-"+jsworld._zeroPad(c,2)+"-"+jsworld._zeroPad(d,2)};jsworld.formatIsoTime=function(a){if(typeof a==="undefined")a=new Date;var b=a.getHours();var c=a.getMinutes();var d=a.getSeconds();return jsworld._zeroPad(b,2)+":"+jsworld._zeroPad(c,2)+":"+jsworld._zeroPad(d,2)};jsworld.parseIsoDateTime=function(a){if(typeof a!="string")throw"Error: The parameter must be a string";var b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)(\d\d)(\d\d)[T ](\d\d)(\d\d)(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d)(\d\d)(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)[T ](\d\d):(\d\d):(\d\d)/);if(b===null)throw"Error: Invalid ISO-8601 date/time string";var c=parseInt(b[1],10);var d=parseInt(b[2],10);var e=parseInt(b[3],10);var f=parseInt(b[4],10);var g=parseInt(b[5],10);var h=parseInt(b[6],10);if(d<1||d>12||e<1||e>31||f<0||f>23||g<0||g>59||h<0||h>59)throw"Error: Invalid ISO-8601 date/time value";var i=new Date(c,d-1,e,f,g,h);if(i.getDate()!=e||i.getMonth()+1!=d)throw"Error: Invalid date";return i};jsworld.parseIsoDate=function(a){if(typeof a!="string")throw"Error: The parameter must be a string";var b=a.match(/^(\d\d\d\d)-(\d\d)-(\d\d)/);if(b===null)b=a.match(/^(\d\d\d\d)(\d\d)(\d\d)/);if(b===null)throw"Error: Invalid ISO-8601 date string";var c=parseInt(b[1],10);var d=parseInt(b[2],10);var e=parseInt(b[3],10);if(d<1||d>12||e<1||e>31)throw"Error: Invalid ISO-8601 date value";var f=new Date(c,d-1,e);if(f.getDate()!=e||f.getMonth()+1!=d)throw"Error: Invalid date";return f};jsworld.parseIsoTime=function(a){if(typeof a!="string")throw"Error: The parameter must be a string";var b=a.match(/^(\d\d):(\d\d):(\d\d)/);if(b===null)b=a.match(/^(\d\d)(\d\d)(\d\d)/);if(b===null)throw"Error: Invalid ISO-8601 date/time string";var c=parseInt(b[1],10);var d=parseInt(b[2],10);var e=parseInt(b[3],10);if(c<0||c>23||d<0||d>59||e<0||e>59)throw"Error: Invalid ISO-8601 time value";return new Date(0,0,0,c,d,e)};jsworld._trim=function(a){var b=" \n\r\t\f \u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u2028\u2029\u3000";for(var c=0;c=0;c--){if(b.indexOf(a.charAt(c))===-1){a=a.substring(0,c+1);break}}return b.indexOf(a.charAt(0))===-1?a:""};jsworld._isNumber=function(a){if(typeof a=="number")return true;if(typeof a!="string")return false;var b=a+"";return/^-?(\d+|\d*\.\d+)$/.test(b)};jsworld._isInteger=function(a){if(typeof a!="number"&&typeof a!="string")return false;var b=a+"";return/^-?\d+$/.test(b)};jsworld._isFloat=function(a){if(typeof a!="number"&&typeof a!="string")return false;var b=a+"";return/^-?\.\d+?$/.test(b)};jsworld._hasOption=function(a,b){if(typeof a!="string"||typeof b!="string")return false;if(b.indexOf(a)!=-1)return true;else return false};jsworld._stringReplaceAll=function(a,b,c){var d;if(b.length==1&&c.length==1){d="";for(var e=0;e0){if(d.length>0)g=parseInt(d.shift(),10);if(isNaN(g))throw"Error: Invalid grouping";if(g==-1){e=a.substring(0,f)+e;break}f-=g;if(f<1){e=a.substring(0,f+g)+e;break}e=c+a.substring(f,f+g)+e}return e};jsworld._formatFractionPart=function(a,b){for(var c=0;a.length0)return a;else throw"Empty or no string"};if(a==null||typeof a!="object")throw"Error: Invalid/missing locale properties";if(typeof a.decimal_point!="string")throw"Error: Invalid/missing decimal_point property";this.decimal_point=a.decimal_point;if(typeof a.thousands_sep!="string")throw"Error: Invalid/missing thousands_sep property";this.thousands_sep=a.thousands_sep;if(typeof a.grouping!="string")throw"Error: Invalid/missing grouping property";this.grouping=a.grouping;if(typeof a.int_curr_symbol!="string")throw"Error: Invalid/missing int_curr_symbol property";if(!/[A-Za-z]{3}.?/.test(a.int_curr_symbol))throw"Error: Invalid int_curr_symbol property";this.int_curr_symbol=a.int_curr_symbol;if(typeof a.currency_symbol!="string")throw"Error: Invalid/missing currency_symbol property";this.currency_symbol=a.currency_symbol;if(typeof a.frac_digits!="number"&&a.frac_digits<0)throw"Error: Invalid/missing frac_digits property";this.frac_digits=a.frac_digits;if(a.mon_decimal_point===null||a.mon_decimal_point==""){if(this.frac_digits>0)throw"Error: Undefined mon_decimal_point property";else a.mon_decimal_point=""}if(typeof a.mon_decimal_point!="string")throw"Error: Invalid/missing mon_decimal_point property";this.mon_decimal_point=a.mon_decimal_point;if(typeof a.mon_thousands_sep!="string")throw"Error: Invalid/missing mon_thousands_sep property";this.mon_thousands_sep=a.mon_thousands_sep;if(typeof a.mon_grouping!="string")throw"Error: Invalid/missing mon_grouping property";this.mon_grouping=a.mon_grouping;if(typeof a.positive_sign!="string")throw"Error: Invalid/missing positive_sign property";this.positive_sign=a.positive_sign;if(typeof a.negative_sign!="string")throw"Error: Invalid/missing negative_sign property";this.negative_sign=a.negative_sign;if(a.p_cs_precedes!==0&&a.p_cs_precedes!==1)throw"Error: Invalid/missing p_cs_precedes property, must be 0 or 1";this.p_cs_precedes=a.p_cs_precedes;if(a.n_cs_precedes!==0&&a.n_cs_precedes!==1)throw"Error: Invalid/missing n_cs_precedes, must be 0 or 1";this.n_cs_precedes=a.n_cs_precedes;if(a.p_sep_by_space!==0&&a.p_sep_by_space!==1&&a.p_sep_by_space!==2)throw"Error: Invalid/missing p_sep_by_space property, must be 0, 1 or 2";this.p_sep_by_space=a.p_sep_by_space;if(a.n_sep_by_space!==0&&a.n_sep_by_space!==1&&a.n_sep_by_space!==2)throw"Error: Invalid/missing n_sep_by_space property, must be 0, 1, or 2";this.n_sep_by_space=a.n_sep_by_space;if(a.p_sign_posn!==0&&a.p_sign_posn!==1&&a.p_sign_posn!==2&&a.p_sign_posn!==3&&a.p_sign_posn!==4)throw"Error: Invalid/missing p_sign_posn property, must be 0, 1, 2, 3 or 4";this.p_sign_posn=a.p_sign_posn;if(a.n_sign_posn!==0&&a.n_sign_posn!==1&&a.n_sign_posn!==2&&a.n_sign_posn!==3&&a.n_sign_posn!==4)throw"Error: Invalid/missing n_sign_posn property, must be 0, 1, 2, 3 or 4";this.n_sign_posn=a.n_sign_posn;if(typeof a.int_frac_digits!="number"&&a.int_frac_digits<0)throw"Error: Invalid/missing int_frac_digits property";this.int_frac_digits=a.int_frac_digits;if(a.int_p_cs_precedes!==0&&a.int_p_cs_precedes!==1)throw"Error: Invalid/missing int_p_cs_precedes property, must be 0 or 1";this.int_p_cs_precedes=a.int_p_cs_precedes;if(a.int_n_cs_precedes!==0&&a.int_n_cs_precedes!==1)throw"Error: Invalid/missing int_n_cs_precedes property, must be 0 or 1";this.int_n_cs_precedes=a.int_n_cs_precedes;if(a.int_p_sep_by_space!==0&&a.int_p_sep_by_space!==1&&a.int_p_sep_by_space!==2)throw"Error: Invalid/missing int_p_sep_by_spacev, must be 0, 1 or 2";this.int_p_sep_by_space=a.int_p_sep_by_space;if(a.int_n_sep_by_space!==0&&a.int_n_sep_by_space!==1&&a.int_n_sep_by_space!==2)throw"Error: Invalid/missing int_n_sep_by_space property, must be 0, 1, or 2";this.int_n_sep_by_space=a.int_n_sep_by_space;if(a.int_p_sign_posn!==0&&a.int_p_sign_posn!==1&&a.int_p_sign_posn!==2&&a.int_p_sign_posn!==3&&a.int_p_sign_posn!==4)throw"Error: Invalid/missing int_p_sign_posn property, must be 0, 1, 2, 3 or 4";this.int_p_sign_posn=a.int_p_sign_posn;if(a.int_n_sign_posn!==0&&a.int_n_sign_posn!==1&&a.int_n_sign_posn!==2&&a.int_n_sign_posn!==3&&a.int_n_sign_posn!==4)throw"Error: Invalid/missing int_n_sign_posn property, must be 0, 1, 2, 3 or 4";this.int_n_sign_posn=a.int_n_sign_posn;if(a==null||typeof a!="object")throw"Error: Invalid/missing time locale properties";try{this.abday=this._parseList(a.abday,7)}catch(b){throw"Error: Invalid abday property: "+b}try{this.day=this._parseList(a.day,7)}catch(b){throw"Error: Invalid day property: "+b}try{this.abmon=this._parseList(a.abmon,12)}catch(b){throw"Error: Invalid abmon property: "+b}try{this.mon=this._parseList(a.mon,12)}catch(b){throw"Error: Invalid mon property: "+b}try{this.d_fmt=this._validateFormatString(a.d_fmt)}catch(b){throw"Error: Invalid d_fmt property: "+b}try{this.t_fmt=this._validateFormatString(a.t_fmt)}catch(b){throw"Error: Invalid t_fmt property: "+b}try{this.d_t_fmt=this._validateFormatString(a.d_t_fmt)}catch(b){throw"Error: Invalid d_t_fmt property: "+b}try{var c=this._parseList(a.am_pm,2);this.am=c[0];this.pm=c[1]}catch(b){this.am="";this.pm=""}this.getAbbreviatedWeekdayName=function(a){if(typeof a=="undefined"||a===null)return this.abday;if(!jsworld._isInteger(a)||a<0||a>6)throw"Error: Invalid weekday argument, must be an integer [0..6]";return this.abday[a]};this.getWeekdayName=function(a){if(typeof a=="undefined"||a===null)return this.day;if(!jsworld._isInteger(a)||a<0||a>6)throw"Error: Invalid weekday argument, must be an integer [0..6]";return this.day[a]};this.getAbbreviatedMonthName=function(a){if(typeof a=="undefined"||a===null)return this.abmon;if(!jsworld._isInteger(a)||a<0||a>11)throw"Error: Invalid month argument, must be an integer [0..11]";return this.abmon[a]};this.getMonthName=function(a){if(typeof a=="undefined"||a===null)return this.mon;if(!jsworld._isInteger(a)||a<0||a>11)throw"Error: Invalid month argument, must be an integer [0..11]";return this.mon[a]};this.getDecimalPoint=function(){return this.decimal_point};this.getCurrencySymbol=function(){return this.currency_symbol};this.getIntCurrencySymbol=function(){return this.int_curr_symbol.substring(0,3)};this.currencySymbolPrecedes=function(){if(this.p_cs_precedes==1)return true;else return false};this.intCurrencySymbolPrecedes=function(){if(this.int_p_cs_precedes==1)return true;else return false};this.getMonetaryDecimalPoint=function(){return this.mon_decimal_point};this.getFractionalDigits=function(){return this.frac_digits};this.getIntFractionalDigits=function(){return this.int_frac_digits}};jsworld.NumericFormatter=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.format=function(a,b){if(typeof a=="string")a=jsworld._trim(a);if(!jsworld._isNumber(a))throw"Error: The input is not a number";var c=parseFloat(a,10);var d=jsworld._getPrecision(b);if(d!=-1)c=Math.round(c*Math.pow(10,d))/Math.pow(10,d);var e=jsworld._splitNumber(String(c));var f;if(c===0)f="0";else f=jsworld._hasOption("^",b)?e.integer:jsworld._formatIntegerPart(e.integer,this.lc.grouping,this.lc.thousands_sep);var g=d!=-1?jsworld._formatFractionPart(e.fraction,d):e.fraction;var h=g.length?f+this.lc.decimal_point+g:f;if(jsworld._hasOption("~",b)||c===0){return h}else{if(jsworld._hasOption("+",b)||c<0){if(c>0)return"+"+h;else if(c<0)return"-"+h;else return h}else{return h}}}};jsworld.DateTimeFormatter=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance.";this.lc=a;this.formatDate=function(a){var b=null;if(typeof a=="string"){try{b=jsworld.parseIsoDate(a)}catch(c){b=jsworld.parseIsoDateTime(a)}}else if(a!==null&&typeof a=="object"){b=a}else{throw"Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"}return this._applyFormatting(b,this.lc.d_fmt)};this.formatTime=function(a){var b=null;if(typeof a=="string"){try{b=jsworld.parseIsoTime(a)}catch(c){b=jsworld.parseIsoDateTime(a)}}else if(a!==null&&typeof a=="object"){b=a}else{throw"Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"}return this._applyFormatting(b,this.lc.t_fmt)};this.formatDateTime=function(a){var b=null;if(typeof a=="string"){b=jsworld.parseIsoDateTime(a)}else if(a!==null&&typeof a=="object"){b=a}else{throw"Error: Invalid date argument, must be a Date object or an ISO-8601 date/time string"}return this._applyFormatting(b,this.lc.d_t_fmt)};this._applyFormatting=function(a,b){b=b.replace(/%%/g,"%");b=b.replace(/%a/g,this.lc.abday[a.getDay()]);b=b.replace(/%A/g,this.lc.day[a.getDay()]);b=b.replace(/%b/g,this.lc.abmon[a.getMonth()]);b=b.replace(/%B/g,this.lc.mon[a.getMonth()]);b=b.replace(/%d/g,jsworld._zeroPad(a.getDate(),2));b=b.replace(/%e/g,jsworld._spacePad(a.getDate(),2));b=b.replace(/%F/g,a.getFullYear()+"-"+jsworld._zeroPad(a.getMonth()+1,2)+"-"+jsworld._zeroPad(a.getDate(),2));b=b.replace(/%h/g,this.lc.abmon[a.getMonth()]);b=b.replace(/%H/g,jsworld._zeroPad(a.getHours(),2));b=b.replace(/%I/g,jsworld._zeroPad(this._hours12(a.getHours()),2));b=b.replace(/%k/g,a.getHours());b=b.replace(/%l/g,this._hours12(a.getHours()));b=b.replace(/%m/g,jsworld._zeroPad(a.getMonth()+1,2));b=b.replace(/%n/g,"\n");b=b.replace(/%M/g,jsworld._zeroPad(a.getMinutes(),2));b=b.replace(/%p/g,this._getAmPm(a.getHours()));b=b.replace(/%P/g,this._getAmPm(a.getHours()).toLocaleLowerCase());b=b.replace(/%R/g,jsworld._zeroPad(a.getHours(),2)+":"+jsworld._zeroPad(a.getMinutes(),2));b=b.replace(/%S/g,jsworld._zeroPad(a.getSeconds(),2));b=b.replace(/%T/g,jsworld._zeroPad(a.getHours(),2)+":"+jsworld._zeroPad(a.getMinutes(),2)+":"+jsworld._zeroPad(a.getSeconds(),2));b=b.replace(/%w/g,this.lc.day[a.getDay()]);b=b.replace(/%y/g,(new String(a.getFullYear())).substring(2));b=b.replace(/%Y/g,a.getFullYear());b=b.replace(/%Z/g,"");b=b.replace(/%[a-zA-Z]/g,"");return b};this._hours12=function(a){if(a===0)return 12;else if(a>12)return a-12;else return a};this._getAmPm=function(a){if(a===0||a>12)return this.lc.pm;else return this.lc.am}};jsworld.MonetaryFormatter=function(a,b,c){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.currencyFractionDigits={AFN:0,ALL:0,AMD:0,BHD:3,BIF:0,BYR:0,CLF:0,CLP:0,COP:0,CRC:0,DJF:0,GNF:0,GYD:0,HUF:0,IDR:0,IQD:0,IRR:0,ISK:0,JOD:3,JPY:0,KMF:0,KRW:0,KWD:3,LAK:0,LBP:0,LYD:3,MGA:0,MMK:0,MNT:0,MRO:0,MUR:0,OMR:3,PKR:0,PYG:0,RSD:0,RWF:0,SLL:0,SOS:0,STD:0,SYP:0,TND:3,TWD:0,TZS:0,UGX:0,UZS:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0};if(typeof b=="string"){this.currencyCode=b.toUpperCase();var d=this.currencyFractionDigits[this.currencyCode];if(typeof d!="number")d=2;this.lc.frac_digits=d;this.lc.int_frac_digits=d}else{this.currencyCode=this.lc.int_curr_symbol.substring(0,3).toUpperCase()}this.intSep=this.lc.int_curr_symbol.charAt(3);if(this.currencyCode==this.lc.int_curr_symbol.substring(0,3)){this.internationalFormatting=false;this.curSym=this.lc.currency_symbol}else{if(typeof c=="string"){this.curSym=c;this.internationalFormatting=false}else{this.internationalFormatting=true}}this.getCurrencySymbol=function(){return this.curSym};this.currencySymbolPrecedes=function(a){if(typeof a=="string"&&a=="i"){if(this.lc.int_p_cs_precedes==1)return true;else return false}else{if(this.internationalFormatting){if(this.lc.int_p_cs_precedes==1)return true;else return false}else{if(this.lc.p_cs_precedes==1)return true;else return false}}};this.getDecimalPoint=function(){return this.lc.mon_decimal_point};this.getFractionalDigits=function(a){if(typeof a=="string"&&a=="i"){return this.lc.int_frac_digits}else{if(this.internationalFormatting)return this.lc.int_frac_digits;else return this.lc.frac_digits}};this.format=function(a,b){var c;if(typeof a=="string"){a=jsworld._trim(a);c=parseFloat(a);if(typeof c!="number"||isNaN(c))throw"Error: Amount string not a number"}else if(typeof a=="number"){c=a}else{throw"Error: Amount not a number"}var d=jsworld._getPrecision(b);if(d==-1){if(this.internationalFormatting||jsworld._hasOption("i",b))d=this.lc.int_frac_digits;else d=this.lc.frac_digits}c=Math.round(c*Math.pow(10,d))/Math.pow(10,d);var e=jsworld._splitNumber(String(c));var f;if(c===0)f="0";else f=jsworld._hasOption("^",b)?e.integer:jsworld._formatIntegerPart(e.integer,this.lc.mon_grouping,this.lc.mon_thousands_sep);var g;if(d==-1){if(this.internationalFormatting||jsworld._hasOption("i",b))g=jsworld._formatFractionPart(e.fraction,this.lc.int_frac_digits);else g=jsworld._formatFractionPart(e.fraction,this.lc.frac_digits)}else{g=jsworld._formatFractionPart(e.fraction,d)}var h;if(this.lc.frac_digits>0||g.length)h=f+this.lc.mon_decimal_point+g;else h=f;if(jsworld._hasOption("~",b)){return h}else{var i=jsworld._hasOption("!",b)?true:false;var j=c<0?"-":"+";if(this.internationalFormatting||jsworld._hasOption("i",b)){if(i)return this._formatAsInternationalCurrencyWithNoSym(j,h);else return this._formatAsInternationalCurrency(j,h)}else{if(i)return this._formatAsLocalCurrencyWithNoSym(j,h);else return this._formatAsLocalCurrency(j,h)}}};this._formatAsLocalCurrency=function(a,b){if(a=="+"){if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return"("+b+this.curSym+")"}else if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return"("+this.curSym+b+")"}else if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return"("+b+" "+this.curSym+")"}else if(this.lc.p_sign_posn===0&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return"("+this.curSym+" "+b+")"}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b+this.curSym}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b+" "+this.curSym}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+" "+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+" "+b+this.curSym}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+this.curSym+b}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.curSym+b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.curSym+" "+b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.curSym+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.curSym+b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign+this.curSym}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign+this.curSym}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+this.curSym+" "+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign+" "+this.curSym}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+this.curSym+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.curSym+this.lc.positive_sign+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.curSym+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.curSym+this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.curSym+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.curSym+" "+this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return"("+b+this.curSym+")"}else if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return"("+this.curSym+b+")"}else if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return"("+b+" "+this.curSym+")"}else if(this.lc.n_sign_posn===0&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return"("+this.curSym+" "+b+")"}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b+this.curSym}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b+" "+this.curSym}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+" "+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+" "+b+this.curSym}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+this.curSym+b}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.curSym+b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.curSym+" "+b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.curSym+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.curSym+b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign+this.curSym}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign+this.curSym}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+this.curSym+" "+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign+" "+this.curSym}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+this.curSym+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.curSym+this.lc.negative_sign+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.curSym+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.curSym+this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.curSym+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.curSym+" "+this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC MONETARY definition"};this._formatAsInternationalCurrency=function(a,b){if(a=="+"){if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return"("+b+this.currencyCode+")"}else if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return"("+this.currencyCode+b+")"}else if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return"("+b+this.intSep+this.currencyCode+")"}else if(this.lc.int_p_sign_posn===0&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return"("+this.currencyCode+this.intSep+b+")"}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b+this.currencyCode}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b+this.intSep+this.currencyCode}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+this.intSep+b+this.currencyCode}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.currencyCode+b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.intSep+b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.currencyCode+b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign+this.currencyCode}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign+this.currencyCode}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign+this.intSep+this.currencyCode}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.currencyCode+this.intSep+this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return"("+b+this.currencyCode+")"}else if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return"("+this.currencyCode+b+")"}else if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return"("+b+this.intSep+this.currencyCode+")"}else if(this.lc.int_n_sign_posn===0&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return"("+this.currencyCode+this.intSep+b+")"}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b+this.currencyCode}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b+this.intSep+this.currencyCode}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+this.intSep+b+this.currencyCode}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.currencyCode+b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.intSep+b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.currencyCode+b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign+this.currencyCode}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign+this.currencyCode}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.currencyCode+this.intSep+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign+this.intSep+this.currencyCode}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+this.currencyCode+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.currencyCode+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.currencyCode+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.currencyCode+this.intSep+this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC MONETARY definition"};this._formatAsLocalCurrencyWithNoSym=function(a,b){if(a=="+"){if(this.lc.p_sign_posn===0){return"("+b+")"}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===1&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===2&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===3&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===0&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===1&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+" "+b}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===0){return b+" "+this.lc.positive_sign}else if(this.lc.p_sign_posn===4&&this.lc.p_sep_by_space===2&&this.lc.p_cs_precedes===1){return this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.n_sign_posn===0){return"("+b+")"}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===1&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===2&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===3&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===0&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===1&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+" "+b}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===0){return b+" "+this.lc.negative_sign}else if(this.lc.n_sign_posn===4&&this.lc.n_sep_by_space===2&&this.lc.n_cs_precedes===1){return this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC MONETARY definition"};this._formatAsInternationalCurrencyWithNoSym=function(a,b){if(a=="+"){if(this.lc.int_p_sign_posn===0){return"("+b+")"}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===1&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===2&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===3&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===0){return b+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===0&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===1&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+this.intSep+b}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===0){return b+this.intSep+this.lc.positive_sign}else if(this.lc.int_p_sign_posn===4&&this.lc.int_p_sep_by_space===2&&this.lc.int_p_cs_precedes===1){return this.lc.positive_sign+b}}else if(a=="-"){if(this.lc.int_n_sign_posn===0){return"("+b+")"}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===1&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===2&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===3&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===0){return b+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===0&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===1&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+this.intSep+b}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===0){return b+this.intSep+this.lc.negative_sign}else if(this.lc.int_n_sign_posn===4&&this.lc.int_n_sep_by_space===2&&this.lc.int_n_cs_precedes===1){return this.lc.negative_sign+b}}throw"Error: Invalid POSIX LC_MONETARY definition"}};jsworld.NumericParser=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.parse=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=jsworld._trim(a);b=jsworld._stringReplaceAll(a,this.lc.thousands_sep,"");b=jsworld._stringReplaceAll(b,this.lc.decimal_point,".");if(jsworld._isNumber(b))return parseFloat(b,10);else throw"Parse error: Invalid number string"}};jsworld.DateTimeParser=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance.";this.lc=a;this.parseTime=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._extractTokens(this.lc.t_fmt,a);var c=false;if(b.hour!==null&&b.minute!==null&&b.second!==null){c=true}else if(b.hourAmPm!==null&&b.am!==null&&b.minute!==null&&b.second!==null){if(b.am){b.hour=parseInt(b.hourAmPm,10)}else{if(b.hourAmPm==12)b.hour=0;else b.hour=parseInt(b.hourAmPm,10)+12}c=true}if(c)return jsworld._zeroPad(b.hour,2)+":"+jsworld._zeroPad(b.minute,2)+":"+jsworld._zeroPad(b.second,2);else throw"Parse error: Invalid/ambiguous time string"};this.parseDate=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._extractTokens(this.lc.d_fmt,a);var c=false;if(b.year!==null&&b.month!==null&&b.day!==null){c=true}if(c)return jsworld._zeroPad(b.year,4)+"-"+jsworld._zeroPad(b.month,2)+"-"+jsworld._zeroPad(b.day,2);else throw"Parse error: Invalid date string"};this.parseDateTime=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._extractTokens(this.lc.d_t_fmt,a);var c=false;var d=false;if(b.hour!==null&&b.minute!==null&&b.second!==null){c=true}else if(b.hourAmPm!==null&&b.am!==null&&b.minute!==null&&b.second!==null){if(b.am){b.hour=parseInt(b.hourAmPm,10)}else{if(b.hourAmPm==12)b.hour=0;else b.hour=parseInt(b.hourAmPm,10)+12}c=true}if(b.year!==null&&b.month!==null&&b.day!==null){d=true}if(d&&c)return jsworld._zeroPad(b.year,4)+"-"+jsworld._zeroPad(b.month,2)+"-"+jsworld._zeroPad(b.day,2)+" "+jsworld._zeroPad(b.hour,2)+":"+jsworld._zeroPad(b.minute,2)+":"+jsworld._zeroPad(b.second,2);else throw"Parse error: Invalid/ambiguous date/time string"};this._extractTokens=function(a,b){var c={year:null,month:null,day:null,hour:null,hourAmPm:null,am:null,minute:null,second:null,weekday:null};while(a.length>0){if(a.charAt(0)=="%"&&a.charAt(1)!=""){var d=a.substring(0,2);if(d=="%%"){b=b.substring(1)}else if(d=="%a"){for(var e=0;e31)throw"Parse error: Unrecognised day of the month (%e)";b=b.substring(f.length)}else if(d=="%F"){if(/^\d\d\d\d/.test(b)){c.year=parseInt(b.substring(0,4),10);b=b.substring(4)}else{throw"Parse error: Unrecognised date (%F)"}if(jsworld._stringStartsWith(b,"-"))b=b.substring(1);else throw"Parse error: Unrecognised date (%F)";if(/^0[1-9]|1[0-2]/.test(b)){c.month=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised date (%F)";if(jsworld._stringStartsWith(b,"-"))b=b.substring(1);else throw"Parse error: Unrecognised date (%F)";if(/^0[1-9]|[1-2][0-9]|3[0-1]/.test(b)){c.day=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised date (%F)"}else if(d=="%H"){if(/^[0-1][0-9]|2[0-3]/.test(b)){c.hour=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised hour (%H)"}else if(d=="%I"){if(/^0[1-9]|1[0-2]/.test(b)){c.hourAmPm=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised hour (%I)"}else if(d=="%k"){var g=b.match(/^(\d{1,2})/);c.hour=parseInt(g,10);if(isNaN(c.hour)||c.hour<0||c.hour>23)throw"Parse error: Unrecognised hour (%k)";b=b.substring(g.length)}else if(d=="%l"){var g=b.match(/^(\d{1,2})/);c.hourAmPm=parseInt(g,10);if(isNaN(c.hourAmPm)||c.hourAmPm<1||c.hourAmPm>12)throw"Parse error: Unrecognised hour (%l)";b=b.substring(g.length)}else if(d=="%m"){if(/^0[1-9]|1[0-2]/.test(b)){c.month=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised month (%m)"}else if(d=="%M"){if(/^[0-5][0-9]/.test(b)){c.minute=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised minute (%M)"}else if(d=="%n"){if(b.charAt(0)=="\n")b=b.substring(1);else throw"Parse error: Unrecognised new line (%n)"}else if(d=="%p"){if(jsworld._stringStartsWith(b,this.lc.am)){c.am=true;b=b.substring(this.lc.am.length)}else if(jsworld._stringStartsWith(b,this.lc.pm)){c.am=false;b=b.substring(this.lc.pm.length)}else throw"Parse error: Unrecognised AM/PM value (%p)"}else if(d=="%P"){if(jsworld._stringStartsWith(b,this.lc.am.toLowerCase())){c.am=true;b=b.substring(this.lc.am.length)}else if(jsworld._stringStartsWith(b,this.lc.pm.toLowerCase())){c.am=false;b=b.substring(this.lc.pm.length)}else throw"Parse error: Unrecognised AM/PM value (%P)"}else if(d=="%R"){if(/^[0-1][0-9]|2[0-3]/.test(b)){c.hour=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%R)";if(jsworld._stringStartsWith(b,":"))b=b.substring(1);else throw"Parse error: Unrecognised time (%R)";if(/^[0-5][0-9]/.test(b)){c.minute=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%R)"}else if(d=="%S"){if(/^[0-5][0-9]/.test(b)){c.second=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised second (%S)"}else if(d=="%T"){if(/^[0-1][0-9]|2[0-3]/.test(b)){c.hour=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%T)";if(jsworld._stringStartsWith(b,":"))b=b.substring(1);else throw"Parse error: Unrecognised time (%T)";if(/^[0-5][0-9]/.test(b)){c.minute=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%T)";if(jsworld._stringStartsWith(b,":"))b=b.substring(1);else throw"Parse error: Unrecognised time (%T)";if(/^[0-5][0-9]/.test(b)){c.second=parseInt(b.substring(0,2),10);b=b.substring(2)}else throw"Parse error: Unrecognised time (%T)"}else if(d=="%w"){if(/^\d/.test(b)){c.weekday=parseInt(b.substring(0,1),10);b=b.substring(1)}else throw"Parse error: Unrecognised weekday number (%w)"}else if(d=="%y"){if(/^\d\d/.test(b)){var h=parseInt(b.substring(0,2),10);if(h>50)c.year=1900+h;else c.year=2e3+h;b=b.substring(2)}else throw"Parse error: Unrecognised year (%y)"}else if(d=="%Y"){if(/^\d\d\d\d/.test(b)){c.year=parseInt(b.substring(0,4),10);b=b.substring(4)}else throw"Parse error: Unrecognised year (%Y)"}else if(d=="%Z"){if(a.length===0)break}a=a.substring(2)}else{if(a.charAt(0)!=b.charAt(0))throw'Parse error: Unexpected symbol "'+b.charAt(0)+'" in date/time string';a=a.substring(1);b=b.substring(1)}}return c}};jsworld.MonetaryParser=function(a){if(typeof a!="object"||a._className!="jsworld.Locale")throw"Constructor error: You must provide a valid jsworld.Locale instance";this.lc=a;this.parse=function(a){if(typeof a!="string")throw"Parse error: Argument must be a string";var b=this._detectCurrencySymbolType(a);var c,d;if(b=="local"){c="local";d=a.replace(this.lc.getCurrencySymbol(),"")}else if(b=="int"){c="int";d=a.replace(this.lc.getIntCurrencySymbol(),"")}else if(b=="none"){c="local";d=a}else throw"Parse error: Internal assert failure";d=jsworld._stringReplaceAll(d,this.lc.mon_thousands_sep,"");d=d.replace(this.lc.mon_decimal_point,".");d=d.replace(/\s*/g,"");d=this._removeLocalNonNegativeSign(d,c);d=this._normaliseNegativeSign(d,c);if(jsworld._isNumber(d))return parseFloat(d,10);else throw"Parse error: Invalid currency amount string"};this._detectCurrencySymbolType=function(a){if(this.lc.getCurrencySymbol().length>this.lc.getIntCurrencySymbol().length){if(a.indexOf(this.lc.getCurrencySymbol())!=-1)return"local";else if(a.indexOf(this.lc.getIntCurrencySymbol())!=-1)return"int";else return"none"}else{if(a.indexOf(this.lc.getIntCurrencySymbol())!=-1)return"int";else if(a.indexOf(this.lc.getCurrencySymbol())!=-1)return"local";else return"none"}};this._removeLocalNonNegativeSign=function(a,b){a=a.replace(this.lc.positive_sign,"");if((b=="local"&&this.lc.p_sign_posn===0||b=="int"&&this.lc.int_p_sign_posn===0)&&/\(\d+\.?\d*\)/.test(a)){a=a.replace("(","");a=a.replace(")","")}return a};this._normaliseNegativeSign=function(a,b){a=a.replace(this.lc.negative_sign,"-");if(b=="local"&&this.lc.n_sign_posn===0||b=="int"&&this.lc.int_n_sign_posn===0){if(/^\(\d+\.?\d*\)$/.test(a)){a=a.replace("(","");a=a.replace(")","");return"-"+a}}if(b=="local"&&this.lc.n_sign_posn==2||b=="int"&&this.lc.int_n_sign_posn==2){if(/^\d+\.?\d*-$/.test(a)){a=a.replace("-","");return"-"+a}}if(b=="local"&&this.lc.n_cs_precedes===0&&this.lc.n_sign_posn==3||b=="local"&&this.lc.n_cs_precedes===0&&this.lc.n_sign_posn==4||b=="int"&&this.lc.int_n_cs_precedes===0&&this.lc.int_n_sign_posn==3||b=="int"&&this.lc.int_n_cs_precedes===0&&this.lc.int_n_sign_posn==4){if(/^\d+\.?\d*-$/.test(a)){a=a.replace("-","");return"-"+a}}return a}} + + +if(typeof POSIX_LC == "undefined") var POSIX_LC = {}; + +POSIX_LC.en_US = { + "decimal_point" : ".", + "thousands_sep" : ",", + "grouping" : "3", + "abday" : ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"], + "day" : ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], + "abmon" : ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"], + "mon" : ["January","February","March","April","May","June","July","August","September","October","November","December"], + "d_fmt" : "%m/%e/%y", + "t_fmt" : "%I:%M:%S %p", + "d_t_fmt" : "%B %e, %Y %I:%M:%S %p %Z", + "am_pm" : ["AM","PM"], + "int_curr_symbol" : "USD ", + "currency_symbol" : "\u0024", + "mon_decimal_point" : ".", + "mon_thousands_sep" : ",", + "mon_grouping" : "3", + "positive_sign" : "", + "negative_sign" : "-", + "int_frac_digits" : 2, + "frac_digits" : 2, + "p_cs_precedes" : 1, + "n_cs_precedes" : 1, + "p_sep_by_space" : 0, + "n_sep_by_space" : 0, + "p_sign_posn" : 1, + "n_sign_posn" : 1, + "int_p_cs_precedes" : 1, + "int_n_cs_precedes" : 1, + "int_p_sep_by_space" : 0, + "int_n_sep_by_space" : 0, + "int_p_sign_posn" : 1, + "int_n_sign_posn" : 1 +} + +if(typeof POSIX_LC == "undefined") var POSIX_LC = {}; + +POSIX_LC.fr_FR = { + "decimal_point" : ",", + "thousands_sep" : "\u00a0", + "grouping" : "3", + "abday" : ["dim.","lun.","mar.", + "mer.","jeu.","ven.", + "sam."], + "day" : ["dimanche","lundi","mardi", + "mercredi","jeudi","vendredi", + "samedi"], + "abmon" : ["janv.","f\u00e9vr.","mars", + "avr.","mai","juin", + "juil.","ao\u00fbt","sept.", + "oct.","nov.","d\u00e9c."], + "mon" : ["janvier","f\u00e9vrier","mars", + "avril","mai","juin", + "juillet","ao\u00fbt","septembre", + "octobre","novembre","d\u00e9cembre"], + "d_fmt" : "%d/%m/%y", + "t_fmt" : "%H:%M:%S", + "d_t_fmt" : "%e %B %Y %H:%M:%S %Z", + "am_pm" : ["AM","PM"], + "int_curr_symbol" : "EUR ", + "currency_symbol" : "\u20ac", + "mon_decimal_point" : ",", + "mon_thousands_sep" : "\u00a0", + "mon_grouping" : "3", + "positive_sign" : "", + "negative_sign" : "-", + "int_frac_digits" : 2, + "frac_digits" : 2, + "p_cs_precedes" : 0, + "n_cs_precedes" : 0, + "p_sep_by_space" : 1, + "n_sep_by_space" : 1, + "p_sign_posn" : 1, + "n_sign_posn" : 1, + "int_p_cs_precedes" : 0, + "int_n_cs_precedes" : 0, + "int_p_sep_by_space" : 1, + "int_n_sep_by_space" : 1, + "int_p_sign_posn" : 1, + "int_n_sign_posn" : 1 +}; + +/** https://github.com/csnover/js-iso8601 */(function(n,f){var u=n.parse,c=[1,4,5,6,7,10,11];n.parse=function(t){var i,o,a=0;if(o=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/.exec(t)){for(var v=0,r;r=c[v];++v)o[r]=+o[r]||0;o[2]=(+o[2]||1)-1,o[3]=+o[3]||1,o[8]!=="Z"&&o[9]!==f&&(a=o[10]*60+o[11],o[9]==="+"&&(a=0-a)),i=n.UTC(o[1],o[2],o[3],o[4],o[5]+a,o[6],o[7])}else i=u?u(t):NaN;return i}})(Date) + +/*! + * geo-location-javascript v0.4.3 + * http://code.google.com/p/geo-location-javascript/ + * + * Copyright (c) 2009 Stan Wiechers + * Licensed under the MIT licenses. + * + * Revision: $Rev: 68 $: + * Author: $Author: whoisstan $: + * Date: $Date: 2010-02-15 13:42:19 +0100 (Mon, 15 Feb 2010) $: + */ +var geo_position_js=function() { + + var pub = {}; + var provider=null; + + pub.getCurrentPosition = function(successCallback,errorCallback,options) + { + provider.getCurrentPosition(successCallback, errorCallback,options); + } + + pub.init = function() + { + try + { + if (typeof(geo_position_js_simulator)!="undefined") + { + provider=geo_position_js_simulator; + } + else if (typeof(bondi)!="undefined" && typeof(bondi.geolocation)!="undefined") + { + provider=bondi.geolocation; + } + else if (typeof(navigator.geolocation)!="undefined") + { + provider=navigator.geolocation; + pub.getCurrentPosition = function(successCallback, errorCallback, options) + { + function _successCallback(p) + { + //for mozilla geode,it returns the coordinates slightly differently + if(typeof(p.latitude)!="undefined") + { + successCallback({timestamp:p.timestamp, coords: {latitude:p.latitude,longitude:p.longitude}}); + } + else + { + successCallback(p); + } + } + provider.getCurrentPosition(_successCallback,errorCallback,options); + } + } + else if(typeof(window.google)!="undefined" && typeof(google.gears)!="undefined") + { + provider=google.gears.factory.create('beta.geolocation'); + } + else if ( typeof(Mojo) !="undefined" && typeof(Mojo.Service.Request)!="Mojo.Service.Request") + { + provider=true; + pub.getCurrentPosition = function(successCallback, errorCallback, options) + { + + parameters={}; + if(options) + { + //http://developer.palm.com/index.php?option=com_content&view=article&id=1673#GPS-getCurrentPosition + if (options.enableHighAccuracy && options.enableHighAccuracy==true) + { + parameters.accuracy=1; + } + if (options.maximumAge) + { + parameters.maximumAge=options.maximumAge; + } + if (options.responseTime) + { + if(options.responseTime<5) + { + parameters.responseTime=1; + } + else if (options.responseTime<20) + { + parameters.responseTime=2; + } + else + { + parameters.timeout=3; + } + } + } + + + r=new Mojo.Service.Request('palm://com.palm.location', { + method:"getCurrentPosition", + parameters:parameters, + onSuccess: function(p){successCallback({timestamp:p.timestamp, coords: {latitude:p.latitude, longitude:p.longitude,heading:p.heading}});}, + onFailure: function(e){ + if (e.errorCode==1) + { + errorCallback({code:3,message:"Timeout"}); + } + else if (e.errorCode==2) + { + errorCallback({code:2,message:"Position Unavailable"}); + } + else + { + errorCallback({code:0,message:"Unknown Error: webOS-code"+errorCode}); + } + } + }); + } + + } + else if (typeof(device)!="undefined" && typeof(device.getServiceObject)!="undefined") + { + provider=device.getServiceObject("Service.Location", "ILocation"); + + //override default method implementation + pub.getCurrentPosition = function(successCallback, errorCallback, options) + { + function callback(transId, eventCode, result) { + if (eventCode == 4) + { + errorCallback({message:"Position unavailable", code:2}); + } + else + { + //no timestamp of location given? + successCallback({timestamp:null, coords: {latitude:result.ReturnValue.Latitude, longitude:result.ReturnValue.Longitude, altitude:result.ReturnValue.Altitude,heading:result.ReturnValue.Heading}}); + } + } + //location criteria + var criteria = new Object(); + criteria.LocationInformationClass = "BasicLocationInformation"; + //make the call + provider.ILocation.GetLocation(criteria,callback); + } + } + } + catch (e){ + alert("error="+e); + if(typeof(console)!="undefined") + { + console.log(e); + } + return false; + } + return provider!=null; + } + + + return pub; +}(); +// Couldn't get unminified version to work , go here for docs => https://github.com/iamnoah/writeCapture +(function(E,a){var j=a.document;function A(Q){var Z=j.createElement("div");j.body.insertBefore(Z,null);E.replaceWith(Z,'\n \n
\n
\n \n\n
\n
\n \n
\n

'); + __out.push(__sanitize(t('Invite Link'))); + __out.push(' '); + __out.push(__sanitize(USER.referral_url)); + __out.push('

\n\n \n\n
\n\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "templates/clients/login": function(exports, require, module) {module.exports = function(__obj) { + if (!__obj) __obj = {}; + var __out = [], __capture = function(callback) { + var out = __out, result; + __out = []; + callback.call(this); + result = __out.join(''); + __out = out; + return __safe(result); + }, __sanitize = function(value) { + if (value && value.ecoSafe) { + return value; + } else if (typeof value !== 'undefined' && value != null) { + return __escape(value); + } else { + return ''; + } + }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; + __safe = __obj.safe = function(value) { + if (value && value.ecoSafe) { + return value; + } else { + if (!(typeof value !== 'undefined' && value != null)) value = ''; + var result = new String(value); + result.ecoSafe = true; + return result; + } + }; + if (!__escape) { + __escape = __obj.escape = function(value) { + return ('' + value) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + }; + } + (function() { + (function() { + __out.push('
\n\t

'); + __out.push(__sanitize(t('Sign In'))); + __out.push('

\n\t
\n\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\n\t\t\t
\n\n
\n\n

'); + __out.push(__sanitize(t('Forgot Password?'))); + __out.push('

\n\n\t\t
\n\t
\n
\n\n
\n
\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "templates/clients/modules/credit_card": function(exports, require, module) {module.exports = function(__obj) { + if (!__obj) __obj = {}; + var __out = [], __capture = function(callback) { + var out = __out, result; + __out = []; + callback.call(this); + result = __out.join(''); + __out = out; + return __safe(result); + }, __sanitize = function(value) { + if (value && value.ecoSafe) { + return value; + } else if (typeof value !== 'undefined' && value != null) { + return __escape(value); + } else { + return ''; + } + }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; + __safe = __obj.safe = function(value) { + if (value && value.ecoSafe) { + return value; + } else { + if (!(typeof value !== 'undefined' && value != null)) value = ''; + var result = new String(value); + result.ecoSafe = true; + return result; + } + }; + if (!__escape) { + __escape = __obj.escape = function(value) { + return ('' + value) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + }; + } + (function() { + (function() { + var printCard; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + if (this.cards === "new") { + __out.push('\n
\n
\n
\n
\n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n \n \n
\n
\n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n'); + } else { + __out.push('\n '); + printCard = __bind(function(card, index) { + var exp, style; + __out.push('\n
\n '); + style = "background-position:-173px"; + __out.push('\n '); + if (card.get("card_type") === "Visa") { + style = "background-position:0px"; + } + __out.push('\n '); + if (card.get("card_type") === "MasterCard") { + style = "background-position:-42px"; + } + __out.push('\n '); + if (card.get("card_type") === "American Express") { + style = "background-position:-130px"; + } + __out.push('\n '); + if (card.get("card_type") === "Discover Card") { + style = "background-position:-85px"; + } + __out.push('\n
\n
\n ****'); + __out.push(__sanitize(card.get("card_number"))); + __out.push('\n \n '); + if (card.get("card_expiration")) { + __out.push('\n '); + __out.push(__sanitize(t('Expiry'))); + __out.push('\n '); + exp = card.get('card_expiration').split('-'); + __out.push('\n '); + __out.push(__sanitize("" + exp[0] + "-" + exp[1])); + __out.push('\n '); + } + __out.push('\n \n \n \n '); + if (card.get("default")) { + __out.push('\n ('); + __out.push(__sanitize(t('default card'))); + __out.push(')\n '); + } + __out.push('\n '); + if (this.cards.length > 1 && !card.get("default")) { + __out.push('\n '); + __out.push(__sanitize(t('make default'))); + __out.push('\n '); + } + __out.push('\n \n '); + __out.push(__sanitize(t('Edit'))); + __out.push('\n \n '); + if (this.cards.length > 1) { + __out.push('\n '); + __out.push(__sanitize(t('Delete'))); + __out.push('\n '); + } + __out.push('\n
\n '); + _.each(this.cards.models, printCard); + __out.push('\n
\n
\n\n'); + } + __out.push('\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "templates/clients/modules/sub_header": function(exports, require, module) {module.exports = function(__obj) { + if (!__obj) __obj = {}; + var __out = [], __capture = function(callback) { + var out = __out, result; + __out = []; + callback.call(this); + result = __out.join(''); + __out = out; + return __safe(result); + }, __sanitize = function(value) { + if (value && value.ecoSafe) { + return value; + } else if (typeof value !== 'undefined' && value != null) { + return __escape(value); + } else { + return ''; + } + }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; + __safe = __obj.safe = function(value) { + if (value && value.ecoSafe) { + return value; + } else { + if (!(typeof value !== 'undefined' && value != null)) value = ''; + var result = new String(value); + result.ecoSafe = true; + return result; + } + }; + if (!__escape) { + __escape = __obj.escape = function(value) { + return ('' + value) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + }; + } + (function() { + (function() { + __out.push('
\n
'); + __out.push(__sanitize(this.heading)); + __out.push('
\n
\n '); + if (window.USER.first_name) { + __out.push('\n '); + __out.push(__sanitize(t('Hello Greeting', { + name: USER.first_name + }))); + __out.push('\n '); + } + __out.push('\n
\n
\n
\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "templates/clients/promotions": function(exports, require, module) {module.exports = function(__obj) { + if (!__obj) __obj = {}; + var __out = [], __capture = function(callback) { + var out = __out, result; + __out = []; + callback.call(this); + result = __out.join(''); + __out = out; + return __safe(result); + }, __sanitize = function(value) { + if (value && value.ecoSafe) { + return value; + } else if (typeof value !== 'undefined' && value != null) { + return __escape(value); + } else { + return ''; + } + }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; + __safe = __obj.safe = function(value) { + if (value && value.ecoSafe) { + return value; + } else { + if (!(typeof value !== 'undefined' && value != null)) value = ''; + var result = new String(value); + result.ecoSafe = true; + return result; + } + }; + if (!__escape) { + __escape = __obj.escape = function(value) { + return ('' + value) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + }; + } + (function() { + (function() { + var promo, _i, _len, _ref; + __out.push(require('templates/clients/modules/sub_header').call(this, { + heading: t("Promotions") + })); + __out.push('\n\n
\n
\n
\n \n \n
\n
\n \n \n\n \n
\n '); + if (this.promos.length > 0) { + __out.push('\n
\n

'); + __out.push(__sanitize(t('Your Available Promotions'))); + __out.push('

\n \n \n\n \n \n \n \n \n \n \n \n '); + _ref = this.promos; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + promo = _ref[_i]; + __out.push('\n \n \n \n \n \n \n '); + } + __out.push('\n \n
'); + __out.push(__sanitize(t('Code'))); + __out.push(''); + __out.push(__sanitize(t('Details'))); + __out.push(''); + __out.push(__sanitize(t('Starts'))); + __out.push(''); + __out.push(__sanitize(t('Expires'))); + __out.push('
'); + __out.push(__sanitize(promo.code)); + __out.push(''); + __out.push(__sanitize(promo.description)); + __out.push(''); + __out.push(__sanitize(app.helpers.formatDate(promo.starts_at, true, "America/Los_Angeles"))); + __out.push(''); + __out.push(__sanitize(app.helpers.formatDate(promo.ends_at, true, "America/Los_Angeles"))); + __out.push('
\n
\n '); + } else { + __out.push('\n\n

'); + __out.push(__sanitize(t('No Active Promotions'))); + __out.push('

\n '); + } + __out.push('\n\n
\n
\n
\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "templates/clients/request": function(exports, require, module) {module.exports = function(__obj) { + if (!__obj) __obj = {}; + var __out = [], __capture = function(callback) { + var out = __out, result; + __out = []; + callback.call(this); + result = __out.join(''); + __out = out; + return __safe(result); + }, __sanitize = function(value) { + if (value && value.ecoSafe) { + return value; + } else if (typeof value !== 'undefined' && value != null) { + return __escape(value); + } else { + return ''; + } + }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; + __safe = __obj.safe = function(value) { + if (value && value.ecoSafe) { + return value; + } else { + if (!(typeof value !== 'undefined' && value != null)) value = ''; + var result = new String(value); + result.ecoSafe = true; + return result; + } + }; + if (!__escape) { + __escape = __obj.escape = function(value) { + return ('' + value) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + }; + } + (function() { + (function() { + var showFavoriteLocation; + showFavoriteLocation = function(location, index) { + var alphabet; + __out.push('\n '); + alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + __out.push('\n
\n '); + __out.push(__sanitize(location.nickname)); + return __out.push('\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n

'); + __out.push(__sanitize(t('Driver Name:'))); + __out.push('

\n

\n
\n

'); + __out.push(__sanitize(t('Driver #:'))); + __out.push('

\n

\n
\n

'); + __out.push(__sanitize(t('Pickup Address:'))); + __out.push('

\n

\n
\n ');
+      __out.push(__sanitize(t('Add to Favorite Locations')));
+      __out.push('\n
\n
\n

\n '); + __out.push(__sanitize(t('Nickname:'))); + __out.push('\n \n \n \n \n
\n
\n
\n
\n

'); + __out.push(__sanitize(t('Your last trip'))); + __out.push('

\n
\n \n ');
+      __out.push(__sanitize(t('Star')));
+      __out.push('\n ');
+      __out.push(__sanitize(t('Star')));
+      __out.push('\n ');
+      __out.push(__sanitize(t('Star')));
+      __out.push('\n ');
+      __out.push(__sanitize(t('Star')));
+      __out.push('\n ');
+      __out.push(__sanitize(t('Star')));
+      __out.push('\n \n \n
\n \n
\n \n
\n \n
\n \n\n
\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "templates/shared/menu": function(exports, require, module) {module.exports = function(__obj) { + if (!__obj) __obj = {}; + var __out = [], __capture = function(callback) { + var out = __out, result; + __out = []; + callback.call(this); + result = __out.join(''); + __out = out; + return __safe(result); + }, __sanitize = function(value) { + if (value && value.ecoSafe) { + return value; + } else if (typeof value !== 'undefined' && value != null) { + return __escape(value); + } else { + return ''; + } + }, __safe, __objSafe = __obj.safe, __escape = __obj.escape; + __safe = __obj.safe = function(value) { + if (value && value.ecoSafe) { + return value; + } else { + if (!(typeof value !== 'undefined' && value != null)) value = ''; + var result = new String(value); + result.ecoSafe = true; + return result; + } + }; + if (!__escape) { + __escape = __obj.escape = function(value) { + return ('' + value) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + }; + } + (function() { + (function() { + __out.push('\n'); + }).call(this); + + }).call(__obj); + __obj.safe = __objSafe, __obj.escape = __escape; + return __out.join(''); +}}, "translations/en": function(exports, require, module) {(function() { + exports.translations = { + "Uber": "Uber", + "Sign Up": "Sign Up", + "Ride Request": "Ride Request", + "Invite Friends": "Invite Friends", + "Promotions": "Promotions", + "Billing": "Billing", + "Settings": "Settings", + "Forgot Password?": "Forgot Password?", + "Password Recovery": "Password Recovery", + "Login": "Login", + "Trip Detail": "Trip Detail", + "Password Reset": "Password Reset", + "Confirm Email": "Confirm Email", + "Request Ride": "Request Ride", + "Credit Card Number": "Credit Card Number", + "month": "month", + "01-Jan": "01-Jan", + "02-Feb": "02-Feb", + "03-Mar": "03-Mar", + "04-Apr": "04-Apr", + "05-May": "05-May", + "06-Jun": "06-Jun", + "07-Jul": "07-Jul", + "08-Aug": "08-Aug", + "09-Sep": "09-Sep", + "10-Oct": "10-Oct", + "11-Nov": "11-Nov", + "12-Dec": "12-Dec", + "year": "year", + "CVV": "CVV", + "Category": "Category", + "personal": "personal", + "business": "business", + "Default Credit Card": "Default Credit Card", + "Add Credit Card": "Add Credit Card", + "Expiry": "Expiry", + "default card": "default card", + "make default": "make default", + "Edit": "Edit", + "Delete": "Delete", + "Expiry Month": "Expiry Month", + "Expiry Year": "Expiry Year", + "Unable to Verify Card": "Unable to verify card at this time. Please try again later.", + "Credit Card Update Succeeded": "Your card has been successfully updated!", + "Credit Card Update Failed": "We couldn't save your changes. Please try again in a few minutes.", + "Credit Card Delete Succeeded": "Your card has been deleted!", + "Credit Card Delete Failed": "We were unable to delete your card. Please try again later.", + "Credit Card Update Category Succeeded": "Successfully changed card category!", + "Credit Card Update Category Failed": "We couldn't change your card category. Please try again in a few minutes.", + "Credit Card Update Default Succeeded": "Successfully changed default card!", + "Credit Card Update Default Failed": "We couldn't change your default card. Please try again in a few minutes.", + "Hello Greeting": "Hello, <%= name %>", + "Card Ending in": "Card Ending in", + "Trip Map": "Trip Map", + "Amount": "Amount: <%= amount %>", + "Last Attempt to Bill": "Last Attempt to Bill: <%= date %>", + "Charge": "Charge", + "Uber Credit Balance Note": "Your account has an UberCredit balance of <%= amount %>. When billing for trips, we'll deplete your UberCredit balance before applying charges to your credit card.", + "Please Add Credit Card": "Please add a credit card to bill your outstanding charges.", + "Credit Cards": "Credit Cards", + "add a new credit card": "add a new credit card", + "Account Balance": "Account Balance", + "Arrears": "Arrears", + "Billing Succeeded": "Your card was successfully billed.", + "Confirm Email Succeeded": "Successfully confirmed email token, redirecting to log in page...", + "Confirm Email Failed": "Unable to confirm email. Please contact support@uber.com if this problem persists.", + "Email Already Confirmed": "Your email address has already been confirmed, redirecting to log in page...", + "Credit Card Added": "Credit Card Added", + "No Credit Card": "No Credit Card", + "Mobile Number Confirmed": "Mobile Number Confirmed", + "No Confirmed Mobile": "No Confirmed Mobile", + "E-mail Address Confirmed": "E-mail Address Confirmed", + "No Confirmed E-mail": "No Confirmed E-mail", + 'Reply to sign up text': 'Reply "GO" to the text message you received at sign up.', + "Resend text message": "Resend text message", + "Click sign up link": "Click the link in the email you received at sign up.", + "Resend email": "Resend email", + "Add a credit card to ride": "Add a credit card and you'll be ready to ride Uber.", + "Your Most Recent Trip": "Your Most Recent Trip", + "details": "details", + "Your Trip History ": "Your Trip History ", + "Status": "Status", + "Here's how it works:": "Here's how it works:", + "Show all trips": "Show all trips", + "Set your location:": "Set your location:", + "App search for address": "iPhone/Android app: fix the pin or search for an address", + "SMS text address": "SMS: text your address to UBRCAB (827222)", + "Confirm pickup request": "Confirm your pickup request", + "Uber sends ETA": "Uber will send you an ETA (usually within 5-10 minutes)", + "Car arrives": "When your car is arriving, Uber will inform you again.", + "Ride to destination": "Hop in the car and tell the driver your destination.", + "Thank your driver": "That’s it! Please thank your driver but remember that your tip is included and no cash is necessary.", + "Trip started here": "Trip started here", + "Trip ended here": "Trip ended here", + "Sending Email": "Sending email...", + "Resend Email Succeeded": "We just sent the email. Please click on the confirmation link you recieve.", + "Resend Email Failed": "There was an error sending the email. Please contact support if the problem persists.", + "Resend Text Succeeded": 'We just sent the text message. Please reply "GO" to the message you recieve. It may take a few minutes for the message to reach you phone.', + "Resend Text Failed": "There was an error sending the text message. Please contact support if the problem persists.", + "Password Reset Error": "There was an error processing your password reset request.", + "New Password": "New Password", + "Forgot Password": "Forgot Password", + "Forgot Password Error": "Your email address could not be found. Please make sure to use the same email address you used when you signed up.", + "Forgot Password Success": "Please check your email for a link to reset your password.", + "Forgot Password Enter Email": 'Enter your email address and Uber will send you a link to reset your password. If you remember your password, you can sign in here.', + "Invite friends": "Invite friends", + "Give $ Get $": "Give $10, Get $10", + "Give $ Get $ Description": "Every friend you invite to Uber gets $10 of Uber credit. After someone you’ve invited takes his/her first ride, you get $10 of Uber credits too!", + "What are you waiting for?": "So, what are you waiting for? Invite away!", + "Tweet": "Tweet", + "Invite Link": "Email or IM this link to your friends:", + "Email Address": "Email Address", + "Reset Password": "Reset Password", + "Enter Promotion Code": "If you have a promotion code, enter it here:", + "Your Active Promotions": "Your Active Promotions", + "Code": "Code", + "Details": "Details", + "Trips Remaining": "Trips Remaining", + "Expires": "Expires", + "No Active Promotions": "There are no active promotions on your account.", + "Your Available Promotions": "Your Available Promotions", + "Where do you want us to pick you up?": "Where do you want us to pick you up?", + "Address to search": "Address to search", + "Search": "Search", + "Driver Name:": "Driver Name:", + "Driver #:": "Driver #:", + "Pickup Address:": "Pickup Address:", + "Add to Favorite Locations": "Add to Favorite Locations", + "Star": "Star", + "Nickname:": "Nickname:", + "Add": "Add", + "Your last trip": "Your last trip", + "Please rate your driver:": "Please rate your driver:", + "Comments: (optional)": "Comments: (optional)", + "Rate Trip": "Rate Trip", + "Pickup time:": "Pickup time:", + "Miles:": "Miles:", + "Trip time:": "Trip time:", + "Fare:": "Fare:", + "Favorite Locations": "Favorite Locations", + "Search Results": "Search Results", + "You have no favorite locations saved.": "You have no favorite locations saved.", + "Loading...": "Loading...", + "Request Pickup": "Request Pickup", + "Cancel Pickup": "Cancel Pickup", + "Requesting Closest Driver": "Requesting the closest driver to pick you up...", + "En Route": "You are currently en route...", + "Rate Last Trip": "Please rate your trip to make another request", + "Rate Before Submitting": "Please rate your trip before submitting the form", + "Address too short": "Address too short", + "or did you mean": "or did you mean", + "Search Address Failed": "Unable to find the given address. Please enter another address close to your location.", + "Sending pickup request...": "Sending pickup request...", + "Cancel Request Prompt": "Are you sure you want to cancel your request?", + "Cancel Request Arrived Prompt": 'Are you sure you want to cancel your request? Your driver has arrived so there is a $10 cancellation fee. It may help to call your driver now', + "Favorite Location Nickname Length Error": "Nickname has to be atleast 3 characters", + "Favorite Location Save Succeeded": "Location Saved!", + "Favorite Location Save Failed": "Unable to save your location. Please try again later.", + "Favorite Location Title": "Favorite Location <%= id %>", + "Search Location Title": "Search Location <%= id %>", + "ETA Message": "ETA: Around <%= minutes %> Minutes", + "Nearest Cab Message": "The closest driver is approximately <%= minutes %> minute(s) away", + "Arrival ETA Message": "Your Uber will arrive in about <%= minutes %> minute(s)", + "Arriving Now Message": "Your Uber is arriving now...", + "Rating Driver Failed": "Unable to contact server. Please try again later or email support if this issue persists.", + "Account Information": "Account Information", + "Mobile Phone Information": "Mobile Phone Information", + "settings": "settings", + "Information": "Information", + "Picture": "Picture", + "Change password": "Change password", + "Your current Picture": "Your current Picture", + "Your Favorite Locations": "Your Favorite Locations", + "You have no favorite locations saved.": "You have no favorite locations saved.", + "Purpose of Mobile": "We send text messages to your mobile phone to tell you when your driver is arriving. You can also request trips using text messages.", + "Country": "Country", + "Mobile Number": "Mobile Number", + "Submit": "Submit", + "Favorite Location": "Favorite Location", + "No Approximate Address": "Could not find an approximate address", + "Address:": "Address:", + "Information Update Succeeded": "Your information has been updated!", + "Information Update Failed": "We couldn't update your information. Please try again in few minutes or contact support if the problem persists.", + "Location Delete Succeeded": "Location deleted!", + "Location Delete Failed": "We were unable to delete your favorite location. Please try again later or contact support of the issue persists.", + "Location Edit Succeeded": "Changes Saved!", + "Location Edit Failed": "We couldn't save your changes. Please try again in a few minutes.", + "Picture Update Succeeded": "Your picture has been updated!", + "Picture Update Failed": "We couldn't change your picture. Please try again in a few minutes.", + "Personal Information": "Personal Information", + "Mobile Phone Number": "Mobile Phone Number", + "Payment Information": "Payment Information", + "Purpose of Credit Card": "We keep your credit card on file so that your trip go as fast as possible. You will not be charged until you take a trip.", + "Your card will not be charged until you take a trip.": "Your card will not be charged until you take a trip.", + "Credit Card Number": "Credit Card Number", + "Expiration Date": "Expiration Date", + "Promotion Code": "Promotion Code", + "Enter Promo Here": "If you have a code for a promotion, invitation or group deal, you can enter it here.", + "Promotion Code Input Label": "Promotion, Invite or Groupon Code (optional)", + "Terms and Conditions": "Terms and Conditions", + "HELP": "HELP", + "STOP": "STOP", + "Legal Information": "Legal Information", + "Sign Up Agreement": "By signing up, I agree to the Uber <%= terms_link %> and <%= privacy_link %> and understand that Uber is a request tool, not a transportation carrier.", + "Sign Up Agreement Error": "You must agree to the Uber Terms and Conditions and Privacy Policy to continue.", + "Message and Data Rates Disclosure": "Message and Data Rates May Apply. Reply <%= help_string %> to 827-222 for help. Reply <%= stop_string %> to 827-222 to stop texts. For additional assistance, visit support.uber.com or call (866) 576-1039. Supported Carriers: AT&T, Sprint, Verizon, and T-Mobile.", + "I Agree": "I agree to the Terms & Conditions and Privacy Policy", + "Security Code": "Security Code", + "Type of Card": "Type of Card", + "Personal": "Personal", + "Business": "Business", + "Code": "Code", + "Zip or Postal Code": "Zip or Postal Code", + "Your Trip": "Your Trip", + "Trip Info": "Trip Info", + "Request a fare review": "Request a fare review", + "Fare Review Submitted": "Your fare review has been submitted. We'll get back to you soon about your request. Sorry for any inconvenience this may have caused!", + "Fair Price Consideration": "We're committed to delivering Uber service at a fair price. Before requesting a fare review, please consider:", + "Your Fare Calculation": "Your Fare Calculation", + "Charges": "Charges", + "Discounts": "Discounts", + "Total Charge": "Total Charge", + "Uber pricing information": "Uber pricing information", + "Uber Pricing Information Message": "<%= learn_link %> is published on our website.", + "GPS Point Capture Disclosure": "Due to a finite number of GPS point captures, corners on your trip map may appear cut off or rounded. These minor inaccuracies result in a shorter measured distance, which always results in a cheaper trip.", + "Fare Review Note": "Please elaborate on why this trip requires a fare review. Your comments below will help us better establish the correct price for your trip:", + "Fare Review Error": "There was an error submitting the review. Please ensure that you have a message.", + "Sign In": "Sign In" + }; +}).call(this); +}, "translations/fr": function(exports, require, module) {(function() { + exports.translations = { + "Uber": "Uber", + "Sign Up": "Inscription", + "Ride Request": "Passer une Commande", + "Invite Friends": "Inviter vos Amis", + "Promotions": "Promotions", + "Billing": "Paiement", + "Settings": "Paramètres", + "Forgot Password?": "Mot de passe oublié ?", + "Password Recovery": "Récupération du mot de passe", + "Login": "Connexion", + "Trip Detail": "Détail de la Course", + "Password Reset": "Réinitialisation du mot de passe", + "Confirm Email": "Confirmation de l’e-mail", + "Request Ride": "Passer une Commande", + "Credit Card Number": "Numéro de Carte de Crédit", + "month": "mois", + "01-Jan": "01-Jan", + "02-Feb": "02-Fév", + "03-Mar": "03-Mar", + "04-Apr": "04-Avr", + "05-May": "05-Mai", + "06-Jun": "06-Juin", + "07-Jul": "07-Jui", + "08-Aug": "08-Aoû", + "09-Sep": "09-Sep", + "10-Oct": "10-Oct", + "11-Nov": "11-Nov", + "12-Dec": "12-Déc", + "year": "année", + "CVV": "Code de Sécurité", + "Category": "Type", + "personal": "personnel", + "business": "entreprise", + "Default Credit Card": "Carte par Défaut", + "Add Credit Card": "Ajouter une Carte", + "Expiry": "Expire", + "default card": "carte par défaut", + "make default": "choisir par défaut", + "Edit": "Modifier", + "Delete": "Supprimer", + "Expiry Month": "Mois d’Expiration", + "Expiry Year": "Année d’Expiration", + "Unable to Verify Card": "Impossible de vérifier la carte pour le moment. Merci de réessayer un peu plus tard.", + "Credit Card Update Succeeded": "Votre carte a été mise à jour avec succès !", + "Credit Card Update Failed": "Nous ne pouvons enregistrer vos changements. Merci de réessayer dans quelques minutes.", + "Credit Card Delete Succeeded": "Votre carte a été supprimée !", + "Credit Card Delete Failed": "Nous n’avons pas été en mesure de supprimer votre carte. Merci de réessayer plus tard.", + "Credit Card Update Category Succeeded": "Changement de catégorie de carte réussi !", + "Credit Card Update Category Failed": "Nous ne pouvons pas changer la catégorie de votre carte. Merci de réessayer dans quelques minutes.", + "Credit Card Update Default Succeeded": "Carte par défaut changée avec succès !", + "Credit Card Update Default Failed": "Nous ne pouvons pas changer votre carte par défaut. Merci de réessayer dans quelques minutes.", + "Hello Greeting": "Bonjour, <%= name %>", + "Card Ending in": "La carte expire dans", + "Trip Map": "Carte des Courses", + "Amount": "Montant: <%= amount %>", + "Last Attempt to Bill": "Dernière tentative de prélèvement : <%= date %>", + "Charge": "Débit", + "Uber Credit Balance Note": "Votre compte a un solde de <%= amount %> UberCredits. Lorsque nous facturons des courses, nous réduirons votre solde d’UberCredits avant de prélever votre carte de crédit.", + "Please Add Credit Card": "Merci d’ajouter une carte de crédit pour que nous puissions vous facturer.", + "Credit Cards": "Cartes de crédit", + "add a new credit card": "Ajouter une nouvelle carte de crédit", + "Account Balance": "Solde du compte", + "Arrears": "Arriérés", + "Billing Succeeded": "Votre carte a été correctement débitée.", + "Confirm Email Succeeded": "L’adresse e-mail a bien été validée, vous êtes redirigé vers le tableau de bord...", + "Confirm Email Failed": "Impossible de confirmer l’adresse e-mail. Merci de contacter support@uber.com si le problème persiste.", + "Credit Card Added": "Carte de crédit ajoutée", + "No Credit Card": "Pas de carte de crédit", + "Mobile Number Confirmed": "Numéro de téléphone confirmé", + "No Confirmed Mobile": "Pas de numéro de téléphone confirmé", + "E-mail Address Confirmed": "Adresse e-mail confirmée", + "No Confirmed E-mail": "Pas d’adresse e-mail confirmée", + 'Reply to sign up text': 'Répondre "GO" au SMS que vous avez reçu à l’inscription.', + "Resend text message": "Renvoyer le SMS", + "Click sign up link": "Cliquez sur le lien contenu dans l’e-mail reçu à l’inscription.", + "Resend email": "Renvoyer l’e-mail", + "Add a credit card to ride": "Ajouter une carte de crédit et vous serez prêt à voyager avec Uber.", + "Your Most Recent Trip": "Votre course la plus récente", + "details": "détails", + "Your Trip History": "Historique de votre trajet", + "Status": "Statut", + "Here's how it works:": "Voici comment ça marche :", + "Show all trips": "Montrer toutes les courses", + "Set your location:": "Définir votre position :", + "App search for address": "Application iPhone/Android : positionner la punaise ou rechercher une adresse", + "SMS text address": "SMS : envoyez votre adresse à UBRCAB (827222)", + "Confirm pickup request": "Validez la commande", + "Uber sends ETA": "Uber envoie un temps d’attente estimé (habituellement entre 5 et 10 minutes)", + "Car arrives": "Lorsque votre voiture arrive, Uber vous en informera encore..", + "Ride to destination": "Montez dans la voiture et donnez votre destination au chauffeur.", + "Thank your driver": "C’est tout ! Remerciez le chauffeur mais souvenez-vous que les pourboires sont compris et qu’il n’est pas nécessaire d’avoir du liquide sur soi.", + "Trip started here": "La course a commencé ici.", + "Trip ended here": "La course s’est terminée ici.", + "Sending Email": "Envoi de l’e-mail...", + "Resend Email Succeeded": "Nous venons d’envoyer l’e-mail. Merci de cliquer sur le lien de confirmation que vous avez reçu.", + "Resend Email Failed": "Il y a eu un problème lors de l’envoi de l’email. Merci de contacter le support si le problème persiste.", + "Resend Text Succeeded": 'Nous venons d’envoyer le SMS. Merci de répondre "GO" au message que vous avez reçu. Il se peut que cela prenne quelques minutes pour que le message arrive sur votre téléphone.', + "Resend Text Failed": "Il y a eu un problème lors de l’envoi du SMS. Merci de contacter le support si le problème persiste.", + "Password Reset Error": "Il y a eu une error lors de la réinitialisation de votre mot de passe.", + "New Password:": "Nouveau mot de passe:", + "Forgot Password Error": "Votre nom d’utilisateur / adresse email ne peut être trouvé. Merci d’utiliser la même qu’à l’inscription.", + "Forgot Password Success": "Merci de consulter votre boîte mail pour suivre la demande de ‘réinitialisation de mot de passe.", + "Forgot Password Enter Email": "Merci de saisir votre adresse email et nous vous enverrons un lien vous permettant de réinitialiser votre mot de passe :", + "Invite friends": "Inviter vos amis", + "Give $ Get $": "Donnez $10, Recevez $10", + "Give $ Get $ Description": "Chaque ami que vous invitez à Uber recevra $10 de crédits Uber. Dès lors qu’une personne que vous aurez invité aura utilisé Uber pour la première, vous recevrez $10 de crédits Uber également !", + "What are you waiting for?": "N’attendez plus ! Lancez les invitations !", + "Tweet": "Tweeter", + "Invite Link": "Envoyez ce lien par email ou messagerie instantanée à vos amis :", + "Enter Promotion Code": "Si vous avez un code promo, saisissez-le ici:", + "Your Active Promotions": "Vos Codes Promos Actifs", + "Code": "Code", + "Details": "Détails", + "Trips Remaining": "Courses restantes", + "Expires": "Expire", + "No Active Promotions": "Vous n’avez pas de code promo actif.", + "Your Available Promotions": "Votres Promos Disponibles", + "Where do you want us to pick you up?": "Où souhaitez-vous que nous vous prenions en charge ?", + "Address to search": "Adresse à rechercher", + "Search": "Chercher", + "Driver Name:": "Nom du chauffeur:", + "Driver #:": "# Chauffeur:", + "Pickup Address:": "Lieu de prise en charge:", + "Add to Favorite Locations": "Ajoutez aux Lieux Favoris", + "Star": "Étoiles", + "Nickname:": "Pseudo", + "Add": "Ajouter", + "Your last trip": "Votre dernière course", + "Please rate your driver:": "Merci de noter votre chauffeur :", + "Comments: (optional)": "Commentaires: (optionnel)", + "Rate Trip": "Notez votre course", + "Pickup time:": "Heure de Prise en Charge :", + "Miles:": "Kilomètres :", + "Trip time:": "Temps de course :", + "Fare:": "Tarif :", + "Favorite Locations": "Lieux Favoris", + "Search Results": "Résultats", + "You have no favorite locations saved.": "Vous n’avez pas de lieux de prise en charge favoris.", + "Loading...": "Chargement...", + "Request Pickup": "Commander ici", + "Cancel Pickup": "Annuler", + "Requesting Closest Driver": "Nous demandons au chauffeur le plus proche de vous prendre en charge...", + "En Route": "Vous êtes actuellement en route...", + "Rate Last Trip": "Merci de noter votre précédent trajet pour faire une autre course.", + "Rate Before Submitting": "Merci de noter votre trajet avant de le valider.", + "Address too short": "L’adresse est trop courte", + "or did you mean": "ou vouliez-vous dire", + "Search Address Failed": "Impossible de trouver l’adresse spécifiée. Merci de saisir une autre adresse proche de l’endroit où vous vous trouvez.", + "Sending pickup request...": "Envoi de la demande de prise en charge...", + "Cancel Request Prompt": "Voulez-vous vraiment annuler votre demande ?", + "Cancel Request Arrived Prompt": 'Voulez-vous vraiment annuler votre demande ? Votre chauffeur est arrivé, vous serez donc facturé de $10 de frais d’annulation. Il pourrait être utile que vous appeliez votre chauffeur maintenant.', + "Favorite Location Nickname Length Error": "Le pseudo doit faire au moins 3 caractères de long", + "Favorite Location Save Succeeded": "Adresse enregistrée !", + "Favorite Location Save Failed": "Impossible d’enregistrer votre adresse. Merci de réessayer ultérieurement.", + "Favorite Location Title": "Adresse favorie <%= id %>", + "Search Location Title": "Recherche d’adresse <%= id %>", + "ETA Message": "Temps d’attente estimé: environ <%= minutes %> minutes", + "Nearest Cab Message": "Le chauffeur le plus proche sera là dans <%= minutes %> minute(s)", + "Arrival ETA Message": "Votre chauffeur arrivera dans <%= minutes %> minute(s)", + "Arriving Now Message": "Votre chauffeur est en approche...", + "Rating Driver Failed": "Impossible de contacter le serveur. Merci de réessayer ultérieurement ou de contacter le support si le problème persiste.", + "settings": "Paramètres", + "Information": "Information", + "Picture": "Photo", + "Change password": "Modifier votre mot de passe", + "Your current Picture": "Votre photo", + "Your Favorite Locations": "Vos lieux favoris", + "You have no favorite locations saved.": "Vous n’avez pas de lieu favori", + "Account Information": "Informations Personnelles", + "Mobile Phone Information": "Informations de Mobile", + "Change Your Password": "Changez votre mot de passe.", + "Country": "Pays", + "Language": "Langue", + "Favorite Location": "Lieu favori", + "No Approximate Address": "Impossible de trouver une adresse même approximative", + "Address:": "Adresse :", + "Information Update Succeeded": "Vos informations ont été mises à jour !", + "Information Update Failed": "Nous n’avons pas pu mettre à jour vos informations. Merci de réessayer dans quelques instants ou de contacter le support si le problème persiste.", + "Location Delete Succeeded": "Adresse supprimée !", + "Location Delete Failed": "Nous n’avons pas pu supprimée votre adresse favorie. Merci de réessayer plus tard ou de contacter le support si le problème persiste.", + "Location Edit Succeeded": "Modifications sauvegardées !", + "Location Edit Failed": "Nous n’avons pas pu sauvegarder vos modifications. Merci de réessayer dans quelques minutes.", + "Picture Update Succeeded": "Votre photo a été mise à jour !", + "Picture Update Failed": "Nous n’avons pas pu mettre à jour votre photo. Merci de réessayer dans quelques instants.", + "Personal Information": "Informations Personnelles", + "Mobile Phone Number": "Numéro de Téléphone Portable", + "Payment Information": "Informations de Facturation", + "Your card will not be charged until you take a trip.": "Votre carte ne sera pas débitée avant votre premier trajet.", + "Card Number": "Numéro de Carte", + "Promotion Code Input Label": "Code promo, code d’invitation ou “deal” acheté en ligne (optionnel)", + "Terms and Conditions": "Conditions Générales", + "HELP": "HELP", + "STOP": "STOP", + "Sign Up Agreement": "En souscrivant, j’accepte les <%= terms_link %> et <%= privacy_link %> et comprends qu’Uber est un outil de commande de chauffeur, et non un transporteur.", + "Sign Up Agreement Error": "Vous devez accepter les Conditions Générales d’utilisation d’Uber Terms and Conditions et la Politique de Confidentialité pour continuer.", + "Message and Data Rates Disclosure": "Les frais d’envoi de SMS et de consommation de données peuvent s’appliquer. Répondez <%= help_string %> au 827-222 pour obtenir de l’aide. Répondez <%= stop_string %> au 827-222 pour ne plus recevoir de SMS. Pour plus d’aide, visitez support.uber.com ou appelez le (866) 576-1039. Opérateurs supportés: AT&T, Sprint, Verizon, T-Mobile, Orange, SFR et Bouygues Telecom.", + "Zip/Postal Code": "Code Postal", + "Expiration Date": "Date D'expiration", + "Security Code": "Code de Sécurité", + "Type of Card": "Type", + "Personal": "Personnel", + "Business": "Entreprise", + "Promotion Code": "Code Promo", + "Legal Information": "Mentions Légales", + "I Agree": "J'accepte.", + "Your Trip": "Votre Course", + "Trip Info": "Informations de la Course", + "Request a fare review": "Demander un contrôle du tarif", + "Fare Review Submitted": "Votre demande de contrôle du tarif a été soumis. Nous reviendrons vers vous rapidement concernant cette demande. Nous nous excusons pour les dérangements éventuellement occasionnés !", + "Fair Price Consideration": "Nous nous engageons à proposer Uber à un tarif juste. Avant de demander un contrôle du tarif, merci de prendre en compte :", + "Your Fare Calculation": "Calcul du Prix", + "Charges": "Coûts", + "Discounts": "Réductions", + "Total Charge": "Coût total", + "Uber pricing information": "Information sur les prix d’Uber", + "Uber Pricing Information Message": "<%= learn_link %> est disponible sur notre site web.", + "GPS Point Capture Disclosure": "A cause d’un nombre limité de coordonnées GPS sauvegardées, les angles de votre trajet sur la carte peuvent apparaître coupés ou arrondis. Ces légères incohérences débouchent sur des distances mesurées plus courtes, ce qui implique toujours un prix du trajet moins élevé.", + "Fare Review Note": "Merci de nous expliquer pourquoi le tarif de cette course nécessite d’être contrôlé. Vos commentaires ci-dessous nous aideront à établir un prix plus juste si nécessaire :", + "Fare Review Error": "Il y a eu une erreur lors de l’envoi de la demande. Assurez-vous d’avoir bien ajouté une description à votre demande." + }; +}).call(this); +}, "views/clients/billing": function(exports, require, module) {(function() { + var clientsBillingTemplate; + var __hasProp = Object.prototype.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; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + clientsBillingTemplate = require('templates/clients/billing'); + exports.ClientsBillingView = (function() { + __extends(ClientsBillingView, UberView); + function ClientsBillingView() { + ClientsBillingView.__super__.constructor.apply(this, arguments); + } + ClientsBillingView.prototype.id = 'billing_view'; + ClientsBillingView.prototype.className = 'view_container'; + ClientsBillingView.prototype.events = { + 'click a#add_card': 'addCard', + 'click .charge_arrear': 'chargeArrear' + }; + ClientsBillingView.prototype.render = function() { + this.RefreshUserInfo(__bind(function() { + var cards, newForm; + this.HideSpinner(); + $(this.el).html(clientsBillingTemplate()); + if (USER.payment_gateway.payment_profiles.length === 0) { + newForm = new app.views.clients.modules.creditcard; + $(this.el).find("#add_card_wrapper").html(newForm.render(0).el); + } else { + cards = new app.views.clients.modules.creditcard; + $("#cards").html(cards.render("all").el); + } + return this.delegateEvents(); + }, this)); + return this; + }; + ClientsBillingView.prototype.addCard = function(e) { + var newCard; + e.preventDefault(); + newCard = new app.views.clients.modules.creditcard; + $('#cards').append(newCard.render("new").el); + return $("a#add_card").hide(); + }; + ClientsBillingView.prototype.chargeArrear = function(e) { + var $el, arrearId, attrs, cardId, options, tryCharge; + e.preventDefault(); + $(".error_message").text(""); + $el = $(e.currentTarget); + arrearId = $el.attr('id'); + cardId = $el.parent().find('#card_to_charge').val(); + this.ShowSpinner('submit'); + tryCharge = new app.models.clientbills({ + id: arrearId + }); + attrs = { + payment_profile_id: cardId, + dataType: 'json' + }; + options = { + success: __bind(function(data, textStatus, jqXHR) { + $el.parent().find(".success_message").text(t("Billing Succeeded")); + $el.hide(); + return $el.parent().find('#card_to_charge').hide(); + }, this), + error: __bind(function(jqXHR, status, errorThrown) { + return $el.parent().find(".error_message").text(JSON.parse(status.responseText).error); + }, this), + complete: __bind(function() { + return this.HideSpinner(); + }, this) + }; + return tryCharge.save(attrs, options); + }; + return ClientsBillingView; + })(); +}).call(this); +}, "views/clients/confirm_email": function(exports, require, module) {(function() { + var clientsConfirmEmailTemplate; + var __hasProp = Object.prototype.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; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + clientsConfirmEmailTemplate = require('templates/clients/confirm_email'); + exports.ClientsConfirmEmailView = (function() { + __extends(ClientsConfirmEmailView, UberView); + function ClientsConfirmEmailView() { + ClientsConfirmEmailView.__super__.constructor.apply(this, arguments); + } + ClientsConfirmEmailView.prototype.id = 'confirm_email_view'; + ClientsConfirmEmailView.prototype.className = 'view_container'; + ClientsConfirmEmailView.prototype.render = function(token) { + var attrs; + $(this.el).html(clientsConfirmEmailTemplate()); + attrs = { + data: { + email_token: token + }, + success: __bind(function(data, textStatus, jqXHR) { + var show_dashboard; + this.HideSpinner(); + show_dashboard = function() { + return app.routers.clients.navigate('!/dashboard', true); + }; + if (data.status === 'OK') { + $('.success_message').show(); + return _.delay(show_dashboard, 3000); + } else if (data.status === 'ALREADY_COMFIRMED') { + $('.already_confirmed_message').show(); + return _.delay(show_dashboard, 3000); + } else { + return $('.error_message').show(); + } + }, this), + error: __bind(function(e) { + this.HideSpinner(); + return $('.error_message').show(); + }, this), + complete: function(status) { + return $('#attempt_text').hide(); + }, + dataType: 'json', + type: 'PUT', + url: "" + API + "/users/self" + }; + $.ajax(attrs); + this.ShowSpinner('submit'); + return this; + }; + return ClientsConfirmEmailView; + })(); +}).call(this); +}, "views/clients/dashboard": function(exports, require, module) {(function() { + var clientsDashboardTemplate; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }; + clientsDashboardTemplate = require('templates/clients/dashboard'); + exports.ClientsDashboardView = (function() { + var displayFirstTrip; + __extends(ClientsDashboardView, UberView); + function ClientsDashboardView() { + this.showAllTrips = __bind(this.showAllTrips, this); + this.render = __bind(this.render, this); + ClientsDashboardView.__super__.constructor.apply(this, arguments); + } + ClientsDashboardView.prototype.id = 'dashboard_view'; + ClientsDashboardView.prototype.className = 'view_container'; + ClientsDashboardView.prototype.events = { + 'click a.confirmation': 'confirmationClick', + 'click #resend_email': 'resendEmail', + 'click #resend_mobile': 'resendMobile', + 'click #show_all_trips': 'showAllTrips' + }; + ClientsDashboardView.prototype.render = function() { + var displayPage, downloadTrips; + this.HideSpinner(); + displayPage = __bind(function() { + $(this.el).html(clientsDashboardTemplate()); + this.confirmationsSetup(); + return this.RequireMaps(__bind(function() { + if (USER.trips.models[0]) { + if (!USER.trips.models[0].get("points")) { + return USER.trips.models[0].fetch({ + data: { + relationships: 'points' + }, + success: __bind(function() { + this.CacheData("USERtrips", USER.trips); + return displayFirstTrip(); + }, this) + }); + } else { + return displayFirstTrip(); + } + } + }, this)); + }, this); + downloadTrips = __bind(function() { + return this.DownloadUserTrips(displayPage, false, 10); + }, this); + this.RefreshUserInfo(downloadTrips); + return this; + }; + displayFirstTrip = __bind(function() { + var bounds, endPos, map, myOptions, path, polyline, startPos; + myOptions = { + zoom: 12, + mapTypeId: google.maps.MapTypeId.ROADMAP, + zoomControl: false, + rotateControl: false, + panControl: false, + mapTypeControl: false, + scrollwheel: false + }; + if (USER.trips.length === 10) { + $("#show_all_trips").show(); + } + if (USER.trips.length > 0) { + map = new google.maps.Map(document.getElementById("trip_details_map"), myOptions); + bounds = new google.maps.LatLngBounds(); + path = []; + _.each(USER.trips.models[0].get('points'), __bind(function(point) { + path.push(new google.maps.LatLng(point.lat, point.lng)); + return bounds.extend(_.last(path)); + }, this)); + map.fitBounds(bounds); + startPos = new google.maps.Marker({ + position: _.first(path), + map: map, + title: t('Trip started here'), + icon: 'https://uber-static.s3.amazonaws.com/marker_start.png' + }); + endPos = new google.maps.Marker({ + position: _.last(path), + map: map, + title: t('Trip ended here'), + icon: 'https://uber-static.s3.amazonaws.com/marker_end.png' + }); + polyline = new google.maps.Polyline({ + path: path, + strokeColor: '#003F87', + strokeOpacity: 1, + strokeWeight: 5 + }); + return polyline.setMap(map); + } + }, ClientsDashboardView); + ClientsDashboardView.prototype.confirmationsSetup = function() { + var blink, cardForm, element, _ref, _ref2, _ref3, _ref4, _ref5; + blink = function(element) { + var opacity; + opacity = 0.5; + if (element.css('opacity') === "0.5") { + opacity = 1.0; + } + return element.fadeTo(2000, opacity, function() { + return blink(element); + }); + }; + if (((_ref = window.USER) != null ? (_ref2 = _ref.payment_gateway) != null ? (_ref3 = _ref2.payment_profiles) != null ? _ref3.length : void 0 : void 0 : void 0) === 0) { + element = $('#confirmed_credit_card'); + cardForm = new app.views.clients.modules.creditcard; + $('#card.info').append(cardForm.render().el); + blink(element); + } + if (((_ref4 = window.USER) != null ? _ref4.confirm_email : void 0) === false) { + element = $('#confirmed_email'); + blink(element); + } + if ((((_ref5 = window.USER) != null ? _ref5.confirm_mobile : void 0) != null) === false) { + element = $('#confirmed_mobile'); + return blink(element); + } + }; + ClientsDashboardView.prototype.confirmationClick = function(e) { + e.preventDefault(); + $('.info').hide(); + $('#more_info').show(); + switch (e.currentTarget.id) { + case "card": + return $('#card.info').slideToggle(); + case "mobile": + return $('#mobile.info').slideToggle(); + case "email": + return $('#email.info').slideToggle(); + } + }; + ClientsDashboardView.prototype.resendEmail = function(e) { + var $el; + e.preventDefault(); + $el = $(e.currentTarget); + $el.removeAttr('href').prop({ + disabled: true + }); + $el.html(t("Sending Email")); + return $.ajax({ + type: 'GET', + url: API + '/users/request_confirm_email', + data: { + token: USER.token + }, + dataType: 'json', + success: __bind(function(data, textStatus, jqXHR) { + return $el.html(t("Resend Email Succeeded")); + }, this), + error: __bind(function(jqXHR, textStatus, errorThrown) { + return $el.html(t("Resend Email Failed")); + }, this) + }); + }; + ClientsDashboardView.prototype.resendMobile = function(e) { + var $el; + e.preventDefault(); + $el = $(e.currentTarget); + $el.removeAttr('href').prop({ + disabled: true + }); + $el.html("Sending message..."); + return $.ajax({ + type: 'GET', + url: API + '/users/request_confirm_mobile', + data: { + token: USER.token + }, + dataType: 'json', + success: __bind(function(data, textStatus, jqXHR) { + return $el.html(t("Resend Text Succeeded")); + }, this), + error: __bind(function(jqXHR, textStatus, errorThrown) { + return $el.html(t("Resend Text Failed")); + }, this) + }); + }; + ClientsDashboardView.prototype.showAllTrips = function(e) { + e.preventDefault(); + $(e.currentTarget).hide(); + return this.DownloadUserTrips(this.render, true, 1000); + }; + return ClientsDashboardView; + }).call(this); +}).call(this); +}, "views/clients/forgot_password": function(exports, require, module) {(function() { + var clientsForgotPasswordTemplate; + var __hasProp = Object.prototype.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; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + clientsForgotPasswordTemplate = require('templates/clients/forgot_password'); + exports.ClientsForgotPasswordView = (function() { + __extends(ClientsForgotPasswordView, UberView); + function ClientsForgotPasswordView() { + ClientsForgotPasswordView.__super__.constructor.apply(this, arguments); + } + ClientsForgotPasswordView.prototype.id = 'forgotpassword_view'; + ClientsForgotPasswordView.prototype.className = 'view_container modal_view_container'; + ClientsForgotPasswordView.prototype.events = { + "submit #password_reset": "passwordReset", + "click #password_reset_submit": "passwordReset", + "submit #forgot_password": "forgotPassword", + "click #forgot_password_submit": "forgotPassword" + }; + ClientsForgotPasswordView.prototype.render = function(token) { + this.HideSpinner(); + $(this.el).html(clientsForgotPasswordTemplate({ + token: token + })); + this.delegateEvents(); + return this; + }; + ClientsForgotPasswordView.prototype.forgotPassword = function(e) { + var attrs; + e.preventDefault(); + $('.success_message').hide(); + $(".error_message").hide(); + attrs = { + data: { + login: $("#login").val() + }, + success: __bind(function(data, textStatus, jqXHR) { + this.HideSpinner(); + $('.success_message').show(); + return $("#forgot_password").hide(); + }, this), + error: __bind(function(e) { + this.HideSpinner(); + return $('.error_message').show(); + }, this), + dataType: 'json', + type: 'PUT', + url: "" + API + "/users/forgot_password" + }; + $.ajax(attrs); + return this.ShowSpinner('submit'); + }; + ClientsForgotPasswordView.prototype.passwordReset = function(e) { + var attrs; + e.preventDefault(); + attrs = { + data: { + email_token: $("#token").val(), + password: $("#password").val() + }, + success: __bind(function(data, textStatus, jqXHR) { + this.HideSpinner(); + $.cookie('token', data.token); + amplify.store('USERjson', data); + app.refreshMenu(); + return location.hash = '!/dashboard'; + }, this), + error: __bind(function(e) { + this.HideSpinner(); + return $('#error_reset').show(); + }, this), + dataType: 'json', + type: 'PUT', + url: "" + API + "/users/self" + }; + $.ajax(attrs); + return this.ShowSpinner('submit'); + }; + return ClientsForgotPasswordView; + })(); +}).call(this); +}, "views/clients/invite": function(exports, require, module) {(function() { + var clientsInviteTemplate; + var __hasProp = Object.prototype.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; + }; + clientsInviteTemplate = require('templates/clients/invite'); + exports.ClientsInviteView = (function() { + __extends(ClientsInviteView, UberView); + function ClientsInviteView() { + ClientsInviteView.__super__.constructor.apply(this, arguments); + } + ClientsInviteView.prototype.id = 'invite_view'; + ClientsInviteView.prototype.className = 'view_container'; + ClientsInviteView.prototype.render = function() { + this.ReadUserInfo(); + this.HideSpinner(); + $(this.el).html(clientsInviteTemplate()); + console.log(screen); + return this; + }; + return ClientsInviteView; + })(); +}).call(this); +}, "views/clients/login": function(exports, require, module) {(function() { + var clientsLoginTemplate; + var __hasProp = Object.prototype.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; + }; + clientsLoginTemplate = require('templates/clients/login'); + exports.ClientsLoginView = (function() { + __extends(ClientsLoginView, UberView); + function ClientsLoginView() { + ClientsLoginView.__super__.constructor.apply(this, arguments); + } + ClientsLoginView.prototype.id = 'login_view'; + ClientsLoginView.prototype.className = 'view_container modal_view_container'; + ClientsLoginView.prototype.events = { + 'submit form': 'authenticate', + 'click button': 'authenticate' + }; + ClientsLoginView.prototype.initialize = function() { + _.bindAll(this, 'render'); + return this.render(); + }; + ClientsLoginView.prototype.render = function() { + this.HideSpinner(); + $(this.el).html(clientsLoginTemplate()); + this.delegateEvents(); + return this.place(); + }; + ClientsLoginView.prototype.authenticate = function(e) { + e.preventDefault(); + return $.ajax({ + type: 'POST', + url: API + '/auth/web_login/client', + data: { + login: $("#login").val(), + password: $("#password").val() + }, + dataType: 'json', + success: function(data, textStatus, jqXHR) { + $.cookie('user', JSON.stringify(data)); + $.cookie('token', data.token); + amplify.store('USERjson', data); + $('header').html(app.views.shared.menu.render().el); + return app.routers.clients.navigate('!/dashboard', true); + }, + error: function(jqXHR, textStatus, errorThrown) { + $.cookie('user', null); + $.cookie('token', null); + if (jqXHR.status === 403) { + $.cookie('redirected_user', JSON.stringify(JSON.parse(jqXHR.responseText).error_obj), { + domain: '.uber.com' + }); + window.location = 'http://partners.uber.com/'; + } + return $('.error_message').html(JSON.parse(jqXHR.responseText).error).hide().fadeIn(); + } + }); + }; + return ClientsLoginView; + })(); +}).call(this); +}, "views/clients/modules/credit_card": function(exports, require, module) {(function() { + var creditCardTemplate; + var __hasProp = Object.prototype.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; + }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; + creditCardTemplate = require('templates/clients/modules/credit_card'); + exports.CreditCardView = (function() { + __extends(CreditCardView, UberView); + function CreditCardView() { + CreditCardView.__super__.constructor.apply(this, arguments); + } + CreditCardView.prototype.id = 'creditcard_view'; + CreditCardView.prototype.className = 'module_container'; + CreditCardView.prototype.events = { + 'submit #credit_card_form': 'processNewCard', + 'click #new_card': 'processNewCard', + 'change #card_number': 'showCardType', + 'click .edit_card_show': 'showEditCard', + 'click .edit_card': 'editCard', + 'click .delete_card': 'deleteCard', + 'click .make_default': 'makeDefault', + 'change .use_case': 'saveUseCase' + }; + CreditCardView.prototype.initialize = function() { + return app.collections.paymentprofiles.bind("refresh", __bind(function() { + return this.RefreshUserInfo(__bind(function() { + this.render("all"); + return this.HideSpinner(); + }, this)); + }, this)); + }; + CreditCardView.prototype.render = function(cards) { + if (cards == null) { + cards = "new"; + } + if (cards === "all") { + app.collections.paymentprofiles.reset(USER.payment_gateway.payment_profiles); + cards = app.collections.paymentprofiles; + } + $(this.el).html(creditCardTemplate({ + cards: cards + })); + return this; + }; + CreditCardView.prototype.processNewCard = function(e) { + var $el, attrs, model, options; + e.preventDefault(); + this.ClearGlobalStatus(); + $el = $("#credit_card_form"); + $el.find('.error_message').html(""); + attrs = { + card_number: $el.find('#card_number').val(), + card_code: $el.find('#card_code').val(), + card_expiration_month: $el.find('#card_expiration_month').val(), + card_expiration_year: $el.find('#card_expiration_year').val(), + use_case: $el.find('#use_case').val(), + "default": $el.find('#default_check').prop("checked") + }; + options = { + statusCode: { + 200: __bind(function(e) { + this.HideSpinner(); + $('#cc_form_wrapper').hide(); + app.collections.paymentprofiles.trigger("refresh"); + $(this.el).remove(); + $("a#add_card").show(); + return $('section').html(app.views.clients.billing.render().el); + }, this), + 406: __bind(function(e) { + var error, errors, _i, _len, _ref, _results; + this.HideSpinner(); + errors = JSON.parse(e.responseText); + _ref = _.keys(errors); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + error = _ref[_i]; + _results.push(error === "top_of_form" ? $("#top_of_form").html(errors[error]) : $("#credit_card_form").find("#" + error).parent().find(".error_message").html(errors[error])); + } + return _results; + }, this), + 420: __bind(function(e) { + this.HideSpinner(); + return $("#top_of_form").html(t("Unable to Verify Card")); + }, this) + } + }; + this.ShowSpinner("submit"); + model = new app.models.paymentprofile; + model.save(attrs, options); + return app.collections.paymentprofiles.add(model); + }; + CreditCardView.prototype.showCardType = function(e) { + var $el, reAmerica, reDiscover, reMaster, reVisa, validCard; + reVisa = /^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/; + reMaster = /^5[1-5]\d{2}-?\d{4}-?\d{4}-?\d{4}$/; + reAmerica = /^6011-?\d{4}-?\d{4}-?\d{4}$/; + reDiscover = /^3[4,7]\d{13}$/; + $el = $("#card_logos"); + validCard = false; + if (e.currentTarget.value.match(reVisa)) { + validCard = true; + } else if (e.currentTarget.value.match(reMaster)) { + $el.css('background-position', "-60px"); + validCard = true; + } else if (e.currentTarget.value.match(reAmerica)) { + $el.css('background-position', "-120px"); + validCard = true; + } else if (e.currentTarget.value.match(reDiscover)) { + $el.css('background-position', "-180px"); + validCard = true; + } + if (validCard) { + $el.css('width', "60px"); + return $el.css('margin-left', "180px"); + } else { + $el.css('width', "250px"); + return $el.css('margin-left', "80px"); + } + }; + CreditCardView.prototype.showEditCard = function(e) { + var $el, id; + e.preventDefault(); + $el = $(e.currentTarget); + if ($el.html() === t("Edit")) { + id = $el.html(t("Cancel")).parents("tr").attr("id").substring(1); + return $("#e" + id).show(); + } else { + id = $el.html(t("Edit")).parents("tr").attr("id").substring(1); + return $("#e" + id).hide(); + } + }; + CreditCardView.prototype.editCard = function(e) { + var $el, attrs, id, options; + e.preventDefault(); + this.ClearGlobalStatus(); + $el = $(e.currentTarget).parents("td"); + id = $el.parents("tr").attr("id").substring(1); + $el.attr('disabled', 'disabled'); + this.ShowSpinner('submit'); + attrs = { + card_expiration_month: $el.find('#card_expiration_month').val(), + card_expiration_year: $el.find('#card_expiration_year').val(), + card_code: $el.find('#card_code').val() + }; + options = { + success: __bind(function(response) { + this.HideSpinner(); + this.ShowSuccess(t("Credit Card Update Succeeded")); + $("#e" + id).hide(); + $("#d" + id).find(".edit_card_show").html(t("Edit")); + return app.collections.paymentprofiles.trigger("refresh"); + }, this), + error: __bind(function(e) { + this.HideSpinner(); + this.ShowError(t("Credit Card Update Failed")); + return $el.removeAttr('disabled'); + }, this) + }; + app.collections.paymentprofiles.models[id].set(attrs); + return app.collections.paymentprofiles.models[id].save({}, options); + }; + CreditCardView.prototype.deleteCard = function(e) { + var $el, id, options; + e.preventDefault(); + $el = $(e.currentTarget).parents("td"); + id = $el.parents("tr").attr("id").substring(1); + this.ClearGlobalStatus(); + this.ShowSpinner('submit'); + options = { + success: __bind(function(response) { + this.ShowSuccess(t("Credit Card Delete Succeeded")); + $("form").hide(); + app.collections.paymentprofiles.trigger("refresh"); + return $('section').html(app.views.clients.billing.render().el); + }, this), + error: __bind(function(xhr, e) { + this.HideSpinner(); + return this.ShowError(t("Credit Card Delete Failed")); + }, this) + }; + return app.collections.paymentprofiles.models[id].destroy(options); + }; + CreditCardView.prototype.saveUseCase = function(e) { + var $el, attrs, id, options, use_case; + this.ClearGlobalStatus(); + $el = $(e.currentTarget); + use_case = $el.val(); + id = $el.parents("tr").attr("id").substring(1); + attrs = { + use_case: use_case + }; + options = { + success: __bind(function(response) { + return this.ShowSuccess(t("Credit Card Update Category Succeeded")); + }, this), + error: __bind(function(e) { + return this.ShowError(t("Credit Card Update Category Failed")); + }, this) + }; + app.collections.paymentprofiles.models[id].set(attrs); + return app.collections.paymentprofiles.models[id].save({}, options); + }; + CreditCardView.prototype.makeDefault = function(e) { + var $el, attrs, id, options; + e.preventDefault(); + this.ClearGlobalStatus(); + $el = $(e.currentTarget).parents("td"); + id = $el.parents("tr").attr("id").substring(1); + attrs = { + "default": true + }; + options = { + success: __bind(function(response) { + this.ShowSuccess(t("Credit Card Update Default Succeeded")); + return app.collections.paymentprofiles.trigger("refresh"); + }, this), + error: __bind(function(e) { + return this.ShowError(t("Credit Card Update Default Failed")); + }, this) + }; + app.collections.paymentprofiles.models[id].set(attrs); + return app.collections.paymentprofiles.models[id].save({}, options); + }; + return CreditCardView; + })(); +}).call(this); +}, "views/clients/promotions": function(exports, require, module) {(function() { + var clientsPromotionsTemplate; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }; + clientsPromotionsTemplate = require('templates/clients/promotions'); + exports.ClientsPromotionsView = (function() { + __extends(ClientsPromotionsView, UberView); + function ClientsPromotionsView() { + this.render = __bind(this.render, this); + ClientsPromotionsView.__super__.constructor.apply(this, arguments); + } + ClientsPromotionsView.prototype.id = 'promotions_view'; + ClientsPromotionsView.prototype.className = 'view_container'; + ClientsPromotionsView.prototype.events = { + 'submit form': 'submitPromo', + 'click button': 'submitPromo' + }; + ClientsPromotionsView.prototype.initialize = function() { + if (this.model) { + return this.RefreshUserInfo(this.render); + } + }; + ClientsPromotionsView.prototype.render = function() { + var renderTemplate; + this.ReadUserInfo(); + renderTemplate = __bind(function() { + $(this.el).html(clientsPromotionsTemplate({ + promos: window.USER.unexpired_client_promotions || [] + })); + return this.HideSpinner(); + }, this); + this.DownloadUserPromotions(renderTemplate); + return this; + }; + ClientsPromotionsView.prototype.submitPromo = function(e) { + var attrs, model, options, refreshTable; + e.preventDefault(); + this.ClearGlobalStatus(); + refreshTable = __bind(function() { + $('section').html(this.render().el); + return this.HideSpinner(); + }, this); + attrs = { + code: $('#code').val() + }; + options = { + success: __bind(function(response) { + this.HideSpinner(); + if (response.get('first_name')) { + return this.ShowSuccess("Your promotion has been applied in the form of an account credit. Click here to check your balance."); + } else { + this.ShowSuccess("Your promotion has successfully been applied"); + return this.RefreshUserInfo(this.render, true); + } + }, this), + statusCode: { + 400: __bind(function(e) { + this.ShowError(JSON.parse(e.responseText).error); + return this.HideSpinner(); + }, this) + } + }; + this.ShowSpinner("submit"); + model = new app.models.promotions; + return model.save(attrs, options); + }; + return ClientsPromotionsView; + })(); +}).call(this); +}, "views/clients/request": function(exports, require, module) {(function() { + var clientsRequestTemplate; + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = Object.prototype.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; + }; + clientsRequestTemplate = require('templates/clients/request'); + exports.ClientsRequestView = (function() { + __extends(ClientsRequestView, UberView); + function ClientsRequestView() { + this.AjaxCall = __bind(this.AjaxCall, this); + this.AskDispatch = __bind(this.AskDispatch, this); + this.removeMarkers = __bind(this.removeMarkers, this); + this.displaySearchLoc = __bind(this.displaySearchLoc, this); + this.displayFavLoc = __bind(this.displayFavLoc, this); + this.showFavLoc = __bind(this.showFavLoc, this); + this.addToFavLoc = __bind(this.addToFavLoc, this); + this.removeCabs = __bind(this.removeCabs, this); + this.requestRide = __bind(this.requestRide, this); + this.rateTrip = __bind(this.rateTrip, this); + this.locationChange = __bind(this.locationChange, this); + this.panToLocation = __bind(this.panToLocation, this); + this.clickLocation = __bind(this.clickLocation, this); + this.searchLocation = __bind(this.searchLocation, this); + this.mouseoutLocation = __bind(this.mouseoutLocation, this); + this.mouseoverLocation = __bind(this.mouseoverLocation, this); + this.fetchTripDetails = __bind(this.fetchTripDetails, this); + this.submitRating = __bind(this.submitRating, this); + this.setStatus = __bind(this.setStatus, this); + this.initialize = __bind(this.initialize, this); + ClientsRequestView.__super__.constructor.apply(this, arguments); + } + ClientsRequestView.prototype.id = 'request_view'; + ClientsRequestView.prototype.className = 'view_container'; + ClientsRequestView.prototype.pollInterval = 2 * 1000; + ClientsRequestView.prototype.events = { + "submit #search_form": "searchAddress", + "click .locations_link": "locationLinkHandle", + "mouseover .location_row": "mouseoverLocation", + "mouseout .location_row": "mouseoutLocation", + "click .location_row": "clickLocation", + "click #search_location": "searchLocation", + "click #pickupHandle": "pickupHandle", + "click .stars": "rateTrip", + "submit #rating_form": "submitRating", + "click #addToFavButton": "showFavLoc", + "click #favLocNickname": "selectInputText", + "submit #favLoc_form": "addToFavLoc" + }; + ClientsRequestView.prototype.status = ""; + ClientsRequestView.prototype.pickupMarker = "https://uber-static.s3.amazonaws.com/pickup_marker.png"; + ClientsRequestView.prototype.cabMarker = "https://uber-static.s3.amazonaws.com/cab_marker.png"; + ClientsRequestView.prototype.initialize = function() { + var displayCabs; + displayCabs = __bind(function() { + return this.AskDispatch("NearestCab"); + }, this); + this.showCabs = _.throttle(displayCabs, this.pollInterval); + return this.numSearchToDisplay = 1; + }; + ClientsRequestView.prototype.setStatus = function(status) { + var autocomplete; + if (this.status === status) { + return; + } + try { + google.maps.event.trigger(this.map, 'resize'); + } catch (_e) {} + switch (status) { + case "init": + this.AskDispatch("StatusClient"); + this.status = "init"; + return this.ShowSpinner("load"); + case "ready": + this.HideSpinner(); + $(".panel").hide(); + $("#top_bar").fadeIn(); + $("#location_panel").fadeIn(); + $("#location_panel_control").fadeIn(); + $("#pickupHandle").attr("class", "button_green").fadeIn().find("span").html(t("Request Pickup")); + this.pickup_icon.setDraggable(true); + this.map.panTo(this.pickup_icon.getPosition()); + this.showCabs(); + try { + this.pickup_icon.setMap(this.map); + this.displayFavLoc(); + autocomplete = new google.maps.places.Autocomplete(document.getElementById('address'), { + types: ['geocode'] + }); + autocomplete.bindTo('bounds', this.map); + } catch (_e) {} + return this.status = "ready"; + case "searching": + this.HideSpinner(); + this.removeMarkers(); + $(".panel").hide(); + $("#top_bar").fadeOut(); + $("#status_message").html(t("Requesting Closest Driver")); + $("#pickupHandle").attr("class", "button_red").fadeIn().find("span").html(t("Cancel Pickup")); + this.pickup_icon.setDraggable(false); + this.pickup_icon.setMap(this.map); + return this.status = "searching"; + case "waiting": + this.HideSpinner(); + this.removeMarkers(); + $(".panel").hide(); + $("#top_bar").fadeOut(); + $("#pickupHandle").attr("class", "button_red").fadeIn().find("span").html(t("Cancel Pickup")); + $("#waiting_riding").fadeIn(); + this.pickup_icon.setDraggable(false); + this.pickup_icon.setMap(this.map); + return this.status = "waiting"; + case "arriving": + this.HideSpinner(); + this.removeMarkers(); + $(".panel").hide(); + $("#top_bar").fadeOut(); + $("#pickupHandle").attr("class", "button_red").fadeIn().find("span").html(t("Cancel Pickup")); + $("#waiting_riding").fadeIn(); + this.pickup_icon.setDraggable(false); + this.pickup_icon.setMap(this.map); + return this.status = "arriving"; + case "riding": + this.HideSpinner(); + this.removeMarkers(); + $(".panel").hide(); + $("#top_bar").fadeOut(); + $("#pickupHandle").fadeIn().attr("class", "button_red").find("span").html(t("Cancel Pickup")); + $("#waiting_riding").fadeIn(); + this.pickup_icon.setDraggable(false); + this.status = "riding"; + return $("#status_message").html(t("En Route")); + case "rate": + this.HideSpinner(); + $(".panel").hide(); + $("#pickupHandle").fadeOut(); + $("#trip_completed_panel").fadeIn(); + $('#status_message').html(t("Rate Last Trip")); + return this.status = "rate"; + } + }; + ClientsRequestView.prototype.render = function() { + this.ReadUserInfo(); + this.HideSpinner(); + this.ShowSpinner("load"); + $(this.el).html(clientsRequestTemplate()); + this.cabs = []; + this.RequireMaps(__bind(function() { + var center, myOptions, streetViewPano; + center = new google.maps.LatLng(37.7749295, -122.4194155); + this.markers = []; + this.pickup_icon = new google.maps.Marker({ + position: center, + draggable: true, + clickable: true, + icon: this.pickupMarker + }); + this.geocoder = new google.maps.Geocoder(); + myOptions = { + zoom: 12, + center: center, + mapTypeId: google.maps.MapTypeId.ROADMAP, + rotateControl: false, + rotateControl: false, + panControl: false + }; + this.map = new google.maps.Map($(this.el).find("#map_wrapper_right")[0], myOptions); + if (this.status === "ready") { + this.pickup_icon.setMap(this.map); + } + if (geo_position_js.init()) { + geo_position_js.getCurrentPosition(__bind(function(data) { + var location; + location = new google.maps.LatLng(data.coords.latitude, data.coords.longitude); + this.pickup_icon.setPosition(location); + this.map.panTo(location); + return this.map.setZoom(16); + }, this)); + } + this.setStatus("init"); + streetViewPano = this.map.getStreetView(); + google.maps.event.addListener(streetViewPano, 'visible_changed', __bind(function() { + if (streetViewPano.getVisible()) { + this.pickupMarker = "https://uber-static.s3.amazonaws.com/pickup_marker_large.png"; + this.cabMarker = "https://uber-static.s3.amazonaws.com/cab_marker_large.png"; + } else { + this.pickupMarker = "https://uber-static.s3.amazonaws.com/pickup_marker.png"; + this.cabMarker = "https://uber-static.s3.amazonaws.com/cab_marker.png"; + } + this.pickup_icon.setIcon(this.pickupMarker); + return _.each(this.cabs, __bind(function(cab) { + return cab.setIcon(this.cabMarker); + }, this)); + }, this)); + if (this.status === "ready") { + return this.displayFavLoc(); + } + }, this)); + return this; + }; + ClientsRequestView.prototype.submitRating = function(e) { + var $el, message, rating; + e.preventDefault(); + $el = $(e.currentTarget); + rating = 0; + _(5).times(function(num) { + if ($el.find(".stars#" + (num + 1)).attr("src") === "/web/img/star_active.png") { + return rating = num + 1; + } + }); + if (rating === 0) { + $("#status_message").html("").html(t("Rate Before Submitting")); + } else { + this.ShowSpinner("submit"); + this.AskDispatch("RatingDriver", { + rating: rating + }); + } + message = $el.find("#comments").val().toString(); + if (message.length > 5) { + return this.AskDispatch("Feedback", { + message: message + }); + } + }; + ClientsRequestView.prototype.fetchTripDetails = function(id) { + var trip; + trip = new app.models.trip({ + id: id + }); + return trip.fetch({ + data: { + relationships: 'points,driver,city' + }, + dataType: 'json', + success: __bind(function() { + var bounds, endPos, path, polyline, startPos; + bounds = new google.maps.LatLngBounds(); + path = []; + _.each(trip.get('points'), __bind(function(point) { + path.push(new google.maps.LatLng(point.lat, point.lng)); + return bounds.extend(_.last(path)); + }, this)); + startPos = new google.maps.Marker({ + position: _.first(path), + map: this.map, + title: t("Trip started here"), + icon: 'https://uber-static.s3.amazonaws.com/carstart.png' + }); + endPos = new google.maps.Marker({ + position: _.last(path), + map: this.map, + title: t("Trip ended here"), + icon: 'https://uber-static.s3.amazonaws.com/carstop.png' + }); + polyline = new google.maps.Polyline({ + path: path, + strokeColor: '#003F87', + strokeOpacity: 1, + strokeWeight: 5 + }); + polyline.setMap(this.map); + this.map.fitBounds(bounds); + $("#tripTime").html(app.helpers.parseDateTime(trip.get('pickup_local_time'), trip.get('city.timezone'))); + $("#tripDist").html(app.helpers.RoundNumber(trip.get('distance'), 2)); + $("#tripDur").html(app.helpers.FormatSeconds(trip.get('duration'))); + return $("#tripFare").html(app.helpers.FormatCurrency(trip.get('fare'))); + }, this) + }); + }; + ClientsRequestView.prototype.searchAddress = function(e) { + var $locationsDiv, address, alphabet, bounds, showResults; + alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + try { + e.preventDefault(); + } catch (_e) {} + $('.error_message').html(""); + $locationsDiv = $("
"); + address = $('#address').val(); + bounds = new google.maps.LatLngBounds(); + if (address.length < 5) { + $('#status_message').html(t("Address too short")).fadeIn(); + return false; + } + showResults = __bind(function(address, index) { + var first_cell, row, second_cell; + if (index < this.numSearchToDisplay) { + first_cell = "
" + address.formatted_address + "
" + (t('or did you mean')) + "
" + address.formatted_address + "
+ + + + + + +
Rod VaggGitHub/rvaggTwitter/@rvagg
Benjamin ByholmGitHub/kkoopa
Trevor NorrisGitHub/trevnorrisTwitter/@trevnorris
Nathan RajlichGitHub/TooTallNateTwitter/@TooTallNate
Brett LawsonGitHub/brett19Twitter/@brett19x
Ben NoordhuisGitHub/bnoordhuisTwitter/@bnoordhuis
+ +Licence & copyright +----------------------- + +Copyright (c) 2014 NAN contributors (listed above). + +Native Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/build/config.gypi b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/build/config.gypi new file mode 100644 index 00000000..e085a500 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/build/config.gypi @@ -0,0 +1,38 @@ +# Do not edit. File was generated by node-gyp's "configure" step +{ + "target_defaults": { + "cflags": [], + "default_configuration": "Release", + "defines": [], + "include_dirs": [], + "libraries": [] + }, + "variables": { + "clang": 0, + "gcc_version": 47, + "host_arch": "x64", + "node_install_npm": "true", + "node_prefix": "", + "node_shared_cares": "false", + "node_shared_http_parser": "false", + "node_shared_libuv": "false", + "node_shared_openssl": "false", + "node_shared_v8": "false", + "node_shared_zlib": "false", + "node_tag": "", + "node_unsafe_optimizations": 0, + "node_use_dtrace": "false", + "node_use_etw": "false", + "node_use_openssl": "true", + "node_use_perfctr": "false", + "node_use_systemtap": "false", + "python": "/usr/bin/python", + "target_arch": "x64", + "v8_enable_gdbjit": 0, + "v8_no_strict_aliasing": 1, + "v8_use_snapshot": "true", + "nodedir": "/home/rvagg/.node-gyp/0.10.21", + "copy_dev_lib": "true", + "standalone_static_library": 1 + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/include_dirs.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/include_dirs.js new file mode 100644 index 00000000..4f1dfb41 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/include_dirs.js @@ -0,0 +1 @@ +console.log(require('path').relative('.', __dirname)); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/nan.h b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/nan.h new file mode 100644 index 00000000..bc544f53 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/nan.h @@ -0,0 +1,1910 @@ +/********************************************************************************** + * NAN - Native Abstractions for Node.js + * + * Copyright (c) 2014 NAN contributors: + * - Rod Vagg + * - Benjamin Byholm + * - Trevor Norris + * - Nathan Rajlich + * - Brett Lawson + * - Ben Noordhuis + * + * MIT +no-false-attribs License + * + * Version 1.0.0 (current Node unstable: 0.11.13, Node stable: 0.10.28) + * + * ChangeLog: + * * 1.0.0 May 4 2014 + * - Heavy API changes for V8 3.25 / Node 0.11.13 + * - Use cpplint.py + * - Removed NanInitPersistent + * - Removed NanPersistentToLocal + * - Removed NanFromV8String + * - Removed NanMakeWeak + * - Removed NanNewLocal + * - Removed NAN_WEAK_CALLBACK_OBJECT + * - Removed NAN_WEAK_CALLBACK_DATA + * - Introduce NanNew, replaces NanNewLocal, NanPersistentToLocal, adds many overloaded typed versions + * - Introduce NanUndefined, NanNull, NanTrue and NanFalse + * - Introduce NanEscapableScope and NanEscapeScope + * - Introduce NanMakeWeakPersistent (requires a special callback to work on both old and new node) + * - Introduce NanMakeCallback for node::MakeCallback + * - Introduce NanSetTemplate + * - Introduce NanGetCurrentContext + * - Introduce NanCompileScript and NanRunScript + * - Introduce NanAdjustExternalMemory + * - Introduce NanAddGCEpilogueCallback, NanAddGCPrologueCallback, NanRemoveGCEpilogueCallback, NanRemoveGCPrologueCallback + * - Introduce NanGetHeapStatistics + * - Rename NanAsyncWorker#SavePersistent() to SaveToPersistent() + * + * * 0.8.0 Jan 9 2014 + * - NanDispose -> NanDisposePersistent, deprecate NanDispose + * - Extract _NAN_*_RETURN_TYPE, pull up NAN_*() + * + * * 0.7.1 Jan 9 2014 + * - Fixes to work against debug builds of Node + * - Safer NanPersistentToLocal (avoid reinterpret_cast) + * - Speed up common NanRawString case by only extracting flattened string when necessary + * + * * 0.7.0 Dec 17 2013 + * - New no-arg form of NanCallback() constructor. + * - NanCallback#Call takes Handle rather than Local + * - Removed deprecated NanCallback#Run method, use NanCallback#Call instead + * - Split off _NAN_*_ARGS_TYPE from _NAN_*_ARGS + * - Restore (unofficial) Node 0.6 compatibility at NanCallback#Call() + * - Introduce NanRawString() for char* (or appropriate void*) from v8::String + * (replacement for NanFromV8String) + * - Introduce NanCString() for null-terminated char* from v8::String + * + * * 0.6.0 Nov 21 2013 + * - Introduce NanNewLocal(v8::Handle value) for use in place of + * v8::Local::New(...) since v8 started requiring isolate in Node 0.11.9 + * + * * 0.5.2 Nov 16 2013 + * - Convert SavePersistent and GetFromPersistent in NanAsyncWorker from protected and public + * + * * 0.5.1 Nov 12 2013 + * - Use node::MakeCallback() instead of direct v8::Function::Call() + * + * * 0.5.0 Nov 11 2013 + * - Added @TooTallNate as collaborator + * - New, much simpler, "include_dirs" for binding.gyp + * - Added full range of NAN_INDEX_* macros to match NAN_PROPERTY_* macros + * + * * 0.4.4 Nov 2 2013 + * - Isolate argument from v8::Persistent::MakeWeak removed for 0.11.8+ + * + * * 0.4.3 Nov 2 2013 + * - Include node_object_wrap.h, removed from node.h for Node 0.11.8. + * + * * 0.4.2 Nov 2 2013 + * - Handle deprecation of v8::Persistent::Dispose(v8::Isolate* isolate)) for + * Node 0.11.8 release. + * + * * 0.4.1 Sep 16 2013 + * - Added explicit `#include ` as it was removed from node.h for v0.11.8 + * + * * 0.4.0 Sep 2 2013 + * - Added NAN_INLINE and NAN_DEPRECATED and made use of them + * - Added NanError, NanTypeError and NanRangeError + * - Cleaned up code + * + * * 0.3.2 Aug 30 2013 + * - Fix missing scope declaration in GetFromPersistent() and SaveToPersistent + * in NanAsyncWorker + * + * * 0.3.1 Aug 20 2013 + * - fix "not all control paths return a value" compile warning on some platforms + * + * * 0.3.0 Aug 19 2013 + * - Made NAN work with NPM + * - Lots of fixes to NanFromV8String, pulling in features from new Node core + * - Changed node::encoding to Nan::Encoding in NanFromV8String to unify the API + * - Added optional error number argument for NanThrowError() + * - Added NanInitPersistent() + * - Added NanReturnNull() and NanReturnEmptyString() + * - Added NanLocker and NanUnlocker + * - Added missing scopes + * - Made sure to clear disposed Persistent handles + * - Changed NanAsyncWorker to allocate error messages on the heap + * - Changed NanThrowError(Local) to NanThrowError(Handle) + * - Fixed leak in NanAsyncWorker when errmsg is used + * + * * 0.2.2 Aug 5 2013 + * - Fixed usage of undefined variable with node::BASE64 in NanFromV8String() + * + * * 0.2.1 Aug 5 2013 + * - Fixed 0.8 breakage, node::BUFFER encoding type not available in 0.8 for + * NanFromV8String() + * + * * 0.2.0 Aug 5 2013 + * - Added NAN_PROPERTY_GETTER, NAN_PROPERTY_SETTER, NAN_PROPERTY_ENUMERATOR, + * NAN_PROPERTY_DELETER, NAN_PROPERTY_QUERY + * - Extracted _NAN_METHOD_ARGS, _NAN_GETTER_ARGS, _NAN_SETTER_ARGS, + * _NAN_PROPERTY_GETTER_ARGS, _NAN_PROPERTY_SETTER_ARGS, + * _NAN_PROPERTY_ENUMERATOR_ARGS, _NAN_PROPERTY_DELETER_ARGS, + * _NAN_PROPERTY_QUERY_ARGS + * - Added NanGetInternalFieldPointer, NanSetInternalFieldPointer + * - Added NAN_WEAK_CALLBACK, NAN_WEAK_CALLBACK_OBJECT, + * NAN_WEAK_CALLBACK_DATA, NanMakeWeak + * - Renamed THROW_ERROR to _NAN_THROW_ERROR + * - Added NanNewBufferHandle(char*, size_t, node::smalloc::FreeCallback, void*) + * - Added NanBufferUse(char*, uint32_t) + * - Added NanNewContextHandle(v8::ExtensionConfiguration*, + * v8::Handle, v8::Handle) + * - Fixed broken NanCallback#GetFunction() + * - Added optional encoding and size arguments to NanFromV8String() + * - Added NanGetPointerSafe() and NanSetPointerSafe() + * - Added initial test suite (to be expanded) + * - Allow NanUInt32OptionValue to convert any Number object + * + * * 0.1.0 Jul 21 2013 + * - Added `NAN_GETTER`, `NAN_SETTER` + * - Added `NanThrowError` with single Local argument + * - Added `NanNewBufferHandle` with single uint32_t argument + * - Added `NanHasInstance(Persistent&, Handle)` + * - Added `Local NanCallback#GetFunction()` + * - Added `NanCallback#Call(int, Local[])` + * - Deprecated `NanCallback#Run(int, Local[])` in favour of Call + * + * See https://github.com/rvagg/nan for the latest update to this file + **********************************************************************************/ + +#ifndef NAN_H_ +#define NAN_H_ + +#include +#include +#include +#include +#include +#include + +#if defined(__GNUC__) && !defined(DEBUG) +# define NAN_INLINE inline __attribute__((always_inline)) +#elif defined(_MSC_VER) && !defined(DEBUG) +# define NAN_INLINE __forceinline +#else +# define NAN_INLINE inline +#endif + +#if defined(__GNUC__) && !V8_DISABLE_DEPRECATIONS +# define NAN_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) && !V8_DISABLE_DEPRECATIONS +# define NAN_DEPRECATED __declspec(deprecated) +#else +# define NAN_DEPRECATED +#endif + +// some generic helpers + +template NAN_INLINE bool NanSetPointerSafe( + T *var + , T val +) { + if (var) { + *var = val; + return true; + } else { + return false; + } +} + +template NAN_INLINE T NanGetPointerSafe( + T *var + , T fallback = reinterpret_cast(0) +) { + if (var) { + return *var; + } else { + return fallback; + } +} + +NAN_INLINE bool NanBooleanOptionValue( + v8::Local optionsObj + , v8::Handle opt, bool def +) { + if (def) { + return optionsObj.IsEmpty() + || !optionsObj->Has(opt) + || optionsObj->Get(opt)->BooleanValue(); + } else { + return !optionsObj.IsEmpty() + && optionsObj->Has(opt) + && optionsObj->Get(opt)->BooleanValue(); + } +} + +NAN_INLINE bool NanBooleanOptionValue( + v8::Local optionsObj + , v8::Handle opt +) { + return NanBooleanOptionValue(optionsObj, opt, false); +} + +NAN_INLINE uint32_t NanUInt32OptionValue( + v8::Local optionsObj + , v8::Handle opt + , uint32_t def +) { + return !optionsObj.IsEmpty() + && optionsObj->Has(opt) + && optionsObj->Get(opt)->IsNumber() + ? optionsObj->Get(opt)->Uint32Value() + : def; +} + +#if (NODE_MODULE_VERSION > 0x000B) +// Node 0.11+ (0.11.3 and below won't compile with these) + +# define _NAN_METHOD_ARGS_TYPE const v8::FunctionCallbackInfo& +# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args +# define _NAN_METHOD_RETURN_TYPE void + +# define _NAN_GETTER_ARGS_TYPE const v8::PropertyCallbackInfo& +# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args +# define _NAN_GETTER_RETURN_TYPE void + +# define _NAN_SETTER_ARGS_TYPE const v8::PropertyCallbackInfo& +# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args +# define _NAN_SETTER_RETURN_TYPE void + +# define _NAN_PROPERTY_GETTER_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args +# define _NAN_PROPERTY_GETTER_RETURN_TYPE void + +# define _NAN_PROPERTY_SETTER_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args +# define _NAN_PROPERTY_SETTER_RETURN_TYPE void + +# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args +# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE void + +# define _NAN_PROPERTY_DELETER_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_PROPERTY_DELETER_ARGS \ + _NAN_PROPERTY_DELETER_ARGS_TYPE args +# define _NAN_PROPERTY_DELETER_RETURN_TYPE void + +# define _NAN_PROPERTY_QUERY_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args +# define _NAN_PROPERTY_QUERY_RETURN_TYPE void + +# define _NAN_INDEX_GETTER_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args +# define _NAN_INDEX_GETTER_RETURN_TYPE void + +# define _NAN_INDEX_SETTER_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args +# define _NAN_INDEX_SETTER_RETURN_TYPE void + +# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args +# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE void + +# define _NAN_INDEX_DELETER_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args +# define _NAN_INDEX_DELETER_RETURN_TYPE void + +# define _NAN_INDEX_QUERY_ARGS_TYPE \ + const v8::PropertyCallbackInfo& +# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args +# define _NAN_INDEX_QUERY_RETURN_TYPE void + +typedef v8::FunctionCallback NanFunctionCallback; +static v8::Isolate* nan_isolate = v8::Isolate::GetCurrent(); + +# define NanUndefined() v8::Undefined(nan_isolate) +# define NanNull() v8::Null(nan_isolate) +# define NanTrue() v8::True(nan_isolate) +# define NanFalse() v8::False(nan_isolate) +# define NanAdjustExternalMemory(amount) \ + nan_isolate->AdjustAmountOfExternalAllocatedMemory(amount) +# define NanSetTemplate(templ, name, value) templ->Set(nan_isolate, name, value) +# define NanGetCurrentContext() nan_isolate->GetCurrentContext() +# define NanMakeCallback(target, func, argc, argv) \ + node::MakeCallback(nan_isolate, target, func, argc, argv) +# define NanGetInternalFieldPointer(object, index) \ + object->GetAlignedPointerFromInternalField(index) +# define NanSetInternalFieldPointer(object, index, value) \ + object->SetAlignedPointerInInternalField(index, value) + + template + NAN_INLINE v8::Local NanNew() { + return T::New(nan_isolate); + } + + template + NAN_INLINE v8::Local NanNew(P arg1) { + return T::New(nan_isolate, arg1); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Handle receiver + , int argc + , v8::Handle argv[] = 0) { + return v8::Signature::New(nan_isolate, receiver, argc, argv); + } + + template + NAN_INLINE v8::Local NanNew( + NanFunctionCallback callback + , v8::Handle data = v8::Handle() + , v8::Handle signature = v8::Handle()) { + return T::New(nan_isolate, callback, data, signature); + } + + template + NAN_INLINE v8::Local NanNew(v8::Handle arg1) { + return v8::Local::New(nan_isolate, arg1); + } + + template + NAN_INLINE v8::Local NanNew(const v8::Persistent &arg1) { + return v8::Local::New(nan_isolate, arg1); + } + + template + NAN_INLINE v8::Local NanNew(P arg1, int arg2) { + return T::New(nan_isolate, arg1, arg2); + } + + template<> + NAN_INLINE v8::Local NanNew() { + return v8::Array::New(nan_isolate); + } + + template<> + NAN_INLINE v8::Local NanNew(int length) { + return v8::Array::New(nan_isolate, length); + } + + template<> + NAN_INLINE v8::Local NanNew(double time) { + return v8::Date::New(nan_isolate, time).As(); + } + + template<> + NAN_INLINE v8::Local NanNew(int time) { + return v8::Date::New(nan_isolate, time).As(); + } + + typedef v8::UnboundScript NanUnboundScript; + typedef v8::Script NanBoundScript; + + template + NAN_INLINE v8::Local NanNew( + P s + , const v8::ScriptOrigin& origin + ) { + v8::ScriptCompiler::Source source(s, origin); + return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source); + } + + template<> + NAN_INLINE v8::Local NanNew( + v8::Local s + ) { + v8::ScriptCompiler::Source source(s); + return v8::ScriptCompiler::CompileUnbound(nan_isolate, &source); + } + + NAN_INLINE v8::Local NanNew( + v8::String::ExternalStringResource *resource) { + return v8::String::NewExternal(nan_isolate, resource); + } + + NAN_INLINE v8::Local NanNew( + v8::String::ExternalAsciiStringResource *resource) { + return v8::String::NewExternal(nan_isolate, resource); + } + + template<> + NAN_INLINE v8::Local NanNew(bool value) { + return v8::BooleanObject::New(value).As(); + } + + template<> + NAN_INLINE v8::Local + NanNew >( + v8::Local value) { + return v8::StringObject::New(value).As(); + } + + template<> + NAN_INLINE v8::Local + NanNew >( + v8::Handle value) { + return v8::StringObject::New(value).As(); + } + + template<> + NAN_INLINE v8::Local NanNew(double val) { + return v8::NumberObject::New(nan_isolate, val).As(); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Handle pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Local pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Handle pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Local pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template<> + NAN_INLINE v8::Local NanNew(int32_t val) { + return v8::Uint32::NewFromUnsigned(nan_isolate, val)->ToUint32(); + } + + template<> + NAN_INLINE v8::Local NanNew(uint32_t val) { + return v8::Uint32::NewFromUnsigned(nan_isolate, val)->ToUint32(); + } + + template<> + NAN_INLINE v8::Local NanNew(int32_t val) { + return v8::Int32::New(nan_isolate, val)->ToInt32(); + } + + template<> + NAN_INLINE v8::Local NanNew(uint32_t val) { + return v8::Int32::New(nan_isolate, val)->ToInt32(); + } + + template<> + NAN_INLINE v8::Local NanNew( + char *arg + , int length) { + return v8::String::NewFromUtf8( + nan_isolate + , arg + , v8::String::kNormalString + , length); + } + + template<> + NAN_INLINE v8::Local NanNew( + const char *arg + , int length) { + return v8::String::NewFromUtf8( + nan_isolate + , arg + , v8::String::kNormalString + , length); + } + + template<> + NAN_INLINE v8::Local NanNew(char *arg) { + return v8::String::NewFromUtf8(nan_isolate, arg); + } + + template<> + NAN_INLINE v8::Local NanNew( + const char *arg) { + return v8::String::NewFromUtf8(nan_isolate, arg); + } + + template<> + NAN_INLINE v8::Local NanNew( + uint8_t *arg + , int length) { + return v8::String::NewFromOneByte( + nan_isolate + , arg + , v8::String::kNormalString + , length); + } + + template<> + NAN_INLINE v8::Local NanNew( + const uint8_t *arg + , int length) { + return v8::String::NewFromOneByte( + nan_isolate + , arg + , v8::String::kNormalString + , length); + } + + template<> + NAN_INLINE v8::Local NanNew(uint8_t *arg) { + return v8::String::NewFromOneByte(nan_isolate, arg); + } + + template<> + NAN_INLINE v8::Local NanNew( + const uint8_t *arg) { + return v8::String::NewFromOneByte(nan_isolate, arg); + } + + template<> + NAN_INLINE v8::Local NanNew( + uint16_t *arg + , int length) { + return v8::String::NewFromTwoByte( + nan_isolate + , arg + , v8::String::kNormalString + , length); + } + + template<> + NAN_INLINE v8::Local NanNew( + const uint16_t *arg + , int length) { + return v8::String::NewFromTwoByte( + nan_isolate + , arg + , v8::String::kNormalString + , length); + } + template<> + NAN_INLINE v8::Local NanNew( + uint16_t *arg) { + return v8::String::NewFromTwoByte(nan_isolate, arg); + } + + template<> + NAN_INLINE v8::Local NanNew( + const uint16_t *arg) { + return v8::String::NewFromTwoByte(nan_isolate, arg); + } + + template<> + NAN_INLINE v8::Local NanNew() { + return v8::String::Empty(nan_isolate); + } + + NAN_INLINE void NanAddGCEpilogueCallback( + v8::Isolate::GCEpilogueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + nan_isolate->AddGCEpilogueCallback(callback, gc_type_filter); + } + + NAN_INLINE void NanRemoveGCEpilogueCallback( + v8::Isolate::GCEpilogueCallback callback) { + nan_isolate->RemoveGCEpilogueCallback(callback); + } + + NAN_INLINE void NanAddGCPrologueCallback( + v8::Isolate::GCPrologueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + nan_isolate->AddGCPrologueCallback(callback, gc_type_filter); + } + + NAN_INLINE void NanRemoveGCPrologueCallback( + v8::Isolate::GCPrologueCallback callback) { + nan_isolate->RemoveGCPrologueCallback(callback); + } + + NAN_INLINE void NanGetHeapStatistics( + v8::HeapStatistics *heap_statistics) { + nan_isolate->GetHeapStatistics(heap_statistics); + } + +# define NanSymbol(value) NanNew(value) + + template + NAN_INLINE void NanAssignPersistent( + v8::Persistent& handle + , v8::Handle obj) { + handle.Reset(nan_isolate, obj); + } + + template + NAN_INLINE void NanAssignPersistent( + v8::Persistent& handle + , const v8::Persistent& obj) { + handle.Reset(nan_isolate, obj); + } + + template + struct _NanWeakCallbackInfo { + typedef void (*Callback)( + const v8::WeakCallbackData >& data); + _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) + : parameter(param), callback(cb) { + NanAssignPersistent(persistent, handle); + } + + ~_NanWeakCallbackInfo() { + persistent.Reset(); + } + + P* const parameter; + Callback const callback; + v8::Persistent persistent; + }; + + template + class _NanWeakCallbackData { + public: + _NanWeakCallbackData(_NanWeakCallbackInfo *info) + : info_(info) { } + + NAN_INLINE v8::Local GetValue() const { + return NanNew(info_->persistent); + } + NAN_INLINE P* GetParameter() const { return info_->parameter; } + NAN_INLINE void Revive() const { + info_->persistent.SetWeak(info_, info_->callback); + } + + NAN_INLINE void Dispose() const { + delete info_; + } + + private: + _NanWeakCallbackInfo* info_; + }; + +// do not use for declaration +# define NAN_WEAK_CALLBACK(name) \ + template \ + static void name( \ + const v8::WeakCallbackData > &data) { \ + _NanWeakCallbackData wcbd( \ + data.GetParameter()); \ + _Nan_Weak_Callback_ ## name(wcbd); \ + } \ + \ + template \ + NAN_INLINE void _Nan_Weak_Callback_ ## name( \ + const _NanWeakCallbackData &data) + +# define NanScope() v8::HandleScope scope(nan_isolate) +# define NanEscapableScope() v8::EscapableHandleScope scope(nan_isolate) +# define NanEscapeScope(val) scope.Escape(val) +# define NanLocker() v8::Locker locker(nan_isolate) +# define NanUnlocker() v8::Unlocker unlocker(nan_isolate) +# define NanReturnValue(value) return args.GetReturnValue().Set(value) +# define NanReturnUndefined() return +# define NanReturnNull() return args.GetReturnValue().SetNull() +# define NanReturnEmptyString() return args.GetReturnValue().SetEmptyString() + +# define NanObjectWrapHandle(obj) obj->handle() + +template +void NAN_INLINE NanMakeWeakPersistent( + v8::Handle handle + , P* parameter + , typename _NanWeakCallbackInfo::Callback callback) { + _NanWeakCallbackInfo *cbinfo = + new _NanWeakCallbackInfo(handle, parameter, callback); + cbinfo->persistent.SetWeak(cbinfo, callback); +} + +# define _NAN_ERROR(fun, errmsg) fun(NanNew(errmsg)) + +# define _NAN_THROW_ERROR(fun, errmsg) \ + do { \ + NanScope(); \ + nan_isolate->ThrowException(_NAN_ERROR(fun, errmsg)); \ + } while (0); + + NAN_INLINE v8::Local NanError(const char* errmsg) { + return _NAN_ERROR(v8::Exception::Error, errmsg); + } + + NAN_INLINE void NanThrowError(const char* errmsg) { + _NAN_THROW_ERROR(v8::Exception::Error, errmsg); + } + + NAN_INLINE void NanThrowError(v8::Handle error) { + NanScope(); + nan_isolate->ThrowException(error); + } + + NAN_INLINE v8::Local NanError( + const char *msg + , const int errorNumber + ) { + v8::Local err = v8::Exception::Error(NanNew(msg)); + v8::Local obj = err.As(); + obj->Set(NanSymbol("code"), NanNew(errorNumber)); + return err; + } + + NAN_INLINE void NanThrowError( + const char *msg + , const int errorNumber + ) { + NanThrowError(NanError(msg, errorNumber)); + } + + NAN_INLINE v8::Local NanTypeError(const char* errmsg) { + return _NAN_ERROR(v8::Exception::TypeError, errmsg); + } + + NAN_INLINE void NanThrowTypeError(const char* errmsg) { + _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); + } + + NAN_INLINE v8::Local NanRangeError(const char* errmsg) { + return _NAN_ERROR(v8::Exception::RangeError, errmsg); + } + + NAN_INLINE void NanThrowRangeError(const char* errmsg) { + _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); + } + + template NAN_INLINE void NanDisposePersistent( + v8::Persistent &handle + ) { + handle.Reset(); + } + + NAN_INLINE v8::Local NanNewBufferHandle ( + char *data + , size_t length + , node::smalloc::FreeCallback callback + , void *hint + ) { + return node::Buffer::New(nan_isolate, data, length, callback, hint); + } + + NAN_INLINE v8::Local NanNewBufferHandle ( + const char *data + , uint32_t size + ) { + return node::Buffer::New(nan_isolate, data, size); + } + + NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { + return node::Buffer::New(nan_isolate, size); + } + + NAN_INLINE v8::Local NanBufferUse( + char* data + , uint32_t size + ) { + return node::Buffer::Use(nan_isolate, data, size); + } + + NAN_INLINE bool NanHasInstance( + v8::Persistent& function_template + , v8::Handle value + ) { + return NanNew(function_template)->HasInstance(value); + } + + NAN_INLINE v8::Local NanNewContextHandle( + v8::ExtensionConfiguration* extensions = NULL + , v8::Handle tmpl = v8::Handle() + , v8::Handle obj = v8::Handle() + ) { + return v8::Local::New( + nan_isolate + , v8::Context::New(nan_isolate, extensions, tmpl, obj) + ); + } + + NAN_INLINE v8::Local NanCompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + v8::ScriptCompiler::Source source(s, origin); + return v8::ScriptCompiler::Compile(nan_isolate, &source); + } + + NAN_INLINE v8::Local NanCompileScript( + v8::Local s + ) { + v8::ScriptCompiler::Source source(s); + return v8::ScriptCompiler::Compile(nan_isolate, &source); + } + + NAN_INLINE v8::Local NanRunScript( + v8::Local script + ) { + return script->BindToCurrentContext()->Run(); + } + + NAN_INLINE v8::Local NanRunScript( + v8::Local script + ) { + return script->Run(); + } + +#else +// Node 0.8 and 0.10 + +# define _NAN_METHOD_ARGS_TYPE const v8::Arguments& +# define _NAN_METHOD_ARGS _NAN_METHOD_ARGS_TYPE args +# define _NAN_METHOD_RETURN_TYPE v8::Handle + +# define _NAN_GETTER_ARGS_TYPE const v8::AccessorInfo & +# define _NAN_GETTER_ARGS _NAN_GETTER_ARGS_TYPE args +# define _NAN_GETTER_RETURN_TYPE v8::Handle + +# define _NAN_SETTER_ARGS_TYPE const v8::AccessorInfo & +# define _NAN_SETTER_ARGS _NAN_SETTER_ARGS_TYPE args +# define _NAN_SETTER_RETURN_TYPE void + +# define _NAN_PROPERTY_GETTER_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_PROPERTY_GETTER_ARGS _NAN_PROPERTY_GETTER_ARGS_TYPE args +# define _NAN_PROPERTY_GETTER_RETURN_TYPE v8::Handle + +# define _NAN_PROPERTY_SETTER_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_PROPERTY_SETTER_ARGS _NAN_PROPERTY_SETTER_ARGS_TYPE args +# define _NAN_PROPERTY_SETTER_RETURN_TYPE v8::Handle + +# define _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_PROPERTY_ENUMERATOR_ARGS _NAN_PROPERTY_ENUMERATOR_ARGS_TYPE args +# define _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE v8::Handle + +# define _NAN_PROPERTY_DELETER_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_PROPERTY_DELETER_ARGS _NAN_PROPERTY_DELETER_ARGS_TYPE args +# define _NAN_PROPERTY_DELETER_RETURN_TYPE v8::Handle + +# define _NAN_PROPERTY_QUERY_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_PROPERTY_QUERY_ARGS _NAN_PROPERTY_QUERY_ARGS_TYPE args +# define _NAN_PROPERTY_QUERY_RETURN_TYPE v8::Handle + +# define _NAN_INDEX_GETTER_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_INDEX_GETTER_ARGS _NAN_INDEX_GETTER_ARGS_TYPE args +# define _NAN_INDEX_GETTER_RETURN_TYPE v8::Handle + +# define _NAN_INDEX_SETTER_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_INDEX_SETTER_ARGS _NAN_INDEX_SETTER_ARGS_TYPE args +# define _NAN_INDEX_SETTER_RETURN_TYPE v8::Handle + +# define _NAN_INDEX_ENUMERATOR_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_INDEX_ENUMERATOR_ARGS _NAN_INDEX_ENUMERATOR_ARGS_TYPE args +# define _NAN_INDEX_ENUMERATOR_RETURN_TYPE v8::Handle + +# define _NAN_INDEX_DELETER_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_INDEX_DELETER_ARGS _NAN_INDEX_DELETER_ARGS_TYPE args +# define _NAN_INDEX_DELETER_RETURN_TYPE v8::Handle + +# define _NAN_INDEX_QUERY_ARGS_TYPE const v8::AccessorInfo& +# define _NAN_INDEX_QUERY_ARGS _NAN_INDEX_QUERY_ARGS_TYPE args +# define _NAN_INDEX_QUERY_RETURN_TYPE v8::Handle + +typedef v8::InvocationCallback NanFunctionCallback; + +# define NanUndefined() v8::Undefined() +# define NanNull() v8::Null() +# define NanTrue() v8::True() +# define NanFalse() v8::False() +# define NanAdjustExternalMemory(amount) \ + v8::V8::AdjustAmountOfExternalAllocatedMemory(amount) +# define NanSetTemplate(templ, name, value) templ->Set(name, value) +# define NanGetCurrentContext() v8::Context::GetCurrent() +# if NODE_VERSION_AT_LEAST(0, 8, 0) +# define NanMakeCallback(target, func, argc, argv) \ + node::MakeCallback(target, func, argc, argv) +# else +# define NanMakeCallback(target, func, argc, argv) \ + do { \ + v8::TryCatch try_catch; \ + func->Call(target, argc, argv); \ + if (try_catch.HasCaught()) { \ + v8::FatalException(try_catch); \ + } \ + } while (0) +# endif + +# define NanSymbol(value) v8::String::NewSymbol(value) + + template + NAN_INLINE v8::Local NanNew() { + return v8::Local::New(T::New()); + } + + template + NAN_INLINE v8::Local NanNew(v8::Handle arg) { + return v8::Local::New(arg); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Handle receiver + , int argc + , v8::Handle argv[] = 0) { + return v8::Signature::New(receiver, argc, argv); + } + + template + NAN_INLINE v8::Local NanNew( + NanFunctionCallback callback + , v8::Handle data = v8::Handle() + , v8::Handle signature = v8::Handle()) { + return T::New(callback, data, signature); + } + + template + NAN_INLINE v8::Local NanNew(const v8::Persistent &arg) { + return v8::Local::New(arg); + } + + template + NAN_INLINE v8::Local NanNew(P arg) { + return v8::Local::New(T::New(arg)); + } + + template + NAN_INLINE v8::Local NanNew(P arg, int length) { + return v8::Local::New(T::New(arg, length)); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Handle pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Local pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Handle pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template + NAN_INLINE v8::Local NanNew( + v8::Local pattern, v8::RegExp::Flags flags) { + return v8::RegExp::New(pattern, flags); + } + + template<> + NAN_INLINE v8::Local NanNew() { + return v8::Array::New(); + } + + template<> + NAN_INLINE v8::Local NanNew(int length) { + return v8::Array::New(length); + } + + + template<> + NAN_INLINE v8::Local NanNew(double time) { + return v8::Date::New(time).As(); + } + + template<> + NAN_INLINE v8::Local NanNew(int time) { + return v8::Date::New(time).As(); + } + + typedef v8::Script NanUnboundScript; + typedef v8::Script NanBoundScript; + + template + NAN_INLINE v8::Local NanNew( + P s + , const v8::ScriptOrigin& origin + ) { + return v8::Script::New(s, const_cast(&origin)); + } + + template<> + NAN_INLINE v8::Local NanNew( + v8::Local s + ) { + return v8::Script::New(s); + } + + NAN_INLINE v8::Local NanNew( + v8::String::ExternalStringResource *resource) { + return v8::String::NewExternal(resource); + } + + NAN_INLINE v8::Local NanNew( + v8::String::ExternalAsciiStringResource *resource) { + return v8::String::NewExternal(resource); + } + + template<> + NAN_INLINE v8::Local NanNew(bool value) { + return v8::BooleanObject::New(value).As(); + } + + template<> + NAN_INLINE v8::Local + NanNew >( + v8::Local value) { + return v8::StringObject::New(value).As(); + } + + template<> + NAN_INLINE v8::Local + NanNew >( + v8::Handle value) { + return v8::StringObject::New(value).As(); + } + + template<> + NAN_INLINE v8::Local NanNew(double val) { + return v8::NumberObject::New(val).As(); + } + + template<> + NAN_INLINE v8::Local NanNew(int32_t val) { + return v8::Uint32::NewFromUnsigned(val)->ToUint32(); + } + + template<> + NAN_INLINE v8::Local NanNew(uint32_t val) { + return v8::Uint32::NewFromUnsigned(val)->ToUint32(); + } + + template<> + NAN_INLINE v8::Local NanNew(int32_t val) { + return v8::Int32::New(val)->ToInt32(); + } + + template<> + NAN_INLINE v8::Local NanNew(uint32_t val) { + return v8::Int32::New(val)->ToInt32(); + } + + template<> + NAN_INLINE v8::Local NanNew( + uint8_t *arg + , int length) { + uint16_t *warg = new uint16_t[length]; + for (int i = 0; i < length; i++) { + warg[i] = arg[i]; + } + v8::Local retval = v8::String::New(warg, length); + delete[] warg; + return retval; + } + + template<> + NAN_INLINE v8::Local NanNew( + const uint8_t *arg + , int length) { + uint16_t *warg = new uint16_t[length]; + for (int i = 0; i < length; i++) { + warg[i] = arg[i]; + } + v8::Local retval = v8::String::New(warg, length); + delete[] warg; + return retval; + } + + template<> + NAN_INLINE v8::Local NanNew(uint8_t *arg) { + int length = strlen(reinterpret_cast(arg)); + uint16_t *warg = new uint16_t[length]; + for (int i = 0; i < length; i++) { + warg[i] = arg[i]; + } + + v8::Local retval = v8::String::New(warg, length); + delete[] warg; + return retval; + } + + template<> + NAN_INLINE v8::Local NanNew( + const uint8_t *arg) { + int length = strlen(reinterpret_cast(arg)); + uint16_t *warg = new uint16_t[length]; + for (int i = 0; i < length; i++) { + warg[i] = arg[i]; + } + v8::Local retval = v8::String::New(warg, length); + delete[] warg; + return retval; + } + + template<> + NAN_INLINE v8::Local NanNew() { + return v8::String::Empty(); + } + + NAN_INLINE void NanAddGCEpilogueCallback( + v8::GCEpilogueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::V8::AddGCEpilogueCallback(callback, gc_type_filter); + } + NAN_INLINE void NanRemoveGCEpilogueCallback( + v8::GCEpilogueCallback callback) { + v8::V8::RemoveGCEpilogueCallback(callback); + } + NAN_INLINE void NanAddGCPrologueCallback( + v8::GCPrologueCallback callback + , v8::GCType gc_type_filter = v8::kGCTypeAll) { + v8::V8::AddGCPrologueCallback(callback, gc_type_filter); + } + NAN_INLINE void NanRemoveGCPrologueCallback( + v8::GCPrologueCallback callback) { + v8::V8::RemoveGCPrologueCallback(callback); + } + NAN_INLINE void NanGetHeapStatistics( + v8::HeapStatistics *heap_statistics) { + v8::V8::GetHeapStatistics(heap_statistics); + } + + template + NAN_INLINE void NanAssignPersistent( + v8::Persistent& handle + , v8::Handle obj) { + handle.Dispose(); + handle = v8::Persistent::New(obj); + } + + template + struct _NanWeakCallbackInfo { + typedef void (*Callback)(v8::Persistent object, void* parameter); + _NanWeakCallbackInfo(v8::Handle handle, P* param, Callback cb) : + parameter(param) + , callback(cb) + , persistent(v8::Persistent::New(handle)) { } + + ~_NanWeakCallbackInfo() { + persistent.Dispose(); + persistent.Clear(); + } + + P* const parameter; + Callback const callback; + v8::Persistent persistent; + }; + + template + class _NanWeakCallbackData { + public: + _NanWeakCallbackData(_NanWeakCallbackInfo *info) + : info_(info) { } + + NAN_INLINE v8::Local GetValue() const { + return NanNew(info_->persistent); + } + NAN_INLINE P* GetParameter() const { return info_->parameter; } + NAN_INLINE void Revive() const { + info_->persistent.MakeWeak(info_, info_->callback); + } + NAN_INLINE void Dispose() const { + delete info_; + } + + private: + _NanWeakCallbackInfo* info_; + }; + +# define NanGetInternalFieldPointer(object, index) \ + object->GetPointerFromInternalField(index) +# define NanSetInternalFieldPointer(object, index, value) \ + object->SetPointerInInternalField(index, value) + +// do not use for declaration +# define NAN_WEAK_CALLBACK(name) \ + template \ + static void name( \ + v8::Persistent object, void *data) { \ + _NanWeakCallbackData wcbd( \ + static_cast<_NanWeakCallbackInfo*>(data)); \ + _Nan_Weak_Callback_ ## name(wcbd); \ + } \ + \ + template \ + NAN_INLINE void _Nan_Weak_Callback_ ## name( \ + const _NanWeakCallbackData &data) + + template + NAN_INLINE void NanMakeWeakPersistent( + v8::Handle handle + , P* parameter + , typename _NanWeakCallbackInfo::Callback callback) { + _NanWeakCallbackInfo *cbinfo = + new _NanWeakCallbackInfo(handle, parameter, callback); + cbinfo->persistent.MakeWeak(cbinfo, callback); + } + +# define NanScope() v8::HandleScope scope +# define NanEscapableScope() v8::HandleScope scope +# define NanEscapeScope(val) scope.Close(val) +# define NanLocker() v8::Locker locker +# define NanUnlocker() v8::Unlocker unlocker +# define NanReturnValue(value) return scope.Close(value) +# define NanReturnUndefined() return v8::Undefined() +# define NanReturnNull() return v8::Null() +# define NanReturnEmptyString() return v8::String::Empty() +# define NanObjectWrapHandle(obj) v8::Local::New(obj->handle_) + +# define _NAN_ERROR(fun, errmsg) \ + fun(v8::String::New(errmsg)) + +# define _NAN_THROW_ERROR(fun, errmsg) \ + do { \ + NanScope(); \ + return v8::Local::New( \ + v8::ThrowException(_NAN_ERROR(fun, errmsg))); \ + } while (0); + + NAN_INLINE v8::Local NanError(const char* errmsg) { + return _NAN_ERROR(v8::Exception::Error, errmsg); + } + + NAN_INLINE v8::Local NanThrowError(const char* errmsg) { + _NAN_THROW_ERROR(v8::Exception::Error, errmsg); + } + + NAN_INLINE v8::Local NanThrowError( + v8::Handle error + ) { + NanScope(); + return v8::Local::New(v8::ThrowException(error)); + } + + NAN_INLINE v8::Local NanError( + const char *msg + , const int errorNumber + ) { + v8::Local err = v8::Exception::Error(v8::String::New(msg)); + v8::Local obj = err.As(); + obj->Set(v8::String::New("code"), v8::Int32::New(errorNumber)); + return err; + } + + NAN_INLINE v8::Local NanThrowError( + const char *msg + , const int errorNumber + ) { + return NanThrowError(NanError(msg, errorNumber)); + } + + NAN_INLINE v8::Local NanTypeError(const char* errmsg) { + return _NAN_ERROR(v8::Exception::TypeError, errmsg); + } + + NAN_INLINE v8::Local NanThrowTypeError( + const char* errmsg + ) { + _NAN_THROW_ERROR(v8::Exception::TypeError, errmsg); + } + + NAN_INLINE v8::Local NanRangeError( + const char* errmsg + ) { + return _NAN_ERROR(v8::Exception::RangeError, errmsg); + } + + NAN_INLINE v8::Local NanThrowRangeError( + const char* errmsg + ) { + _NAN_THROW_ERROR(v8::Exception::RangeError, errmsg); + } + + template + NAN_INLINE void NanDisposePersistent( + v8::Persistent &handle) { // NOLINT(runtime/references) + handle.Dispose(); + handle.Clear(); + } + + NAN_INLINE v8::Local NanNewBufferHandle ( + char *data + , size_t length + , node::Buffer::free_callback callback + , void *hint + ) { + return NanNew( + node::Buffer::New(data, length, callback, hint)->handle_); + } + + NAN_INLINE v8::Local NanNewBufferHandle ( + const char *data + , uint32_t size + ) { +#if NODE_MODULE_VERSION >= 0x000B + return NanNew(node::Buffer::New(data, size)->handle_); +#else + return NanNew( + node::Buffer::New(const_cast(data), size)->handle_); +#endif + } + + NAN_INLINE v8::Local NanNewBufferHandle (uint32_t size) { + return NanNew(node::Buffer::New(size)->handle_); + } + + NAN_INLINE void FreeData(char *data, void *hint) { + delete[] data; + } + + NAN_INLINE v8::Local NanBufferUse( + char* data + , uint32_t size + ) { + return NanNew( + node::Buffer::New(data, size, FreeData, NULL)->handle_); + } + + NAN_INLINE bool NanHasInstance( + v8::Persistent& function_template + , v8::Handle value + ) { + return function_template->HasInstance(value); + } + + NAN_INLINE v8::Local NanNewContextHandle( + v8::ExtensionConfiguration* extensions = NULL + , v8::Handle tmpl = v8::Handle() + , v8::Handle obj = v8::Handle() + ) { + v8::Persistent ctx = v8::Context::New(extensions, tmpl, obj); + v8::Local lctx = NanNew(ctx); + ctx.Dispose(); + return lctx; + } + + NAN_INLINE v8::Local NanCompileScript( + v8::Local s + , const v8::ScriptOrigin& origin + ) { + return v8::Script::Compile(s, const_cast(&origin)); + } + + NAN_INLINE v8::Local NanCompileScript( + v8::Local s + ) { + return v8::Script::Compile(s); + } + + NAN_INLINE v8::Local NanRunScript(v8::Local script) { + return script->Run(); + } + +#endif // NODE_MODULE_VERSION + +typedef void (*NanFreeCallback)(char *data, void *hint); + +#define NAN_METHOD(name) _NAN_METHOD_RETURN_TYPE name(_NAN_METHOD_ARGS) +#define NAN_GETTER(name) \ + _NAN_GETTER_RETURN_TYPE name( \ + v8::Local property \ + , _NAN_GETTER_ARGS) +#define NAN_SETTER(name) \ + _NAN_SETTER_RETURN_TYPE name( \ + v8::Local property \ + , v8::Local value \ + , _NAN_SETTER_ARGS) +#define NAN_PROPERTY_GETTER(name) \ + _NAN_PROPERTY_GETTER_RETURN_TYPE name( \ + v8::Local property \ + , _NAN_PROPERTY_GETTER_ARGS) +#define NAN_PROPERTY_SETTER(name) \ + _NAN_PROPERTY_SETTER_RETURN_TYPE name( \ + v8::Local property \ + , v8::Local value \ + , _NAN_PROPERTY_SETTER_ARGS) +#define NAN_PROPERTY_ENUMERATOR(name) \ + _NAN_PROPERTY_ENUMERATOR_RETURN_TYPE name(_NAN_PROPERTY_ENUMERATOR_ARGS) +#define NAN_PROPERTY_DELETER(name) \ + _NAN_PROPERTY_DELETER_RETURN_TYPE name( \ + v8::Local property \ + , _NAN_PROPERTY_DELETER_ARGS) +#define NAN_PROPERTY_QUERY(name) \ + _NAN_PROPERTY_QUERY_RETURN_TYPE name( \ + v8::Local property \ + , _NAN_PROPERTY_QUERY_ARGS) +# define NAN_INDEX_GETTER(name) \ + _NAN_INDEX_GETTER_RETURN_TYPE name(uint32_t index, _NAN_INDEX_GETTER_ARGS) +#define NAN_INDEX_SETTER(name) \ + _NAN_INDEX_SETTER_RETURN_TYPE name( \ + uint32_t index \ + , v8::Local value \ + , _NAN_INDEX_SETTER_ARGS) +#define NAN_INDEX_ENUMERATOR(name) \ + _NAN_INDEX_ENUMERATOR_RETURN_TYPE name(_NAN_INDEX_ENUMERATOR_ARGS) +#define NAN_INDEX_DELETER(name) \ + _NAN_INDEX_DELETER_RETURN_TYPE name( \ + uint32_t index \ + , _NAN_INDEX_DELETER_ARGS) +#define NAN_INDEX_QUERY(name) \ + _NAN_INDEX_QUERY_RETURN_TYPE name(uint32_t index, _NAN_INDEX_QUERY_ARGS) + +class NanCallback { + public: + NanCallback() { + NanScope(); + v8::Local obj = NanNew(); + NanAssignPersistent(handle, obj); + } + + explicit NanCallback(const v8::Handle &fn) { + NanScope(); + v8::Local obj = NanNew(); + NanAssignPersistent(handle, obj); + SetFunction(fn); + } + + ~NanCallback() { + if (handle.IsEmpty()) return; + NanDisposePersistent(handle); + } + + NAN_INLINE void SetFunction(const v8::Handle &fn) { + NanScope(); + NanNew(handle)->Set(NanSymbol("callback"), fn); + } + + NAN_INLINE v8::Local GetFunction () { + return NanNew(handle)->Get(NanSymbol("callback")) + .As(); + } + + void Call(int argc, v8::Handle argv[]) { + NanScope(); +#if (NODE_MODULE_VERSION > 0x000B) // 0.11.12+ + v8::Local callback = NanNew(handle)-> + Get(NanSymbol("callback")).As(); + node::MakeCallback( + nan_isolate + , nan_isolate->GetCurrentContext()->Global() + , callback + , argc + , argv + ); +#else +#if NODE_VERSION_AT_LEAST(0, 8, 0) + v8::Local callback = NanNew(handle)-> + Get(NanSymbol("callback")).As(); + node::MakeCallback( + v8::Context::GetCurrent()->Global() + , callback + , argc + , argv + ); +#else + node::MakeCallback(handle, "callback", argc, argv); +#endif +#endif + } + + private: + v8::Persistent handle; +}; + +/* abstract */ class NanAsyncWorker { + public: + explicit NanAsyncWorker(NanCallback *callback) : callback(callback) { + request.data = this; + errmsg = NULL; + + NanScope(); + v8::Local obj = NanNew(); + NanAssignPersistent(persistentHandle, obj); + } + + virtual ~NanAsyncWorker() { + NanScope(); + + if (!persistentHandle.IsEmpty()) + NanDisposePersistent(persistentHandle); + if (callback) + delete callback; + if (errmsg) + delete errmsg; + } + + virtual void WorkComplete() { + NanScope(); + + if (errmsg == NULL) + HandleOKCallback(); + else + HandleErrorCallback(); + delete callback; + callback = NULL; + } + + NAN_INLINE void SaveToPersistent(const char *key, v8::Local &obj) { + v8::Local handle = NanNew(persistentHandle); + handle->Set(NanSymbol(key), obj); + } + + v8::Local GetFromPersistent(const char *key) { + NanEscapableScope(); + v8::Local handle = NanNew(persistentHandle); + return NanEscapeScope(handle->Get(NanSymbol(key)).As()); + } + + virtual void Execute() = 0; + + uv_work_t request; + + protected: + v8::Persistent persistentHandle; + NanCallback *callback; + const char *errmsg; + + virtual void HandleOKCallback() { + NanScope(); + + callback->Call(0, NULL); + } + + virtual void HandleErrorCallback() { + NanScope(); + + v8::Local argv[] = { + v8::Exception::Error(NanNew(errmsg)) + }; + callback->Call(1, argv); + } +}; + +NAN_INLINE void NanAsyncExecute (uv_work_t* req) { + NanAsyncWorker *worker = static_cast(req->data); + worker->Execute(); +} + +NAN_INLINE void NanAsyncExecuteComplete (uv_work_t* req) { + NanAsyncWorker* worker = static_cast(req->data); + worker->WorkComplete(); + delete worker; +} + +NAN_INLINE void NanAsyncQueueWorker (NanAsyncWorker* worker) { + uv_queue_work( + uv_default_loop() + , &worker->request + , NanAsyncExecute + , (uv_after_work_cb)NanAsyncExecuteComplete + ); +} + +//// Base 64 //// + +#define _nan_base64_encoded_size(size) ((size + 2 - ((size + 2) % 3)) / 3 * 4) + +// Doesn't check for padding at the end. Can be 1-2 bytes over. +NAN_INLINE size_t _nan_base64_decoded_size_fast(size_t size) { + size_t remainder = size % 4; + + size = (size / 4) * 3; + if (remainder) { + if (size == 0 && remainder == 1) { + // special case: 1-byte input cannot be decoded + size = 0; + } else { + // non-padded input, add 1 or 2 extra bytes + size += 1 + (remainder == 3); + } + } + + return size; +} + +template +NAN_INLINE size_t _nan_base64_decoded_size( + const T* src + , size_t size +) { + if (size == 0) + return 0; + + if (src[size - 1] == '=') + size--; + if (size > 0 && src[size - 1] == '=') + size--; + + return _nan_base64_decoded_size_fast(size); +} + +// supports regular and URL-safe base64 +static const int _nan_unbase64_table[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -2, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63 + , 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1 + , -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 + , 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63 + , -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40 + , 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + , -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +}; + +#define _nan_unbase64(x) _nan_unbase64_table[(uint8_t)(x)] + +template static size_t _nan_base64_decode( + char* buf + , size_t len + , const T* src + , const size_t srcLen +) { + char* dst = buf; + char* dstEnd = buf + len; + const T* srcEnd = src + srcLen; + + while (src < srcEnd && dst < dstEnd) { + ptrdiff_t remaining = srcEnd - src; + char a, b, c, d; + + while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; + if (remaining == 0 || *src == '=') break; + a = _nan_unbase64(*src++); + + while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; + if (remaining <= 1 || *src == '=') break; + b = _nan_unbase64(*src++); + + *dst++ = (a << 2) | ((b & 0x30) >> 4); + if (dst == dstEnd) break; + + while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; + if (remaining <= 2 || *src == '=') break; + c = _nan_unbase64(*src++); + + *dst++ = ((b & 0x0F) << 4) | ((c & 0x3C) >> 2); + if (dst == dstEnd) break; + + while (_nan_unbase64(*src) < 0 && src < srcEnd) src++, remaining--; + if (remaining <= 3 || *src == '=') break; + d = _nan_unbase64(*src++); + + *dst++ = ((c & 0x03) << 6) | (d & 0x3F); + } + + return dst - buf; +} + +//// HEX //// + +template unsigned _nan_hex2bin(T c) { + if (c >= '0' && c <= '9') return c - '0'; + if (c >= 'A' && c <= 'F') return 10 + (c - 'A'); + if (c >= 'a' && c <= 'f') return 10 + (c - 'a'); + return static_cast(-1); +} + +template static size_t _nan_hex_decode( + char* buf + , size_t len + , const T* src + , const size_t srcLen +) { + size_t i; + for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) { + unsigned a = _nan_hex2bin(src[i * 2 + 0]); + unsigned b = _nan_hex2bin(src[i * 2 + 1]); + if (!~a || !~b) return i; + buf[i] = a * 16 + b; + } + + return i; +} + +static bool _NanGetExternalParts( + v8::Handle val + , const char** data + , size_t* len +) { + if (node::Buffer::HasInstance(val)) { + *data = node::Buffer::Data(val.As()); + *len = node::Buffer::Length(val.As()); + return true; + } + + assert(val->IsString()); + v8::Local str = NanNew(val.As()); + + if (str->IsExternalAscii()) { + const v8::String::ExternalAsciiStringResource* ext; + ext = str->GetExternalAsciiStringResource(); + *data = ext->data(); + *len = ext->length(); + return true; + + } else if (str->IsExternal()) { + const v8::String::ExternalStringResource* ext; + ext = str->GetExternalStringResource(); + *data = reinterpret_cast(ext->data()); + *len = ext->length(); + return true; + } + + return false; +} + +namespace Nan { + enum Encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER}; +} + +NAN_INLINE void* NanRawString( + v8::Handle from + , enum Nan::Encoding encoding + , size_t *datalen + , void *buf + , size_t buflen + , int flags +) { + NanScope(); + + size_t sz_; + size_t term_len = !(flags & v8::String::NO_NULL_TERMINATION); + char *data = NULL; + size_t len; + bool is_extern = _NanGetExternalParts( + from + , const_cast(&data) + , &len); + + if (is_extern && !term_len) { + NanSetPointerSafe(datalen, len); + return data; + } + + v8::Local toStr = from->ToString(); + + char *to = static_cast(buf); + + switch (encoding) { + case Nan::ASCII: +#if NODE_MODULE_VERSION < 0x000C + sz_ = toStr->Length(); + if (to == NULL) { + to = new char[sz_ + term_len]; + } else { + assert(buflen >= sz_ + term_len && "too small buffer"); + } + NanSetPointerSafe( + datalen + , toStr->WriteAscii(to, 0, static_cast(sz_ + term_len), flags)); + return to; +#endif + case Nan::BINARY: + case Nan::BUFFER: + sz_ = toStr->Length(); + if (to == NULL) { + to = new char[sz_ + term_len]; + } else { + assert(buflen >= sz_ + term_len && "too small buffer"); + } +#if NODE_MODULE_VERSION < 0x000C + { + uint16_t* twobytebuf = new uint16_t[sz_ + term_len]; + + size_t len = toStr->Write(twobytebuf, 0, + static_cast(sz_ + term_len), flags); + + for (size_t i = 0; i < sz_ + term_len && i < len + term_len; i++) { + unsigned char *b = reinterpret_cast(&twobytebuf[i]); + to[i] = *b; + } + + NanSetPointerSafe(datalen, len); + + delete[] twobytebuf; + return to; + } +#else + NanSetPointerSafe( + datalen, + toStr->WriteOneByte( + reinterpret_cast(to) + , 0 + , static_cast(sz_ + term_len) + , flags)); + return to; +#endif + case Nan::UTF8: + sz_ = toStr->Utf8Length(); + if (to == NULL) { + to = new char[sz_ + term_len]; + } else { + assert(buflen >= sz_ + term_len && "too small buffer"); + } + NanSetPointerSafe( + datalen + , toStr->WriteUtf8(to, static_cast(sz_ + term_len) + , NULL, flags) + - term_len); + return to; + case Nan::BASE64: + { + v8::String::Value value(toStr); + sz_ = _nan_base64_decoded_size(*value, value.length()); + if (to == NULL) { + to = new char[sz_ + term_len]; + } else { + assert(buflen >= sz_ + term_len); + } + NanSetPointerSafe( + datalen + , _nan_base64_decode(to, sz_, *value, value.length())); + if (term_len) { + to[sz_] = '\0'; + } + return to; + } + case Nan::UCS2: + { + sz_ = toStr->Length(); + if (to == NULL) { + to = new char[(sz_ + term_len) * 2]; + } else { + assert(buflen >= (sz_ + term_len) * 2 && "too small buffer"); + } + + int bc = 2 * toStr->Write( + reinterpret_cast(to) + , 0 + , static_cast(sz_ + term_len) + , flags); + NanSetPointerSafe(datalen, bc); + return to; + } + case Nan::HEX: + { + v8::String::Value value(toStr); + sz_ = value.length(); + assert(!(sz_ & 1) && "bad hex data"); + if (to == NULL) { + to = new char[sz_ / 2 + term_len]; + } else { + assert(buflen >= sz_ / 2 + term_len && "too small buffer"); + } + NanSetPointerSafe( + datalen + , _nan_hex_decode(to, sz_ / 2, *value, value.length())); + } + if (term_len) { + to[sz_ / 2] = '\0'; + } + return to; + default: + assert(0 && "unknown encoding"); + } + return to; +} + +NAN_INLINE char* NanCString( + v8::Handle from + , size_t *datalen + , char *buf = NULL + , size_t buflen = 0 + , int flags = v8::String::NO_OPTIONS +) { + return static_cast( + NanRawString(from, Nan::UTF8, datalen, buf, buflen, flags) + ); +} + +#endif // NAN_H_ diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/package.json new file mode 100644 index 00000000..4918de2f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/nan/package.json @@ -0,0 +1,68 @@ +{ + "name": "nan", + "version": "1.0.0", + "description": "Native Abstractions for Node.js: C++ header for Node 0.8->0.12 compatibility", + "main": "include_dirs.js", + "repository": { + "type": "git", + "url": "git://github.com/rvagg/nan.git" + }, + "contributors": [ + { + "name": "Rod Vagg", + "email": "r@va.gg", + "url": "https://github.com/rvagg" + }, + { + "name": "Benjamin Byholm", + "email": "bbyholm@abo.fi", + "url": "https://github.com/kkoopa/" + }, + { + "name": "Trevor Norris", + "email": "trev.norris@gmail.com", + "url": "https://github.com/trevnorris" + }, + { + "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", + "url": "https://github.com/TooTallNate" + }, + { + "name": "Brett Lawson", + "email": "brett19@gmail.com", + "url": "https://github.com/brett19" + }, + { + "name": "Ben Noordhuis", + "email": "info@bnoordhuis.nl", + "url": "https://github.com/bnoordhuis" + } + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/rvagg/nan/issues" + }, + "homepage": "https://github.com/rvagg/nan", + "_id": "nan@1.0.0", + "dist": { + "shasum": "ae24f8850818d662fcab5acf7f3b95bfaa2ccf38", + "tarball": "http://registry.npmjs.org/nan/-/nan-1.0.0.tgz" + }, + "_from": "nan@>=1.0.0 <1.1.0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "directories": {}, + "_shasum": "ae24f8850818d662fcab5acf7f3b95bfaa2ccf38", + "_resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/.npmignore new file mode 100644 index 00000000..1b18fb39 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/.npmignore @@ -0,0 +1,7 @@ +npm-debug.log +node_modules +.*.swp +.lock-* +build/ + +test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/Makefile new file mode 100644 index 00000000..7496b6fc --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/Makefile @@ -0,0 +1,12 @@ +ALL_TESTS = $(shell find test/ -name '*.test.js') + +run-tests: + @./node_modules/.bin/mocha \ + -t 2000 \ + $(TESTFLAGS) \ + $(TESTS) + +test: + @$(MAKE) NODE_PATH=lib TESTS="$(ALL_TESTS)" run-tests + +.PHONY: test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/README.md new file mode 100644 index 00000000..0dabc755 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/README.md @@ -0,0 +1,69 @@ +# options.js # + +A very light-weight in-code option parsers for node.js. + +## Usage ## + +``` js +var Options = require("options"); + +// Create an Options object +function foo(options) { + var default_options = { + foo : "bar" + }; + + // Create an option object with default value + var opts = new Options(default_options); + + // Merge options + opts = opts.merge(options); + + // Reset to default value + opts.reset(); + + // Copy selected attributes out + var seled_att = opts.copy("foo"); + + // Read json options from a file. + opts.read("options.file"); // Sync + opts.read("options.file", function(err){ // Async + if(err){ // If error occurs + console.log("File error."); + }else{ + // No error + } + }); + + // Attributes defined or not + opts.isDefinedAndNonNull("foobar"); + opts.isDefined("foobar"); +} + +``` + + +## License ## + +(The MIT License) + +Copyright (c) 2012 Einar Otto Stangvik <einaros@gmail.com> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/lib/options.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/lib/options.js new file mode 100644 index 00000000..4fc45e90 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/lib/options.js @@ -0,0 +1,86 @@ +/*! + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +var fs = require('fs'); + +function Options(defaults) { + var internalValues = {}; + var values = this.value = {}; + Object.keys(defaults).forEach(function(key) { + internalValues[key] = defaults[key]; + Object.defineProperty(values, key, { + get: function() { return internalValues[key]; }, + configurable: false, + enumerable: true + }); + }); + this.reset = function() { + Object.keys(defaults).forEach(function(key) { + internalValues[key] = defaults[key]; + }); + return this; + }; + this.merge = function(options, required) { + options = options || {}; + if (Object.prototype.toString.call(required) === '[object Array]') { + var missing = []; + for (var i = 0, l = required.length; i < l; ++i) { + var key = required[i]; + if (!(key in options)) { + missing.push(key); + } + } + if (missing.length > 0) { + if (missing.length > 1) { + throw new Error('options ' + + missing.slice(0, missing.length - 1).join(', ') + ' and ' + + missing[missing.length - 1] + ' must be defined'); + } + else throw new Error('option ' + missing[0] + ' must be defined'); + } + } + Object.keys(options).forEach(function(key) { + if (key in internalValues) { + internalValues[key] = options[key]; + } + }); + return this; + }; + this.copy = function(keys) { + var obj = {}; + Object.keys(defaults).forEach(function(key) { + if (keys.indexOf(key) !== -1) { + obj[key] = values[key]; + } + }); + return obj; + }; + this.read = function(filename, cb) { + if (typeof cb == 'function') { + var self = this; + fs.readFile(filename, function(error, data) { + if (error) return cb(error); + var conf = JSON.parse(data); + self.merge(conf); + cb(); + }); + } + else { + var conf = JSON.parse(fs.readFileSync(filename)); + this.merge(conf); + } + return this; + }; + this.isDefined = function(key) { + return typeof values[key] != 'undefined'; + }; + this.isDefinedAndNonNull = function(key) { + return typeof values[key] != 'undefined' && values[key] !== null; + }; + Object.freeze(values); + Object.freeze(this); +} + +module.exports = Options; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/package.json new file mode 100644 index 00000000..7a62d8e3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/options/package.json @@ -0,0 +1,51 @@ +{ + "author": { + "name": "Einar Otto Stangvik", + "email": "einaros@gmail.com", + "url": "http://2x.io" + }, + "name": "options", + "description": "A very light-weight in-code option parsers for node.js.", + "version": "0.0.6", + "repository": { + "type": "git", + "url": "git://github.com/einaros/options.js.git" + }, + "main": "lib/options", + "scripts": { + "test": "make test" + }, + "engines": { + "node": ">=0.4.0" + }, + "dependencies": {}, + "devDependencies": { + "mocha": "latest" + }, + "gitHead": "ff53d0a092c897cb95964232a96fe17da65c11af", + "bugs": { + "url": "https://github.com/einaros/options.js/issues" + }, + "homepage": "https://github.com/einaros/options.js", + "_id": "options@0.0.6", + "_shasum": "ec22d312806bb53e731773e7cdaefcf1c643128f", + "_from": "options@>=0.0.5", + "_npmVersion": "1.4.21", + "_npmUser": { + "name": "einaros", + "email": "einaros@gmail.com" + }, + "maintainers": [ + { + "name": "einaros", + "email": "einaros@gmail.com" + } + ], + "dist": { + "shasum": "ec22d312806bb53e731773e7cdaefcf1c643128f", + "tarball": "http://registry.npmjs.org/options/-/options-0.0.6.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/.npmignore new file mode 100644 index 00000000..6bfffbb7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/.npmignore @@ -0,0 +1,5 @@ +npm-debug.log +node_modules +.*.swp +.lock-* +build/ diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/README.md new file mode 100644 index 00000000..55eb3c11 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/README.md @@ -0,0 +1,3 @@ +# tinycolor # + +This is a no-fuzz, barebone, zero muppetry color module for node.js. \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/example.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/example.js new file mode 100644 index 00000000..f7540468 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/example.js @@ -0,0 +1,3 @@ +require('./tinycolor'); +console.log('this should be red and have an underline!'.grey.underline); +console.log('this should have a blue background!'.bgBlue); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/package.json new file mode 100644 index 00000000..a2510a68 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/package.json @@ -0,0 +1,48 @@ +{ + "author": { + "name": "Einar Otto Stangvik", + "email": "einaros@gmail.com", + "url": "http://2x.io" + }, + "name": "tinycolor", + "description": "a to-the-point color module for node", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/einaros/tinycolor.git" + }, + "engines": { + "node": ">=0.4.0" + }, + "dependencies": {}, + "devDependencies": {}, + "main": "tinycolor", + "_npmUser": { + "name": "einaros", + "email": "einaros@gmail.com" + }, + "_id": "tinycolor@0.0.1", + "_engineSupported": true, + "_npmVersion": "1.1.0-alpha-6", + "_nodeVersion": "v0.6.5", + "_defaultsLoaded": true, + "dist": { + "shasum": "320b5a52d83abb5978d81a3e887d4aefb15a6164", + "tarball": "http://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz" + }, + "maintainers": [ + { + "name": "einaros", + "email": "einaros@gmail.com" + } + ], + "directories": {}, + "_shasum": "320b5a52d83abb5978d81a3e887d4aefb15a6164", + "_resolved": "https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz", + "_from": "tinycolor@>=0.0.0 <1.0.0", + "bugs": { + "url": "https://github.com/einaros/tinycolor/issues" + }, + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/einaros/tinycolor#readme" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/tinycolor.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/tinycolor.js new file mode 100644 index 00000000..36e552c4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/node_modules/tinycolor/tinycolor.js @@ -0,0 +1,31 @@ +var styles = { + 'bold': ['\033[1m', '\033[22m'], + 'italic': ['\033[3m', '\033[23m'], + 'underline': ['\033[4m', '\033[24m'], + 'inverse': ['\033[7m', '\033[27m'], + 'black': ['\033[30m', '\033[39m'], + 'red': ['\033[31m', '\033[39m'], + 'green': ['\033[32m', '\033[39m'], + 'yellow': ['\033[33m', '\033[39m'], + 'blue': ['\033[34m', '\033[39m'], + 'magenta': ['\033[35m', '\033[39m'], + 'cyan': ['\033[36m', '\033[39m'], + 'white': ['\033[37m', '\033[39m'], + 'default': ['\033[39m', '\033[39m'], + 'grey': ['\033[90m', '\033[39m'], + 'bgBlack': ['\033[40m', '\033[49m'], + 'bgRed': ['\033[41m', '\033[49m'], + 'bgGreen': ['\033[42m', '\033[49m'], + 'bgYellow': ['\033[43m', '\033[49m'], + 'bgBlue': ['\033[44m', '\033[49m'], + 'bgMagenta': ['\033[45m', '\033[49m'], + 'bgCyan': ['\033[46m', '\033[49m'], + 'bgWhite': ['\033[47m', '\033[49m'], + 'bgDefault': ['\033[49m', '\033[49m'] +} +Object.keys(styles).forEach(function(style) { + Object.defineProperty(String.prototype, style, { + get: function() { return styles[style][0] + this + styles[style][1]; }, + enumerable: false + }); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/package.json new file mode 100644 index 00000000..dc3c9ada --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/package.json @@ -0,0 +1,82 @@ +{ + "author": { + "name": "Einar Otto Stangvik", + "email": "einaros@gmail.com", + "url": "http://2x.io" + }, + "name": "ws", + "description": "simple to use, blazing fast and thoroughly tested websocket client, server and console for node.js, up-to-date against RFC-6455", + "version": "0.4.32", + "keywords": [ + "Hixie", + "HyBi", + "Push", + "RFC-6455", + "WebSocket", + "WebSockets", + "real-time" + ], + "repository": { + "type": "git", + "url": "git://github.com/einaros/ws.git" + }, + "bin": { + "wscat": "./bin/wscat" + }, + "scripts": { + "test": "make test", + "install": "(node-gyp rebuild 2> builderror.log) || (exit 0)" + }, + "engines": { + "node": ">=0.4.0" + }, + "dependencies": { + "commander": "~2.1.0", + "nan": "~1.0.0", + "tinycolor": "0.x", + "options": ">=0.0.5" + }, + "devDependencies": { + "mocha": "1.12.0", + "should": "1.2.x", + "expect.js": "0.2.x", + "benchmark": "0.3.x", + "ansi": "latest" + }, + "browser": "./lib/browser.js", + "component": { + "scripts": { + "ws/index.js": "./lib/browser.js" + } + }, + "gypfile": true, + "bugs": { + "url": "https://github.com/einaros/ws/issues" + }, + "homepage": "https://github.com/einaros/ws", + "_id": "ws@0.4.32", + "_shasum": "787a6154414f3c99ed83c5772153b20feb0cec32", + "_from": "ws@>=0.4.0 <0.5.0", + "_npmVersion": "1.4.10", + "_npmUser": { + "name": "V1", + "email": "info@3rd-Eden.com" + }, + "maintainers": [ + { + "name": "einaros", + "email": "einaros@gmail.com" + }, + { + "name": "V1", + "email": "info@3rd-Eden.com" + } + ], + "dist": { + "shasum": "787a6154414f3c99ed83c5772153b20feb0cec32", + "tarball": "http://registry.npmjs.org/ws/-/ws-0.4.32.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ws/-/ws-0.4.32.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/src/bufferutil.cc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/src/bufferutil.cc new file mode 100644 index 00000000..7f99bd6b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/src/bufferutil.cc @@ -0,0 +1,117 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "nan.h" + +using namespace v8; +using namespace node; + +class BufferUtil : public ObjectWrap +{ +public: + + static void Initialize(v8::Handle target) + { + NanScope(); + Local t = NanNew(New); + t->InstanceTemplate()->SetInternalFieldCount(1); + NODE_SET_METHOD(t, "unmask", BufferUtil::Unmask); + NODE_SET_METHOD(t, "mask", BufferUtil::Mask); + NODE_SET_METHOD(t, "merge", BufferUtil::Merge); + target->Set(NanSymbol("BufferUtil"), t->GetFunction()); + } + +protected: + + static NAN_METHOD(New) + { + NanScope(); + BufferUtil* bufferUtil = new BufferUtil(); + bufferUtil->Wrap(args.This()); + NanReturnValue(args.This()); + } + + static NAN_METHOD(Merge) + { + NanScope(); + Local bufferObj = args[0]->ToObject(); + char* buffer = Buffer::Data(bufferObj); + Local array = Local::Cast(args[1]); + unsigned int arrayLength = array->Length(); + size_t offset = 0; + unsigned int i; + for (i = 0; i < arrayLength; ++i) { + Local src = array->Get(i)->ToObject(); + size_t length = Buffer::Length(src); + memcpy(buffer + offset, Buffer::Data(src), length); + offset += length; + } + NanReturnValue(NanTrue()); + } + + static NAN_METHOD(Unmask) + { + NanScope(); + Local buffer_obj = args[0]->ToObject(); + size_t length = Buffer::Length(buffer_obj); + Local mask_obj = args[1]->ToObject(); + unsigned int *mask = (unsigned int*)Buffer::Data(mask_obj); + unsigned int* from = (unsigned int*)Buffer::Data(buffer_obj); + size_t len32 = length / 4; + unsigned int i; + for (i = 0; i < len32; ++i) *(from + i) ^= *mask; + from += i; + switch (length % 4) { + case 3: *((unsigned char*)from+2) = *((unsigned char*)from+2) ^ ((unsigned char*)mask)[2]; + case 2: *((unsigned char*)from+1) = *((unsigned char*)from+1) ^ ((unsigned char*)mask)[1]; + case 1: *((unsigned char*)from ) = *((unsigned char*)from ) ^ ((unsigned char*)mask)[0]; + case 0:; + } + NanReturnValue(NanTrue()); + } + + static NAN_METHOD(Mask) + { + NanScope(); + Local buffer_obj = args[0]->ToObject(); + Local mask_obj = args[1]->ToObject(); + unsigned int *mask = (unsigned int*)Buffer::Data(mask_obj); + Local output_obj = args[2]->ToObject(); + unsigned int dataOffset = args[3]->Int32Value(); + unsigned int length = args[4]->Int32Value(); + unsigned int* to = (unsigned int*)(Buffer::Data(output_obj) + dataOffset); + unsigned int* from = (unsigned int*)Buffer::Data(buffer_obj); + unsigned int len32 = length / 4; + unsigned int i; + for (i = 0; i < len32; ++i) *(to + i) = *(from + i) ^ *mask; + to += i; + from += i; + switch (length % 4) { + case 3: *((unsigned char*)to+2) = *((unsigned char*)from+2) ^ *((unsigned char*)mask+2); + case 2: *((unsigned char*)to+1) = *((unsigned char*)from+1) ^ *((unsigned char*)mask+1); + case 1: *((unsigned char*)to ) = *((unsigned char*)from ) ^ *((unsigned char*)mask); + case 0:; + } + NanReturnValue(NanTrue()); + } +}; + +extern "C" void init (Handle target) +{ + NanScope(); + BufferUtil::Initialize(target); +} + +NODE_MODULE(bufferutil, init) + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/src/validation.cc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/src/validation.cc new file mode 100644 index 00000000..0d9e242a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/src/validation.cc @@ -0,0 +1,145 @@ +/*! + * ws: a node.js websocket client + * Copyright(c) 2011 Einar Otto Stangvik + * MIT Licensed + */ + +#include +#include +#include +#include +#include +#include +#include +#include "nan.h" + +using namespace v8; +using namespace node; + +#define UNI_SUR_HIGH_START (uint32_t) 0xD800 +#define UNI_SUR_LOW_END (uint32_t) 0xDFFF +#define UNI_REPLACEMENT_CHAR (uint32_t) 0x0000FFFD +#define UNI_MAX_LEGAL_UTF32 (uint32_t) 0x0010FFFF + +static const uint8_t trailingBytesForUTF8[256] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 +}; + +static const uint32_t offsetsFromUTF8[6] = { + 0x00000000, 0x00003080, 0x000E2080, + 0x03C82080, 0xFA082080, 0x82082080 +}; + +static int isLegalUTF8(const uint8_t *source, const int length) +{ + uint8_t a; + const uint8_t *srcptr = source+length; + switch (length) { + default: return 0; + /* Everything else falls through when "true"... */ + /* RFC3629 makes 5 & 6 bytes UTF-8 illegal + case 6: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; + case 5: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; */ + case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; + case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return 0; + case 2: if ((a = (*--srcptr)) > 0xBF) return 0; + switch (*source) { + /* no fall-through in this inner switch */ + case 0xE0: if (a < 0xA0) return 0; break; + case 0xED: if (a > 0x9F) return 0; break; + case 0xF0: if (a < 0x90) return 0; break; + case 0xF4: if (a > 0x8F) return 0; break; + default: if (a < 0x80) return 0; + } + + case 1: if (*source >= 0x80 && *source < 0xC2) return 0; + } + if (*source > 0xF4) return 0; + return 1; +} + +int is_valid_utf8 (size_t len, char *value) +{ + /* is the string valid UTF-8? */ + for (unsigned int i = 0; i < len; i++) { + uint32_t ch = 0; + uint8_t extrabytes = trailingBytesForUTF8[(uint8_t) value[i]]; + + if (extrabytes + i >= len) + return 0; + + if (isLegalUTF8 ((uint8_t *) (value + i), extrabytes + 1) == 0) return 0; + + switch (extrabytes) { + case 5 : ch += (uint8_t) value[i++]; ch <<= 6; + case 4 : ch += (uint8_t) value[i++]; ch <<= 6; + case 3 : ch += (uint8_t) value[i++]; ch <<= 6; + case 2 : ch += (uint8_t) value[i++]; ch <<= 6; + case 1 : ch += (uint8_t) value[i++]; ch <<= 6; + case 0 : ch += (uint8_t) value[i]; + } + + ch -= offsetsFromUTF8[extrabytes]; + + if (ch <= UNI_MAX_LEGAL_UTF32) { + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) + return 0; + } else { + return 0; + } + } + + return 1; +} + +class Validation : public ObjectWrap +{ +public: + + static void Initialize(v8::Handle target) + { + NanScope(); + Local t = NanNew(New); + t->InstanceTemplate()->SetInternalFieldCount(1); + NODE_SET_METHOD(t, "isValidUTF8", Validation::IsValidUTF8); + target->Set(NanSymbol("Validation"), t->GetFunction()); + } + +protected: + + static NAN_METHOD(New) + { + NanScope(); + Validation* validation = new Validation(); + validation->Wrap(args.This()); + NanReturnValue(args.This()); + } + + static NAN_METHOD(IsValidUTF8) + { + NanScope(); + if (!Buffer::HasInstance(args[0])) { + return NanThrowTypeError("First argument needs to be a buffer"); + } + Local buffer_obj = args[0]->ToObject(); + char *buffer_data = Buffer::Data(buffer_obj); + size_t buffer_length = Buffer::Length(buffer_obj); + NanReturnValue(is_valid_utf8(buffer_length, buffer_data) == 1 ? NanTrue() : NanFalse()); + } +}; + +extern "C" void init (Handle target) +{ + NanScope(); + Validation::Initialize(target); +} + +NODE_MODULE(validation, init) + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/README.md new file mode 100644 index 00000000..22aab8bd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/README.md @@ -0,0 +1,53 @@ +# node-XMLHttpRequest # + +node-XMLHttpRequest is a wrapper for the built-in http client to emulate the +browser XMLHttpRequest object. + +This can be used with JS designed for browsers to improve reuse of code and +allow the use of existing libraries. + +Note: This library currently conforms to [XMLHttpRequest 1](http://www.w3.org/TR/XMLHttpRequest/). Version 2.0 will target [XMLHttpRequest Level 2](http://www.w3.org/TR/XMLHttpRequest2/). + +## Usage ## + +Here's how to include the module in your project and use as the browser-based +XHR object. + + var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; + var xhr = new XMLHttpRequest(); + +Note: use the lowercase string "xmlhttprequest" in your require(). On +case-sensitive systems (eg Linux) using uppercase letters won't work. + +## Versions ## + +Prior to 1.4.0 version numbers were arbitrary. From 1.4.0 on they conform to +the standard major.minor.bugfix. 1.x shouldn't necessarily be considered +stable just because it's above 0.x. + +Since the XMLHttpRequest API is stable this library's API is stable as +well. Major version numbers indicate significant core code changes. +Minor versions indicate minor core code changes or better conformity to +the W3C spec. + +## Supports ## + +* Async and synchronous requests +* GET, POST, PUT, and DELETE requests +* All spec methods (open, send, abort, getRequestHeader, + getAllRequestHeaders, event methods) +* Requests to all domains + +## Known Issues / Missing Features ## + +For a list of open issues or to report your own visit the [github issues +page](https://github.com/driverdan/node-XMLHttpRequest/issues). + +* Local file access may have unexpected results for non-UTF8 files +* Synchronous requests don't set headers properly +* Synchronous requests freeze node while waiting for response (But that's what you want, right? Stick with async!). +* Some events are missing, such as abort +* getRequestHeader is case-sensitive +* Cookies aren't persisted between requests +* Missing XML support +* Missing basic auth diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/autotest.watchr b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/autotest.watchr new file mode 100644 index 00000000..5324db6c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/autotest.watchr @@ -0,0 +1,8 @@ +def run_all_tests + puts `clear` + puts `node tests/test-constants.js` + puts `node tests/test-headers.js` + puts `node tests/test-request.js` +end +watch('.*.js') { run_all_tests } +run_all_tests diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/example/demo.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/example/demo.js new file mode 100644 index 00000000..4f333de9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/example/demo.js @@ -0,0 +1,16 @@ +var sys = require('util'); +var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; + +var xhr = new XMLHttpRequest(); + +xhr.onreadystatechange = function() { + sys.puts("State: " + this.readyState); + + if (this.readyState == 4) { + sys.puts("Complete.\nBody length: " + this.responseText.length); + sys.puts("Body:\n" + this.responseText); + } +}; + +xhr.open("GET", "http://driverdan.com"); +xhr.send(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/lib/XMLHttpRequest.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/lib/XMLHttpRequest.js new file mode 100644 index 00000000..214a2e3b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/lib/XMLHttpRequest.js @@ -0,0 +1,548 @@ +/** + * Wrapper for built-in http.js to emulate the browser XMLHttpRequest object. + * + * This can be used with JS designed for browsers to improve reuse of code and + * allow the use of existing libraries. + * + * Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs. + * + * @author Dan DeFelippi + * @contributor David Ellis + * @license MIT + */ + +var Url = require("url") + , spawn = require("child_process").spawn + , fs = require('fs'); + +exports.XMLHttpRequest = function() { + /** + * Private variables + */ + var self = this; + var http = require('http'); + var https = require('https'); + + // Holds http.js objects + var client; + var request; + var response; + + // Request settings + var settings = {}; + + // Set some default headers + var defaultHeaders = { + "User-Agent": "node-XMLHttpRequest", + "Accept": "*/*", + }; + + var headers = defaultHeaders; + + // These headers are not user setable. + // The following are allowed but banned in the spec: + // * user-agent + var forbiddenRequestHeaders = [ + "accept-charset", + "accept-encoding", + "access-control-request-headers", + "access-control-request-method", + "connection", + "content-length", + "content-transfer-encoding", + "cookie", + "cookie2", + "date", + "expect", + "host", + "keep-alive", + "origin", + "referer", + "te", + "trailer", + "transfer-encoding", + "upgrade", + "via" + ]; + + // These request methods are not allowed + var forbiddenRequestMethods = [ + "TRACE", + "TRACK", + "CONNECT" + ]; + + // Send flag + var sendFlag = false; + // Error flag, used when errors occur or abort is called + var errorFlag = false; + + // Event listeners + var listeners = {}; + + /** + * Constants + */ + + this.UNSENT = 0; + this.OPENED = 1; + this.HEADERS_RECEIVED = 2; + this.LOADING = 3; + this.DONE = 4; + + /** + * Public vars + */ + + // Current state + this.readyState = this.UNSENT; + + // default ready state change handler in case one is not set or is set late + this.onreadystatechange = null; + + // Result & response + this.responseText = ""; + this.responseXML = ""; + this.status = null; + this.statusText = null; + + /** + * Private methods + */ + + /** + * Check if the specified header is allowed. + * + * @param string header Header to validate + * @return boolean False if not allowed, otherwise true + */ + var isAllowedHttpHeader = function(header) { + return (header && forbiddenRequestHeaders.indexOf(header.toLowerCase()) === -1); + }; + + /** + * Check if the specified method is allowed. + * + * @param string method Request method to validate + * @return boolean False if not allowed, otherwise true + */ + var isAllowedHttpMethod = function(method) { + return (method && forbiddenRequestMethods.indexOf(method) === -1); + }; + + /** + * Public methods + */ + + /** + * Open the connection. Currently supports local server requests. + * + * @param string method Connection method (eg GET, POST) + * @param string url URL for the connection. + * @param boolean async Asynchronous connection. Default is true. + * @param string user Username for basic authentication (optional) + * @param string password Password for basic authentication (optional) + */ + this.open = function(method, url, async, user, password) { + this.abort(); + errorFlag = false; + + // Check for valid request method + if (!isAllowedHttpMethod(method)) { + throw "SecurityError: Request method not allowed"; + return; + } + + settings = { + "method": method, + "url": url.toString(), + "async": (typeof async !== "boolean" ? true : async), + "user": user || null, + "password": password || null + }; + + setState(this.OPENED); + }; + + /** + * Sets a header for the request. + * + * @param string header Header name + * @param string value Header value + */ + this.setRequestHeader = function(header, value) { + if (this.readyState != this.OPENED) { + throw "INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN"; + } + if (!isAllowedHttpHeader(header)) { + console.warn('Refused to set unsafe header "' + header + '"'); + return; + } + if (sendFlag) { + throw "INVALID_STATE_ERR: send flag is true"; + } + headers[header] = value; + }; + + /** + * Gets a header from the server response. + * + * @param string header Name of header to get. + * @return string Text of the header or null if it doesn't exist. + */ + this.getResponseHeader = function(header) { + if (typeof header === "string" + && this.readyState > this.OPENED + && response.headers[header.toLowerCase()] + && !errorFlag + ) { + return response.headers[header.toLowerCase()]; + } + + return null; + }; + + /** + * Gets all the response headers. + * + * @return string A string with all response headers separated by CR+LF + */ + this.getAllResponseHeaders = function() { + if (this.readyState < this.HEADERS_RECEIVED || errorFlag) { + return ""; + } + var result = ""; + + for (var i in response.headers) { + // Cookie headers are excluded + if (i !== "set-cookie" && i !== "set-cookie2") { + result += i + ": " + response.headers[i] + "\r\n"; + } + } + return result.substr(0, result.length - 2); + }; + + /** + * Gets a request header + * + * @param string name Name of header to get + * @return string Returns the request header or empty string if not set + */ + this.getRequestHeader = function(name) { + // @TODO Make this case insensitive + if (typeof name === "string" && headers[name]) { + return headers[name]; + } + + return ""; + } + + /** + * Sends the request to the server. + * + * @param string data Optional data to send as request body. + */ + this.send = function(data) { + if (this.readyState != this.OPENED) { + throw "INVALID_STATE_ERR: connection must be opened before send() is called"; + } + + if (sendFlag) { + throw "INVALID_STATE_ERR: send has already been called"; + } + + var ssl = false, local = false; + var url = Url.parse(settings.url); + + // Determine the server + switch (url.protocol) { + case 'https:': + ssl = true; + // SSL & non-SSL both need host, no break here. + case 'http:': + var host = url.hostname; + break; + + case 'file:': + local = true; + break; + + case undefined: + case '': + var host = "localhost"; + break; + + default: + throw "Protocol not supported."; + } + + // Load files off the local filesystem (file://) + if (local) { + if (settings.method !== "GET") { + throw "XMLHttpRequest: Only GET method is supported"; + } + + if (settings.async) { + fs.readFile(url.pathname, 'utf8', function(error, data) { + if (error) { + self.handleError(error); + } else { + self.status = 200; + self.responseText = data; + setState(self.DONE); + } + }); + } else { + try { + this.responseText = fs.readFileSync(url.pathname, 'utf8'); + this.status = 200; + setState(self.DONE); + } catch(e) { + this.handleError(e); + } + } + + return; + } + + // Default to port 80. If accessing localhost on another port be sure + // to use http://localhost:port/path + var port = url.port || (ssl ? 443 : 80); + // Add query string if one is used + var uri = url.pathname + (url.search ? url.search : ''); + + // Set the Host header or the server may reject the request + headers["Host"] = host; + if (!((ssl && port === 443) || port === 80)) { + headers["Host"] += ':' + url.port; + } + + // Set Basic Auth if necessary + if (settings.user) { + if (typeof settings.password == "undefined") { + settings.password = ""; + } + var authBuf = new Buffer(settings.user + ":" + settings.password); + headers["Authorization"] = "Basic " + authBuf.toString("base64"); + } + + // Set content length header + if (settings.method === "GET" || settings.method === "HEAD") { + data = null; + } else if (data) { + headers["Content-Length"] = Buffer.byteLength(data); + + if (!headers["Content-Type"]) { + headers["Content-Type"] = "text/plain;charset=UTF-8"; + } + } else if (settings.method === "POST") { + // For a post with no data set Content-Length: 0. + // This is required by buggy servers that don't meet the specs. + headers["Content-Length"] = 0; + } + + var options = { + host: host, + port: port, + path: uri, + method: settings.method, + headers: headers + }; + + // Reset error flag + errorFlag = false; + + // Handle async requests + if (settings.async) { + // Use the proper protocol + var doRequest = ssl ? https.request : http.request; + + // Request is being sent, set send flag + sendFlag = true; + + // As per spec, this is called here for historical reasons. + self.dispatchEvent("readystatechange"); + + // Create the request + request = doRequest(options, function(resp) { + response = resp; + response.setEncoding("utf8"); + + setState(self.HEADERS_RECEIVED); + self.status = response.statusCode; + + response.on('data', function(chunk) { + // Make sure there's some data + if (chunk) { + self.responseText += chunk; + } + // Don't emit state changes if the connection has been aborted. + if (sendFlag) { + setState(self.LOADING); + } + }); + + response.on('end', function() { + if (sendFlag) { + // Discard the 'end' event if the connection has been aborted + setState(self.DONE); + sendFlag = false; + } + }); + + response.on('error', function(error) { + self.handleError(error); + }); + }).on('error', function(error) { + self.handleError(error); + }); + + // Node 0.4 and later won't accept empty data. Make sure it's needed. + if (data) { + request.write(data); + } + + request.end(); + + self.dispatchEvent("loadstart"); + } else { // Synchronous + // Create a temporary file for communication with the other Node process + var syncFile = ".node-xmlhttprequest-sync-" + process.pid; + fs.writeFileSync(syncFile, "", "utf8"); + // The async request the other Node process executes + var execString = "var http = require('http'), https = require('https'), fs = require('fs');" + + "var doRequest = http" + (ssl ? "s" : "") + ".request;" + + "var options = " + JSON.stringify(options) + ";" + + "var responseText = '';" + + "var req = doRequest(options, function(response) {" + + "response.setEncoding('utf8');" + + "response.on('data', function(chunk) {" + + "responseText += chunk;" + + "});" + + "response.on('end', function() {" + + "fs.writeFileSync('" + syncFile + "', 'NODE-XMLHTTPREQUEST-STATUS:' + response.statusCode + ',' + responseText, 'utf8');" + + "});" + + "response.on('error', function(error) {" + + "fs.writeFileSync('" + syncFile + "', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');" + + "});" + + "}).on('error', function(error) {" + + "fs.writeFileSync('" + syncFile + "', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');" + + "});" + + (data ? "req.write('" + data.replace(/'/g, "\\'") + "');":"") + + "req.end();"; + // Start the other Node Process, executing this string + syncProc = spawn(process.argv[0], ["-e", execString]); + while((self.responseText = fs.readFileSync(syncFile, 'utf8')) == "") { + // Wait while the file is empty + } + // Kill the child process once the file has data + syncProc.stdin.end(); + // Remove the temporary file + fs.unlinkSync(syncFile); + if (self.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)) { + // If the file returned an error, handle it + var errorObj = self.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/, ""); + self.handleError(errorObj); + } else { + // If the file returned okay, parse its data and move to the DONE state + self.status = self.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/, "$1"); + self.responseText = self.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/, "$1"); + setState(self.DONE); + } + } + }; + + /** + * Called when an error is encountered to deal with it. + */ + this.handleError = function(error) { + this.status = 503; + this.statusText = error; + this.responseText = error.stack; + errorFlag = true; + setState(this.DONE); + }; + + /** + * Aborts a request. + */ + this.abort = function() { + if (request) { + request.abort(); + request = null; + } + + headers = defaultHeaders; + this.responseText = ""; + this.responseXML = ""; + + errorFlag = true; + + if (this.readyState !== this.UNSENT + && (this.readyState !== this.OPENED || sendFlag) + && this.readyState !== this.DONE) { + sendFlag = false; + setState(this.DONE); + } + this.readyState = this.UNSENT; + }; + + /** + * Adds an event listener. Preferred method of binding to events. + */ + this.addEventListener = function(event, callback) { + if (!(event in listeners)) { + listeners[event] = []; + } + // Currently allows duplicate callbacks. Should it? + listeners[event].push(callback); + }; + + /** + * Remove an event callback that has already been bound. + * Only works on the matching funciton, cannot be a copy. + */ + this.removeEventListener = function(event, callback) { + if (event in listeners) { + // Filter will return a new array with the callback removed + listeners[event] = listeners[event].filter(function(ev) { + return ev !== callback; + }); + } + }; + + /** + * Dispatch any events, including both "on" methods and events attached using addEventListener. + */ + this.dispatchEvent = function(event) { + if (typeof self["on" + event] === "function") { + self["on" + event](); + } + if (event in listeners) { + for (var i = 0, len = listeners[event].length; i < len; i++) { + listeners[event][i].call(self); + } + } + }; + + /** + * Changes readyState and calls onreadystatechange. + * + * @param int state New state + */ + var setState = function(state) { + if (self.readyState !== state) { + self.readyState = state; + + if (settings.async || self.readyState < self.OPENED || self.readyState === self.DONE) { + self.dispatchEvent("readystatechange"); + } + + if (self.readyState === self.DONE && !errorFlag) { + self.dispatchEvent("load"); + // @TODO figure out InspectorInstrumentation::didLoadXHR(cookie) + self.dispatchEvent("loadend"); + } + } + }; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/package.json new file mode 100644 index 00000000..f87766e9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/package.json @@ -0,0 +1,59 @@ +{ + "name": "xmlhttprequest", + "description": "XMLHttpRequest for Node", + "version": "1.4.2", + "author": { + "name": "Dan DeFelippi", + "url": "http://driverdan.com" + }, + "keywords": [ + "xhr", + "ajax" + ], + "licenses": [ + { + "type": "MIT", + "url": "http://creativecommons.org/licenses/MIT/" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/driverdan/node-XMLHttpRequest.git" + }, + "bugs": { + "name": "http://github.com/driverdan/node-XMLHttpRequest/issues" + }, + "engines": { + "node": ">=0.4.0" + }, + "directories": { + "lib": "./lib", + "example": "./example" + }, + "main": "./lib/XMLHttpRequest.js", + "_npmUser": { + "name": "driverdan", + "email": "dan@driverdan.com" + }, + "_id": "xmlhttprequest@1.4.2", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "_engineSupported": true, + "_npmVersion": "1.1.24", + "_nodeVersion": "v0.6.19", + "_defaultsLoaded": true, + "dist": { + "shasum": "01453a1d9bed1e8f172f6495bbf4c8c426321500", + "tarball": "http://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz" + }, + "maintainers": [ + { + "name": "driverdan", + "email": "dan@driverdan.com" + } + ], + "_shasum": "01453a1d9bed1e8f172f6495bbf4c8c426321500", + "_resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz", + "_from": "xmlhttprequest@1.4.2" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-constants.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-constants.js new file mode 100644 index 00000000..372e46cc --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-constants.js @@ -0,0 +1,13 @@ +var sys = require("util") + , assert = require("assert") + , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest + , xhr = new XMLHttpRequest(); + +// Test constant values +assert.equal(0, xhr.UNSENT); +assert.equal(1, xhr.OPENED); +assert.equal(2, xhr.HEADERS_RECEIVED); +assert.equal(3, xhr.LOADING); +assert.equal(4, xhr.DONE); + +sys.puts("done"); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-events.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-events.js new file mode 100644 index 00000000..c72f001d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-events.js @@ -0,0 +1,50 @@ +var sys = require("util") + , assert = require("assert") + , http = require("http") + , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest + , xhr; + +// Test server +var server = http.createServer(function (req, res) { + var body = (req.method != "HEAD" ? "Hello World" : ""); + + res.writeHead(200, { + "Content-Type": "text/plain", + "Content-Length": Buffer.byteLength(body) + }); + // HEAD has no body + if (req.method != "HEAD") { + res.write(body); + } + res.end(); + assert.equal(onreadystatechange, true); + assert.equal(readystatechange, true); + assert.equal(removed, true); + sys.puts("done"); + this.close(); +}).listen(8000); + +xhr = new XMLHttpRequest(); + +// Track event calls +var onreadystatechange = false; +var readystatechange = false; +var removed = true; +var removedEvent = function() { + removed = false; +}; + +xhr.onreadystatechange = function() { + onreadystatechange = true; +}; + +xhr.addEventListener("readystatechange", function() { + readystatechange = true; +}); + +// This isn't perfect, won't guarantee it was added in the first place +xhr.addEventListener("readystatechange", removedEvent); +xhr.removeEventListener("readystatechange", removedEvent); + +xhr.open("GET", "http://localhost:8000"); +xhr.send(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-exceptions.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-exceptions.js new file mode 100644 index 00000000..f1edd71f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-exceptions.js @@ -0,0 +1,62 @@ +var sys = require("util") + , assert = require("assert") + , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest + , xhr = new XMLHttpRequest(); + +// Test request methods that aren't allowed +try { + xhr.open("TRACK", "http://localhost:8000/"); + console.log("ERROR: TRACK should have thrown exception"); +} catch(e) {} +try { + xhr.open("TRACE", "http://localhost:8000/"); + console.log("ERROR: TRACE should have thrown exception"); +} catch(e) {} +try { + xhr.open("CONNECT", "http://localhost:8000/"); + console.log("ERROR: CONNECT should have thrown exception"); +} catch(e) {} +// Test valid request method +try { + xhr.open("GET", "http://localhost:8000/"); +} catch(e) { + console.log("ERROR: Invalid exception for GET", e); +} + +// Test forbidden headers +var forbiddenRequestHeaders = [ + "accept-charset", + "accept-encoding", + "access-control-request-headers", + "access-control-request-method", + "connection", + "content-length", + "content-transfer-encoding", + "cookie", + "cookie2", + "date", + "expect", + "host", + "keep-alive", + "origin", + "referer", + "te", + "trailer", + "transfer-encoding", + "upgrade", + "user-agent", + "via" +]; + +for (var i in forbiddenRequestHeaders) { + try { + xhr.setRequestHeader(forbiddenRequestHeaders[i], "Test"); + console.log("ERROR: " + forbiddenRequestHeaders[i] + " should have thrown exception"); + } catch(e) { + } +} + +// Try valid header +xhr.setRequestHeader("X-Foobar", "Test"); + +console.log("Done"); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-headers.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-headers.js new file mode 100644 index 00000000..2ecb045d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-headers.js @@ -0,0 +1,61 @@ +var sys = require("util") + , assert = require("assert") + , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest + , xhr = new XMLHttpRequest() + , http = require("http"); + +// Test server +var server = http.createServer(function (req, res) { + // Test setRequestHeader + assert.equal("Foobar", req.headers["x-test"]); + + var body = "Hello World"; + res.writeHead(200, { + "Content-Type": "text/plain", + "Content-Length": Buffer.byteLength(body), + // Set cookie headers to see if they're correctly suppressed + // Actual values don't matter + "Set-Cookie": "foo=bar", + "Set-Cookie2": "bar=baz", + "Connection": "close" + }); + res.write("Hello World"); + res.end(); + + this.close(); +}).listen(8000); + +xhr.onreadystatechange = function() { + if (this.readyState == 4) { + // Test getAllResponseHeaders() + var headers = "content-type: text/plain\r\ncontent-length: 11\r\nconnection: close"; + assert.equal(headers, this.getAllResponseHeaders()); + + // Test case insensitivity + assert.equal('text/plain', this.getResponseHeader('Content-Type')); + assert.equal('text/plain', this.getResponseHeader('Content-type')); + assert.equal('text/plain', this.getResponseHeader('content-Type')); + assert.equal('text/plain', this.getResponseHeader('content-type')); + + // Test aborted getAllResponseHeaders + this.abort(); + assert.equal("", this.getAllResponseHeaders()); + assert.equal(null, this.getResponseHeader("Connection")); + + sys.puts("done"); + } +}; + +assert.equal(null, xhr.getResponseHeader("Content-Type")); +try { + xhr.open("GET", "http://localhost:8000/"); + // Valid header + xhr.setRequestHeader("X-Test", "Foobar"); + // Invalid header + xhr.setRequestHeader("Content-Length", 0); + // Test getRequestHeader + assert.equal("Foobar", xhr.getRequestHeader("X-Test")); + xhr.send(); +} catch(e) { + console.log("ERROR: Exception raised", e); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-methods.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-methods.js new file mode 100644 index 00000000..fa1b1bed --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-methods.js @@ -0,0 +1,62 @@ +var sys = require("util") + , assert = require("assert") + , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest + , http = require("http") + , xhr; + +// Test server +var server = http.createServer(function (req, res) { + // Check request method and URL + assert.equal(methods[curMethod], req.method); + assert.equal("/" + methods[curMethod], req.url); + + var body = (req.method != "HEAD" ? "Hello World" : ""); + + res.writeHead(200, { + "Content-Type": "text/plain", + "Content-Length": Buffer.byteLength(body) + }); + // HEAD has no body + if (req.method != "HEAD") { + res.write(body); + } + res.end(); + + if (curMethod == methods.length - 1) { + this.close(); + sys.puts("done"); + } +}).listen(8000); + +// Test standard methods +var methods = ["GET", "POST", "HEAD", "PUT", "DELETE"]; +var curMethod = 0; + +function start(method) { + // Reset each time + xhr = new XMLHttpRequest(); + + xhr.onreadystatechange = function() { + if (this.readyState == 4) { + if (method == "HEAD") { + assert.equal("", this.responseText); + } else { + assert.equal("Hello World", this.responseText); + } + + curMethod++; + + if (curMethod < methods.length) { + sys.puts("Testing " + methods[curMethod]); + start(methods[curMethod]); + } + } + }; + + var url = "http://localhost:8000/" + method; + xhr.open(method, url); + xhr.send(); +} + +sys.puts("Testing " + methods[curMethod]); +start(methods[curMethod]); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js new file mode 100644 index 00000000..cd4e1745 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js @@ -0,0 +1,34 @@ +var sys = require("util") + , assert = require("assert") + , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest + , xhr; + +xhr = new XMLHttpRequest(); + +xhr.onreadystatechange = function() { + if (this.readyState == 4) { + assert.equal("Hello World", this.responseText); + this.close(); + runSync(); + } +}; + +// Async +var url = "file://" + __dirname + "/testdata.txt"; +xhr.open("GET", url); +xhr.send(); + +// Sync +var runSync = function() { + xhr = new XMLHttpRequest(); + + xhr.onreadystatechange = function() { + if (this.readyState == 4) { + assert.equal("Hello World", this.responseText); + this.close(); + sys.puts("done"); + } + }; + xhr.open("GET", url, false); + xhr.send(); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/testdata.txt b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/testdata.txt new file mode 100644 index 00000000..557db03d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/testdata.txt @@ -0,0 +1 @@ +Hello World diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/package.json new file mode 100644 index 00000000..233a37ae --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/package.json @@ -0,0 +1,84 @@ +{ + "name": "socket.io-client", + "description": "Socket.IO client for the browser and node.js", + "version": "0.9.16", + "main": "./lib/io.js", + "browserify": "./dist/socket.io.js", + "homepage": "http://socket.io", + "keywords": [ + "websocket", + "socket", + "realtime", + "socket.io", + "comet", + "ajax" + ], + "author": { + "name": "Guillermo Rauch", + "email": "guillermo@learnboost.com" + }, + "contributors": [ + { + "name": "Guillermo Rauch", + "email": "rauchg@gmail.com" + }, + { + "name": "Arnout Kazemier", + "email": "info@3rd-eden.com" + }, + { + "name": "Vladimir Dronnikov", + "email": "dronnikov@gmail.com" + }, + { + "name": "Einar Otto Stangvik", + "email": "einaros@gmail.com" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/LearnBoost/socket.io-client.git" + }, + "dependencies": { + "uglify-js": "1.2.5", + "ws": "0.4.x", + "xmlhttprequest": "1.4.2", + "active-x-obfuscator": "0.0.1" + }, + "devDependencies": { + "expresso": "*", + "express": "2.5.x", + "jade": "*", + "stylus": "*", + "socket.io": "0.9.16", + "socket.io-client": "0.9.16", + "should": "*" + }, + "engines": { + "node": ">= 0.4.0" + }, + "_id": "socket.io-client@0.9.16", + "dist": { + "shasum": "4da7515c5e773041d1b423970415bcc430f35fc6", + "tarball": "http://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.16.tgz" + }, + "_from": "socket.io-client@0.9.16", + "_npmVersion": "1.2.18", + "_npmUser": { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + "maintainers": [ + { + "name": "rauchg", + "email": "rauchg@gmail.com" + } + ], + "directories": {}, + "_shasum": "4da7515c5e773041d1b423970415bcc430f35fc6", + "_resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.16.tgz", + "bugs": { + "url": "https://github.com/LearnBoost/socket.io-client/issues" + }, + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/events.test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/events.test.js new file mode 100644 index 00000000..365c4223 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/events.test.js @@ -0,0 +1,120 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +(function (module, io, should) { + + module.exports = { + + 'add listeners': function () { + var event = new io.EventEmitter + , calls = 0; + + event.on('test', function (a, b) { + ++calls; + a.should().eql('a'); + b.should().eql('b'); + }); + + event.emit('test', 'a', 'b'); + calls.should().eql(1); + event.on.should().eql(event.addListener); + }, + + 'remove listener': function () { + var event = new io.EventEmitter; + function empty () { } + + event.on('test', empty); + event.on('test:more', empty); + event.removeAllListeners('test'); + + event.listeners('test').should().eql([]); + event.listeners('test:more').should().eql([empty]); + }, + + 'remove all listeners with no arguments': function () { + var event = new io.EventEmitter; + function empty () { } + + event.on('test', empty); + event.on('test:more', empty); + event.removeAllListeners(); + + event.listeners('test').should().eql([]); + event.listeners('test:more').should().eql([]); + }, + + 'remove listeners functions': function () { + var event = new io.EventEmitter + , calls = 0; + + function one () { ++calls } + function two () { ++calls } + function three () { ++calls } + + event.on('one', one); + event.removeListener('one', one); + event.listeners('one').should().eql([]); + + event.on('two', two); + event.removeListener('two', one); + event.listeners('two').should().eql([two]); + + event.on('three', three); + event.on('three', two); + event.removeListener('three', three); + event.listeners('three').should().eql([two]); + }, + + 'number of arguments': function () { + var event = new io.EventEmitter + , number = []; + + event.on('test', function () { + number.push(arguments.length); + }); + + event.emit('test'); + event.emit('test', null); + event.emit('test', null, null); + event.emit('test', null, null, null); + event.emit('test', null, null, null, null); + event.emit('test', null, null, null, null, null); + + [0, 1, 2, 3, 4, 5].should().eql(number); + }, + + 'once': function () { + var event = new io.EventEmitter + , calls = 0; + + event.once('test', function (a, b) { + ++calls; + }); + + event.emit('test', 'a', 'b'); + event.emit('test', 'a', 'b'); + event.emit('test', 'a', 'b'); + + function removed () { + should().fail('not removed'); + }; + + event.once('test:removed', removed); + event.removeListener('test:removed', removed); + event.emit('test:removed'); + + calls.should().eql(1); + } + + }; + +})( + 'undefined' == typeof module ? module = {} : module + , 'undefined' == typeof io ? require('socket.io-client') : io + , 'undefined' == typeof should || !should.fail ? require('should') : should +); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/io.test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/io.test.js new file mode 100644 index 00000000..d9f0b09e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/io.test.js @@ -0,0 +1,31 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +(function (module, io, should) { + + module.exports = { + + 'client version number': function () { + io.version.should().match(/([0-9]+)\.([0-9]+)\.([0-9]+)/); + }, + + 'socket.io protocol version': function () { + io.protocol.should().be.a('number'); + io.protocol.toString().should().match(/^\d+$/); + }, + + 'socket.io available transports': function () { + (io.transports.length > 0).should().be_true; + } + + }; + +})( + 'undefined' == typeof module ? module = {} : module + , 'undefined' == typeof io ? require('socket.io-client') : io + , 'undefined' == typeof should ? require('should') : should +); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/node/builder.common.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/node/builder.common.js new file mode 100644 index 00000000..fa8d46ed --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/node/builder.common.js @@ -0,0 +1,102 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +var vm = require('vm') + , should = require('should'); + +/** + * Generates evn variables for the vm so we can `emulate` a browser. + * @returns {Object} evn variables + */ + +exports.env = function env () { + var details = { + location: { + port: 8080 + , host: 'www.example.org' + , hostname: 'www.example.org' + , href: 'http://www.example.org/example/' + , pathname: '/example/' + , protocol: 'http:' + , search: '' + , hash: '' + } + , console: { + log: function(){}, + info: function(){}, + warn: function(){}, + error: function(){} + } + , navigator: { + userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7) AppleWebKit' + + '/534.27 (KHTML, like Gecko) Chrome/12.0.716.0 Safari/534.27' + , appName: 'socket.io' + , platform: process.platform + , appVersion: process.version + , } + , name: 'socket.io' + , innerWidth: 1024 + , innerHeight: 768 + , length: 1 + , outerWidth: 1024 + , outerHeight: 768 + , pageXOffset: 0 + , pageYOffset: 0 + , screenX: 0 + , screenY: 0 + , screenLeft: 0 + , screenTop: 0 + , scrollX: 0 + , scrollY: 0 + , scrollTop: 0 + , scrollLeft: 0 + , screen: { + width: 0 + , height: 0 + } + }; + + // circular references + details.window = details.self = details.contentWindow = details; + + // callable methods + details.Image = details.scrollTo = details.scrollBy = details.scroll = + details.resizeTo = details.resizeBy = details.prompt = details.print = + details.open = details.moveTo = details.moveBy = details.focus = + details.createPopup = details.confirm = details.close = details.blur = + details.alert = details.clearTimeout = details.clearInterval = + details.setInterval = details.setTimeout = details.XMLHttpRequest = + details.getComputedStyle = details.trigger = details.dispatchEvent = + details.removeEventListener = details.addEventListener = function(){}; + + // frames + details.frames = [details]; + + // document + details.document = details; + details.document.domain = details.location.href; + + return details; +}; + +/** + * Executes a script in a browser like env and returns + * the result + * + * @param {String} contents The script content + * @returns {Object} The evaluated script. + */ + +exports.execute = function execute (contents) { + var env = exports.env() + , script = vm.createScript(contents); + + // run the script with `browser like` globals + script.runInNewContext(env); + + return env; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/node/builder.test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/node/builder.test.js new file mode 100644 index 00000000..989e2bc5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/node/builder.test.js @@ -0,0 +1,131 @@ +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +/** + * Test dependencies. + */ + +var builder = require('../../bin/builder') + , common = require('./builder.common') + , should = require('should'); + +/** + * Tests. + */ + +module.exports = { + + 'version number': function () { + builder.version.should().match(/([0-9]+)\.([0-9]+)\.([0-9]+)/); + builder.version.should().equal(require('../../lib/io').version); + }, + + 'production build LOC': function () { + builder(function (err, result) { + should.strictEqual(err, null) + + var lines = result.split('\n'); + lines.length.should().be.below(5); + lines[0].should().match(/production/gi); + Buffer.byteLength(result).should().be.below(43000); + }); + }, + + 'development build LOC': function () { + builder({ minify: false }, function (err, result) { + should.strictEqual(err, null) + + var lines = result.split('\n'); + lines.length.should().be.above(5); + lines[0].should().match(/development/gi); + Buffer.byteLength(result).should().be.above(35000); + }); + }, + + 'default builds': function () { + builder(function (err, result) { + should.strictEqual(err, null); + + var io = common.execute(result).io + , transports = Object.keys(io.Transport) + , defaults = Object.keys(builder.transports); + + /* XHR transport is private, but still available */ + transports.length.should().be.equal(defaults.length + 1); + + defaults.forEach(function (transport) { + transports.indexOf(transport).should().be.above(-1); + }) + }); + }, + + 'custom build': function () { + builder(['websocket'], function (err, result) { + should.strictEqual(err, null); + + var io = common.execute(result).io + , transports = Object.keys(io.Transport); + + transports.should().have.length(1); + transports[0].should().eql('websocket'); + }); + }, + + 'custom code': function () { + var custom = 'var hello = "world";'; + builder({ custom: [custom], minify: false }, function (err, result) { + should.strictEqual(err, null); + + result.should().include.string(custom); + }); + }, + + 'node if': function () { + var custom = '// if node \nvar hello = "world";\n' + + '// end node\nvar pew = "pew";'; + + builder({ custom: [custom], minify: false }, function (err, result) { + should.strictEqual(err, null); + + result.should().not.include.string(custom); + result.should().not.include.string('// if node'); + result.should().not.include.string('// end node'); + result.should().not.include.string('"world"'); + + result.should().include.string('var pew = "pew"'); + }); + }, + + 'preserve the encoding during minification': function () { + builder(function (err, result) { + should.strictEqual(err, null); + + result.should().match(/(\\ufffd)/g); + }) + }, + + 'globals': function () { + builder(function (err, result) { + should.strictEqual(err, null); + + var io = common.execute(result) + , env = common.env() + , allowed = ['io', 'swfobject', 'WEB_SOCKET_DISABLE_AUTO_INITIALIZATION']; + + Array.prototype.push.apply(allowed, Object.keys(env)); + + Object.keys(io).forEach(function (global) { + var index = allowed.indexOf(global); + + // the global is not allowed! + if (!~index) { + throw new Error('Global leak: ' + global); + } + }); + }) + } + +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/parser.test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/parser.test.js new file mode 100644 index 00000000..0022afb2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/parser.test.js @@ -0,0 +1,360 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +(function (module, io, should) { + + var parser = io.parser; + + module.exports = { + + 'decoding error packet': function () { + parser.decodePacket('7:::').should().eql({ + type: 'error' + , reason: '' + , advice: '' + , endpoint: '' + }); + }, + + 'decoding error packet with reason': function () { + parser.decodePacket('7:::0').should().eql({ + type: 'error' + , reason: 'transport not supported' + , advice: '' + , endpoint: '' + }); + }, + + 'decoding error packet with reason and advice': function () { + parser.decodePacket('7:::2+0').should().eql({ + type: 'error' + , reason: 'unauthorized' + , advice: 'reconnect' + , endpoint: '' + }); + }, + + 'decoding error packet with endpoint': function () { + parser.decodePacket('7::/woot').should().eql({ + type: 'error' + , reason: '' + , advice: '' + , endpoint: '/woot' + }); + }, + + 'decoding ack packet': function () { + parser.decodePacket('6:::140').should().eql({ + type: 'ack' + , ackId: '140' + , endpoint: '' + , args: [] + }); + }, + + 'decoding ack packet with args': function () { + parser.decodePacket('6:::12+["woot","wa"]').should().eql({ + type: 'ack' + , ackId: '12' + , endpoint: '' + , args: ['woot', 'wa'] + }); + }, + + 'decoding ack packet with bad json': function () { + var thrown = false; + + try { + parser.decodePacket('6:::1+{"++]').should().eql({ + type: 'ack' + , ackId: '1' + , endpoint: '' + , args: [] + }); + } catch (e) { + thrown = true; + } + + thrown.should().be_false; + }, + + 'decoding json packet': function () { + parser.decodePacket('4:::"2"').should().eql({ + type: 'json' + , endpoint: '' + , data: '2' + }); + }, + + 'decoding json packet with message id and ack data': function () { + parser.decodePacket('4:1+::{"a":"b"}').should().eql({ + type: 'json' + , id: 1 + , ack: 'data' + , endpoint: '' + , data: { a: 'b' } + }); + }, + + 'decoding an event packet': function () { + parser.decodePacket('5:::{"name":"woot"}').should().eql({ + type: 'event' + , name: 'woot' + , endpoint: '' + , args: [] + }); + }, + + 'decoding an event packet with message id and ack': function () { + parser.decodePacket('5:1+::{"name":"tobi"}').should().eql({ + type: 'event' + , id: 1 + , ack: 'data' + , endpoint: '' + , name: 'tobi' + , args: [] + }); + }, + + 'decoding an event packet with data': function () { + parser.decodePacket('5:::{"name":"edwald","args":[{"a": "b"},2,"3"]}') + .should().eql({ + type: 'event' + , name: 'edwald' + , endpoint: '' + , args: [{a: 'b'}, 2, '3'] + }); + }, + + 'decoding a message packet': function () { + parser.decodePacket('3:::woot').should().eql({ + type: 'message' + , endpoint: '' + , data: 'woot' + }); + }, + + 'decoding a message packet with id and endpoint': function () { + parser.decodePacket('3:5:/tobi').should().eql({ + type: 'message' + , id: 5 + , ack: true + , endpoint: '/tobi' + , data: '' + }); + }, + + 'decoding a heartbeat packet': function () { + parser.decodePacket('2:::').should().eql({ + type: 'heartbeat' + , endpoint: '' + }); + }, + + 'decoding a connection packet': function () { + parser.decodePacket('1::/tobi').should().eql({ + type: 'connect' + , endpoint: '/tobi' + , qs: '' + }); + }, + + 'decoding a connection packet with query string': function () { + parser.decodePacket('1::/test:?test=1').should().eql({ + type: 'connect' + , endpoint: '/test' + , qs: '?test=1' + }); + }, + + 'decoding a disconnection packet': function () { + parser.decodePacket('0::/woot').should().eql({ + type: 'disconnect' + , endpoint: '/woot' + }); + }, + + 'encoding error packet': function () { + parser.encodePacket({ + type: 'error' + , reason: '' + , advice: '' + , endpoint: '' + }).should().eql('7::'); + }, + + 'encoding error packet with reason': function () { + parser.encodePacket({ + type: 'error' + , reason: 'transport not supported' + , advice: '' + , endpoint: '' + }).should().eql('7:::0'); + }, + + 'encoding error packet with reason and advice': function () { + parser.encodePacket({ + type: 'error' + , reason: 'unauthorized' + , advice: 'reconnect' + , endpoint: '' + }).should().eql('7:::2+0'); + }, + + 'encoding error packet with endpoint': function () { + parser.encodePacket({ + type: 'error' + , reason: '' + , advice: '' + , endpoint: '/woot' + }).should().eql('7::/woot'); + }, + + 'encoding ack packet': function () { + parser.encodePacket({ + type: 'ack' + , ackId: '140' + , endpoint: '' + , args: [] + }).should().eql('6:::140'); + }, + + 'encoding ack packet with args': function () { + parser.encodePacket({ + type: 'ack' + , ackId: '12' + , endpoint: '' + , args: ['woot', 'wa'] + }).should().eql('6:::12+["woot","wa"]'); + }, + + 'encoding json packet': function () { + parser.encodePacket({ + type: 'json' + , endpoint: '' + , data: '2' + }).should().eql('4:::"2"'); + }, + + 'encoding json packet with message id and ack data': function () { + parser.encodePacket({ + type: 'json' + , id: 1 + , ack: 'data' + , endpoint: '' + , data: { a: 'b' } + }).should().eql('4:1+::{"a":"b"}'); + }, + + 'encoding an event packet': function () { + parser.encodePacket({ + type: 'event' + , name: 'woot' + , endpoint: '' + , args: [] + }).should().eql('5:::{"name":"woot"}'); + }, + + 'encoding an event packet with message id and ack': function () { + parser.encodePacket({ + type: 'event' + , id: 1 + , ack: 'data' + , endpoint: '' + , name: 'tobi' + , args: [] + }).should().eql('5:1+::{"name":"tobi"}'); + }, + + 'encoding an event packet with data': function () { + parser.encodePacket({ + type: 'event' + , name: 'edwald' + , endpoint: '' + , args: [{a: 'b'}, 2, '3'] + }).should().eql('5:::{"name":"edwald","args":[{"a":"b"},2,"3"]}'); + }, + + 'encoding a message packet': function () { + parser.encodePacket({ + type: 'message' + , endpoint: '' + , data: 'woot' + }).should().eql('3:::woot'); + }, + + 'encoding a message packet with id and endpoint': function () { + parser.encodePacket({ + type: 'message' + , id: 5 + , ack: true + , endpoint: '/tobi' + , data: '' + }).should().eql('3:5:/tobi'); + }, + + 'encoding a heartbeat packet': function () { + parser.encodePacket({ + type: 'heartbeat' + , endpoint: '' + }).should().eql('2::'); + }, + + 'encoding a connection packet': function () { + parser.encodePacket({ + type: 'connect' + , endpoint: '/tobi' + , qs: '' + }).should().eql('1::/tobi'); + }, + + 'encoding a connection packet with query string': function () { + parser.encodePacket({ + type: 'connect' + , endpoint: '/test' + , qs: '?test=1' + }).should().eql('1::/test:?test=1'); + }, + + 'encoding a disconnection packet': function () { + parser.encodePacket({ + type: 'disconnect' + , endpoint: '/woot' + }).should().eql('0::/woot'); + }, + + 'test decoding a payload': function () { + parser.decodePayload('\ufffd5\ufffd3:::5\ufffd7\ufffd3:::53d' + + '\ufffd3\ufffd0::').should().eql([ + { type: 'message', data: '5', endpoint: '' } + , { type: 'message', data: '53d', endpoint: '' } + , { type: 'disconnect', endpoint: '' } + ]); + }, + + 'test encoding a payload': function () { + parser.encodePayload([ + parser.encodePacket({ type: 'message', data: '5', endpoint: '' }) + , parser.encodePacket({ type: 'message', data: '53d', endpoint: '' }) + ]).should().eql('\ufffd5\ufffd3:::5\ufffd7\ufffd3:::53d') + }, + + 'test decoding newline': function () { + parser.decodePacket('3:::\n').should().eql({ + type: 'message' + , endpoint: '' + , data: '\n' + }); + } + + }; + +})( + 'undefined' == typeof module ? module = {} : module + , 'undefined' == typeof io ? require('socket.io-client') : io + , 'undefined' == typeof should ? require('should') : should +); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/socket.test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/socket.test.js new file mode 100644 index 00000000..eae49564 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/socket.test.js @@ -0,0 +1,422 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +(function (module, io, should) { + + if ('object' == typeof global) { + return module.exports = { '': function () {} }; + } + + module.exports = { + + 'test connecting the socket and disconnecting': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + socket.disconnect(); + next(); + }); + }, + + 'test receiving messages': function (next) { + var socket = create() + , connected = false + , messages = 0; + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + connected = true; + }); + + socket.on('message', function (i) { + String(++messages).should().equal(i); + }); + + socket.on('disconnect', function (reason) { + connected.should().be_true; + messages.should().equal(3); + reason.should().eql('booted'); + next(); + }); + }, + + 'test sending messages': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + socket.send('echo'); + + socket.on('message', function (msg) { + msg.should().equal('echo'); + socket.disconnect(); + next(); + }); + }); + }, + + 'test manual buffer flushing': function (next) { + var socket = create(); + + socket.socket.options['manualFlush'] = true; + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + socket.socket.connected = false; + socket.send('buffered'); + socket.socket.onConnect(); + socket.socket.flushBuffer(); + + socket.on('message', function (msg) { + msg.should().equal('buffered'); + socket.disconnect(); + next(); + }); + }); + }, + + 'test automatic buffer flushing': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + socket.socket.connected = false; + socket.send('buffered'); + socket.socket.onConnect(); + + socket.on('message', function (msg) { + msg.should().equal('buffered'); + socket.disconnect(); + next(); + }); + }); + }, + + 'test acks sent from client': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + socket.on('message', function (msg) { + if ('tobi 2' == msg) { + socket.disconnect(); + next(); + } + }); + }); + }, + + 'test acks sent from server': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + socket.send('ooo', function () { + socket.disconnect(); + next(); + }); + }); + }, + + 'test connecting to namespaces': function (next) { + var io = create() + , socket = io.socket + , namespaces = 2 + , connect = 0; + + function finish () { + socket.of('').disconnect(); + connect.should().equal(3); + next(); + } + + socket.on('connect', function(){ + connect++; + }); + + socket.of('/woot').on('connect', function () { + connect++; + }).on('message', function (msg) { + msg.should().equal('connected to woot'); + --namespaces || finish(); + }).on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.of('/chat').on('connect', function () { + connect++; + }).on('message', function (msg) { + msg.should().equal('connected to chat'); + --namespaces || finish(); + }).on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + }, + + 'test disconnecting from namespaces': function (next) { + var socket = create().socket + , namespaces = 2 + , disconnections = 0; + + function finish () { + socket.of('').disconnect(); + next(); + }; + + socket.of('/a').on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.of('/a').on('connect', function () { + socket.of('/a').disconnect(); + }); + + socket.of('/a').on('disconnect', function () { + --namespaces || finish(); + }); + + socket.of('/b').on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.of('/b').on('connect', function () { + socket.of('/b').disconnect(); + }); + + socket.of('/b').on('disconnect', function () { + --namespaces || finish(); + }); + }, + + 'test authorizing for namespaces': function (next) { + var socket = create().socket + + function finish () { + socket.of('').disconnect(); + next(); + }; + + socket.of('/a') + .on('connect_failed', function (msg) { + next(); + }) + .on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + }, + + 'test sending json from server': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('message', function (msg) { + msg.should().eql(3141592); + socket.disconnect(); + next(); + }); + }, + + 'test sending json from client': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.json.send([1, 2, 3]); + socket.on('message', function (msg) { + msg.should().equal('echo'); + socket.disconnect(); + next(); + }); + }, + + 'test emitting an event from server': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('woot', function () { + socket.disconnect(); + next(); + }); + }, + + 'test emitting an event to server': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.emit('woot'); + socket.on('echo', function () { + socket.disconnect(); + next(); + }) + }, + + 'test emitting multiple events at once to the server': function (next) { + var socket = create(); + + socket.on('connect', function () { + socket.emit('print', 'foo'); + socket.emit('print', 'bar'); + }); + + socket.on('done', function () { + socket.disconnect(); + next(); + }); + }, + + 'test emitting an event from server and sending back data': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('woot', function (a, fn) { + a.should().eql(1); + fn('test'); + + socket.on('done', function () { + socket.disconnect(); + next(); + }); + }); + }, + + 'test emitting an event to server and sending back data': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.emit('tobi', 1, 2, function (a) { + a.should().eql({ hello: 'world' }); + socket.disconnect(); + next(); + }); + }, + + 'test encoding a payload': function (next) { + var socket = create('/woot'); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('connect', function () { + socket.socket.setBuffer(true); + socket.send('ñ'); + socket.send('ñ'); + socket.send('ñ'); + socket.send('ñ'); + socket.socket.setBuffer(false); + }); + + socket.on('done', function () { + socket.disconnect(); + next(); + }); + }, + + 'test sending query strings to the server': function (next) { + var socket = create('?foo=bar'); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.on('message', function (data) { + data.query.foo.should().eql('bar'); + + socket.disconnect(); + next(); + }); + }, + + 'test sending newline': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.send('\n'); + + socket.on('done', function () { + socket.disconnect(); + next(); + }); + }, + + 'test sending unicode': function (next) { + var socket = create(); + + socket.on('error', function (msg) { + throw new Error(msg || 'Received an error'); + }); + + socket.json.send({ test: "☃" }); + + socket.on('done', function () { + socket.disconnect(); + next(); + }); + }, + + 'test webworker connection': function (next) { + if (!window.Worker) { + return next(); + } + + var worker = new Worker('/test/worker.js'); + worker.postMessage(uri()); + worker.onmessage = function (ev) { + if ('done!' == ev.data) return next(); + throw new Error('Unexpected message: ' + ev.data); + } + } + + }; + +})( + 'undefined' == typeof module ? module = {} : module + , 'undefined' == typeof io ? require('socket.io-client') : io + , 'undefined' == typeof should ? require('should-browser') : should +); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/util.test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/util.test.js new file mode 100644 index 00000000..30db5a63 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/util.test.js @@ -0,0 +1,156 @@ + +/*! + * socket.io-node + * Copyright(c) 2011 LearnBoost + * MIT Licensed + */ + +(function (module, io, should) { + + module.exports = { + + 'parse uri': function () { + var http = io.util.parseUri('http://google.com') + , https = io.util.parseUri('https://www.google.com:80') + , query = io.util.parseUri('google.com:8080/foo/bar?foo=bar'); + + http.protocol.should().eql('http'); + http.port.should().eql(''); + http.host.should().eql('google.com'); + https.protocol.should().eql('https'); + https.port.should().eql('80'); + https.host.should().eql('www.google.com'); + query.port.should().eql('8080'); + query.query.should().eql('foo=bar'); + query.path.should().eql('/foo/bar'); + query.relative.should().eql('/foo/bar?foo=bar'); + }, + + 'unique uri': function () { + var protocol = io.util.parseUri('http://google.com') + , noprotocol = io.util.parseUri('google.com') + , https = io.util.parseUri('https://google.com') + , path = io.util.parseUri('https://google.com/google.com/com/?foo=bar'); + + if ('object' == typeof window) { + io.util.uniqueUri(protocol).should().eql('http://google.com:3000'); + io.util.uniqueUri(noprotocol).should().eql('http://google.com:3000'); + } else { + io.util.uniqueUri(protocol).should().eql('http://google.com:80'); + io.util.uniqueUri(noprotocol).should().eql('http://google.com:80'); + } + + io.util.uniqueUri(https).should().eql('https://google.com:443'); + io.util.uniqueUri(path).should().eql('https://google.com:443'); + }, + + 'chunk query string': function () { + io.util.chunkQuery('foo=bar').should().be.a('object'); + io.util.chunkQuery('foo=bar').foo.should().eql('bar'); + }, + + 'merge query strings': function () { + var base = io.util.query('foo=bar', 'foo=baz') + , add = io.util.query('foo=bar', 'bar=foo') + + base.should().eql('?foo=baz'); + add.should().eql('?foo=bar&bar=foo'); + + io.util.query('','').should().eql(''); + io.util.query('foo=bar', '').should().eql('?foo=bar'); + io.util.query('', 'foo=bar').should().eql('?foo=bar'); + }, + + 'request': function () { + var type = typeof io.util.request(); + type.should().eql('object'); + }, + + 'is array': function () { + io.util.isArray([]).should().be_true; + io.util.isArray({}).should().be_false; + io.util.isArray('str').should().be_false; + io.util.isArray(new Date).should().be_false; + io.util.isArray(true).should().be_false; + io.util.isArray(arguments).should().be_false; + }, + + 'merge, deep merge': function () { + var start = { + foo: 'bar' + , bar: 'baz' + } + , duplicate = { + foo: 'foo' + , bar: 'bar' + } + , extra = { + ping: 'pong' + } + , deep = { + level1:{ + foo: 'bar' + , level2: { + foo: 'bar' + , level3:{ + foo: 'bar' + , rescursive: deep + } + } + } + } + // same structure, but changed names + , deeper = { + foo: 'bar' + , level1:{ + foo: 'baz' + , level2: { + foo: 'foo' + , level3:{ + foo: 'pewpew' + , rescursive: deep + } + } + } + }; + + io.util.merge(start, duplicate); + + start.foo.should().eql('foo'); + start.bar.should().eql('bar'); + + io.util.merge(start, extra); + start.ping.should().eql('pong'); + start.foo.should().eql('foo'); + + io.util.merge(deep, deeper); + + deep.foo.should().eql('bar'); + deep.level1.foo.should().eql('baz'); + deep.level1.level2.foo.should().eql('foo'); + deep.level1.level2.level3.foo.should().eql('pewpew'); + }, + + 'defer': function (next) { + var now = +new Date; + + io.util.defer(function () { + ((new Date - now) >= ( io.util.webkit ? 100 : 0 )).should().be_true(); + next(); + }) + }, + + 'indexOf': function () { + var data = ['socket', 2, 3, 4, 'socket', 5, 6, 7, 'io']; + io.util.indexOf(data, 'socket', 1).should().eql(4); + io.util.indexOf(data, 'socket').should().eql(0); + io.util.indexOf(data, 'waffles').should().eql(-1); + } + + }; + +})( + 'undefined' == typeof module ? module = {} : module + , 'undefined' == typeof io ? require('socket.io-client') : io + , 'undefined' == typeof should ? require('should') : should +); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/worker.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/worker.js new file mode 100644 index 00000000..c5426326 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/node_modules/socket.io-client/test/worker.js @@ -0,0 +1,20 @@ +importScripts('/socket.io/socket.io.js'); + +self.onmessage = function (ev) { + var url = ev.data + , socket = io.connect(url); + + socket.on('done', function () { + self.postMessage('done!'); + }); + + socket.on('connect_failed', function () { + self.postMessage('connect failed'); + }); + + socket.on('error', function () { + self.postMessage('error'); + }); + + socket.send('woot'); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/package.json new file mode 100644 index 00000000..6ab7c26f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/node_modules/socket.io/package.json @@ -0,0 +1,87 @@ +{ + "name": "socket.io", + "version": "0.9.17", + "description": "Real-time apps made cross-browser & easy with a WebSocket-like API", + "homepage": "http://socket.io", + "keywords": [ + "websocket", + "socket", + "realtime", + "socket.io", + "comet", + "ajax" + ], + "author": { + "name": "Guillermo Rauch", + "email": "guillermo@learnboost.com" + }, + "contributors": [ + { + "name": "Guillermo Rauch", + "email": "rauchg@gmail.com" + }, + { + "name": "Arnout Kazemier", + "email": "info@3rd-eden.com" + }, + { + "name": "Vladimir Dronnikov", + "email": "dronnikov@gmail.com" + }, + { + "name": "Einar Otto Stangvik", + "email": "einaros@gmail.com" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/LearnBoost/socket.io.git" + }, + "dependencies": { + "socket.io-client": "0.9.16", + "policyfile": "0.0.4", + "base64id": "0.1.0", + "redis": "0.7.3" + }, + "devDependencies": { + "expresso": "0.9.2", + "should": "*", + "benchmark": "0.2.2", + "microtime": "0.1.3-1", + "colors": "0.5.1" + }, + "optionalDependencies": { + "redis": "0.7.3" + }, + "main": "index", + "engines": { + "node": ">= 0.4.0" + }, + "scripts": { + "test": "make test" + }, + "bugs": { + "url": "https://github.com/LearnBoost/socket.io/issues" + }, + "_id": "socket.io@0.9.17", + "_shasum": "ca389268fb2cd5df4b59218490a08c907581c9ec", + "_from": "socket.io@>=0.9.0 <0.10.0", + "_npmVersion": "1.4.7", + "_npmUser": { + "name": "rauchg", + "email": "rauchg@gmail.com" + }, + "maintainers": [ + { + "name": "rauchg", + "email": "rauchg@gmail.com" + } + ], + "dist": { + "shasum": "ca389268fb2cd5df4b59218490a08c907581c9ec", + "tarball": "http://registry.npmjs.org/socket.io/-/socket.io-0.9.17.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/socket.io/-/socket.io-0.9.17.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/package.json new file mode 100644 index 00000000..77d8e634 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/instant-markdown-d/package.json @@ -0,0 +1,45 @@ +{ + "author": { + "name": "Suan-Aik Yeo", + "email": "yeosuanaik@gmail.com" + }, + "name": "instant-markdown-d", + "description": "Instantly-updating Markdown Server", + "version": "0.1.0", + "engine": "node", + "main": "instant-markdown-d", + "preferGlobal": "true", + "bin": { + "instant-markdown-d": "./instant-markdown-d" + }, + "dependencies": { + "highlight.js": "^8.4.0", + "markdown-it": "^3.0.3", + "send": "~0.1.0", + "socket.io": "" + }, + "gitHead": "1511b8591e0a0e3aadd92db7bd6634b1ada8286d", + "_id": "instant-markdown-d@0.1.0", + "scripts": {}, + "_shasum": "da1ffd10443b6b72c14d896b53d2925507a570c6", + "_from": "instant-markdown-d@0.1.0", + "_npmVersion": "2.1.3", + "_nodeVersion": "0.10.32", + "_npmUser": { + "name": "suan", + "email": "yeosuanaik@gmail.com" + }, + "maintainers": [ + { + "name": "suan", + "email": "yeosuanaik@gmail.com" + } + ], + "dist": { + "shasum": "da1ffd10443b6b72c14d896b53d2925507a570c6", + "tarball": "http://registry.npmjs.org/instant-markdown-d/-/instant-markdown-d-0.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/instant-markdown-d/-/instant-markdown-d-0.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.eslintrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.eslintrc new file mode 100644 index 00000000..6ebc5360 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.eslintrc @@ -0,0 +1,45 @@ +{ + "env": { + "node": true + }, + "rules": { + // 2-space indentation + "indent": [2, 2, {"SwitchCase": 1}], + // Disallow semi-colons, unless needed to disambiguate statement + "semi": [2, "never"], + // Require strings to use single quotes + "quotes": [2, "single"], + // Require curly braces for all control statements + "curly": 2, + // Disallow using variables and functions before they've been defined + "no-use-before-define": 2, + // Allow any case for variable naming + "camelcase": 0, + // Disallow unused variables, except as function arguments + "no-unused-vars": [2, {"args":"none"}], + // Allow leading underscores for method names + // REASON: we use underscores to denote private methods + "no-underscore-dangle": 0, + // Allow multi spaces around operators since they are + // used for alignment. This is not consistent in the + // code. + "no-multi-spaces": 0, + // Style rule is: most objects use { beforeColon: false, afterColon: true }, unless aligning which uses: + // + // { + // beforeColon : true, + // afterColon : true + // } + // + // eslint can't handle this, so the check is disabled. + "key-spacing": 0, + // Allow shadowing vars in outer scope (needs discussion) + "no-shadow": 0, + // Use if () { } + // ^ space + "space-after-keywords": [2, "always"], + // Use if () { } + // ^ space + "space-before-blocks": [2, "always"] + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.npmignore new file mode 100644 index 00000000..67fe11cc --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.npmignore @@ -0,0 +1,6 @@ +coverage +tests +node_modules +examples +release.sh +disabled.appveyor.yml diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.travis.yml new file mode 100644 index 00000000..c24c59b5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/.travis.yml @@ -0,0 +1,15 @@ +language: node_js +node_js: + - node + - io.js + - 0.12 + - 0.10 +sudo: false + +after_script: "npm run test-cov && cat ./coverage/lcov.info | codecov && cat ./coverage/lcov.info | coveralls" + +webhooks: + urls: https://webhooks.gitter.im/e/237280ed4796c19cc626 + on_success: change # options: [always|never|change] default: always + on_failure: always # options: [always|never|change] default: always + on_start: false # default: false diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/CHANGELOG.md new file mode 100644 index 00000000..7dc85ea1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/CHANGELOG.md @@ -0,0 +1,578 @@ +## Change Log + +### v2.67.0 (2015/11/19) +- [#1913](https://github.com/request/request/pull/1913) Update http-signature to version 1.1.0 🚀 (@greenkeeperio-bot) + +### v2.66.0 (2015/11/18) +- [#1906](https://github.com/request/request/pull/1906) Update README URLs based on HTTP redirects (@ReadmeCritic) +- [#1905](https://github.com/request/request/pull/1905) Convert typed arrays into regular buffers (@simov) +- [#1902](https://github.com/request/request/pull/1902) node-uuid@1.4.7 breaks build 🚨 (@greenkeeperio-bot) +- [#1894](https://github.com/request/request/pull/1894) Fix tunneling after redirection from https (Original: #1881) (@simov, @falms) +- [#1893](https://github.com/request/request/pull/1893) Update eslint to version 1.9.0 🚀 (@greenkeeperio-bot) +- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @Bloutiouf) +- [#1876](https://github.com/request/request/pull/1876) Implement loose matching for har mime types (@simov) +- [#1875](https://github.com/request/request/pull/1875) Update bluebird to version 3.0.2 🚀 (@simov, @greenkeeperio-bot) +- [#1871](https://github.com/request/request/pull/1871) Update browserify to version 12.0.1 🚀 (@greenkeeperio-bot) +- [#1866](https://github.com/request/request/pull/1866) Add missing quotes on x-token property in README (@miguelmota) +- [#1874](https://github.com/request/request/pull/1874) Fix typo in README.md (@gswalden) +- [#1860](https://github.com/request/request/pull/1860) Improve referer header tests and docs (@simov) +- [#1861](https://github.com/request/request/pull/1861) Remove redundant call to Stream constructor (@watson) +- [#1857](https://github.com/request/request/pull/1857) Fix Referer header to point to the original host name (@simov) +- [#1850](https://github.com/request/request/pull/1850) Update karma-coverage to version 0.5.3 🚀 (@greenkeeperio-bot) +- [#1847](https://github.com/request/request/pull/1847) Use node's latest version when building (@simov) +- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@Bloutiouf) +- [#1820](https://github.com/request/request/pull/1820) Set href as request.js uses it (@mgenereu) +- [#1840](https://github.com/request/request/pull/1840) Update http-signature to version 1.0.2 🚀 (@greenkeeperio-bot) +- [#1845](https://github.com/request/request/pull/1845) Update istanbul to version 0.4.0 🚀 (@greenkeeperio-bot) + +### v2.65.0 (2015/10/11) +- [#1833](https://github.com/request/request/pull/1833) Update aws-sign2 to version 0.6.0 🚀 (@greenkeeperio-bot) +- [#1811](https://github.com/request/request/pull/1811) Enable loose cookie parsing in tough-cookie (@Sebmaster) +- [#1830](https://github.com/request/request/pull/1830) Bring back tilde ranges for all dependencies (@simov) +- [#1821](https://github.com/request/request/pull/1821) Implement support for RFC 2617 MD5-sess algorithm. (@BigDSK) +- [#1828](https://github.com/request/request/pull/1828) Updated qs dependency to 5.2.0 (@acroca) +- [#1818](https://github.com/request/request/pull/1818) Extract `readResponseBody` method out of `onRequestResponse` (@pvoisin) +- [#1819](https://github.com/request/request/pull/1819) Run stringify once (@mgenereu) +- [#1814](https://github.com/request/request/pull/1814) Updated har-validator to version 2.0.2 (@greenkeeperio-bot) +- [#1807](https://github.com/request/request/pull/1807) Updated tough-cookie to version 2.1.0 (@greenkeeperio-bot) +- [#1800](https://github.com/request/request/pull/1800) Add caret ranges for devDependencies, except eslint (@simov) +- [#1799](https://github.com/request/request/pull/1799) Updated karma-browserify to version 4.4.0 (@greenkeeperio-bot) +- [#1797](https://github.com/request/request/pull/1797) Updated tape to version 4.2.0 (@greenkeeperio-bot) +- [#1788](https://github.com/request/request/pull/1788) Pinned all dependencies (@greenkeeperio-bot) + +### v2.64.0 (2015/09/25) +- [#1787](https://github.com/request/request/pull/1787) npm ignore examples, release.sh and disabled.appveyor.yml (@thisconnect) +- [#1775](https://github.com/request/request/pull/1775) Fix typo in README.md (@djchie) +- [#1776](https://github.com/request/request/pull/1776) Changed word 'conjuction' to read 'conjunction' in README.md (@ryanwholey) +- [#1785](https://github.com/request/request/pull/1785) Revert: Set default application/json content-type when using json option #1772 (@simov) + +### v2.63.0 (2015/09/21) +- [#1772](https://github.com/request/request/pull/1772) Set default application/json content-type when using json option (@jzaefferer) + +### v2.62.0 (2015/09/15) +- [#1768](https://github.com/request/request/pull/1768) Add node 4.0 to the list of build targets (@simov) +- [#1767](https://github.com/request/request/pull/1767) Query strings now cooperate with unix sockets (@JoshWillik) +- [#1750](https://github.com/request/request/pull/1750) Revert doc about installation of tough-cookie added in #884 (@LoicMahieu) +- [#1746](https://github.com/request/request/pull/1746) Missed comma in Readme (@vladimirich) +- [#1743](https://github.com/request/request/pull/1743) Fix options not being initialized in defaults method (@simov) + +### v2.61.0 (2015/08/19) +- [#1721](https://github.com/request/request/pull/1721) Minor fix in README.md (@arbaaz) +- [#1733](https://github.com/request/request/pull/1733) Avoid useless Buffer transformation (@michelsalib) +- [#1726](https://github.com/request/request/pull/1726) Update README.md (@paulomcnally) +- [#1715](https://github.com/request/request/pull/1715) Fix forever option in node > 0.10 #1709 (@calibr) +- [#1716](https://github.com/request/request/pull/1716) Do not create Buffer from Object in setContentLength(iojs v3.0 issue) (@calibr) +- [#1711](https://github.com/request/request/pull/1711) Add ability to detect connect timeouts (@kevinburke) +- [#1712](https://github.com/request/request/pull/1712) Set certificate expiration to August 2, 2018 (@kevinburke) +- [#1700](https://github.com/request/request/pull/1700) debug() when JSON.parse() on a response body fails (@phillipj) + +### v2.60.0 (2015/07/21) +- [#1687](https://github.com/request/request/pull/1687) Fix caseless bug - content-type not being set for multipart/form-data (@simov, @garymathews) + +### v2.59.0 (2015/07/20) +- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. Forever option defaults to using http(s).Agent in node 0.12+ (@simov) +- [#1679](https://github.com/request/request/pull/1679) Fix - do not remove OAuth param when using OAuth realm (@simov, @jhalickman) +- [#1668](https://github.com/request/request/pull/1668) updated dependencies (@deamme) +- [#1656](https://github.com/request/request/pull/1656) Fix form method (@simov) +- [#1651](https://github.com/request/request/pull/1651) Preserve HEAD method when using followAllRedirects (@simov) +- [#1652](https://github.com/request/request/pull/1652) Update `encoding` option documentation in README.md (@daniel347x) +- [#1650](https://github.com/request/request/pull/1650) Allow content-type overriding when using the `form` option (@simov) +- [#1646](https://github.com/request/request/pull/1646) Clarify the nature of setting `ca` in `agentOptions` (@jeffcharles) + +### v2.58.0 (2015/06/16) +- [#1638](https://github.com/request/request/pull/1638) Use the `extend` module to deep extend in the defaults method (@simov) +- [#1631](https://github.com/request/request/pull/1631) Move tunnel logic into separate module (@simov) +- [#1634](https://github.com/request/request/pull/1634) Fix OAuth query transport_method (@simov) +- [#1603](https://github.com/request/request/pull/1603) Add codecov (@simov) + +### v2.57.0 (2015/05/31) +- [#1615](https://github.com/request/request/pull/1615) Replace '.client' with '.socket' as the former was deprecated in 2.2.0. (@ChALkeR) + +### v2.56.0 (2015/05/28) +- [#1610](https://github.com/request/request/pull/1610) Bump module dependencies (@simov) +- [#1600](https://github.com/request/request/pull/1600) Extract the querystring logic into separate module (@simov) +- [#1607](https://github.com/request/request/pull/1607) Re-generate certificates (@simov) +- [#1599](https://github.com/request/request/pull/1599) Move getProxyFromURI logic below the check for Invaild URI (#1595) (@simov) +- [#1598](https://github.com/request/request/pull/1598) Fix the way http verbs are defined in order to please intellisense IDEs (@simov, @flannelJesus) +- [#1591](https://github.com/request/request/pull/1591) A few minor fixes: (@simov) +- [#1584](https://github.com/request/request/pull/1584) Refactor test-default tests (according to comments in #1430) (@simov) +- [#1585](https://github.com/request/request/pull/1585) Fixing documentation regarding TLS options (#1583) (@mainakae) +- [#1574](https://github.com/request/request/pull/1574) Refresh the oauth_nonce on redirect (#1573) (@simov) +- [#1570](https://github.com/request/request/pull/1570) Discovered tests that weren't properly running (@seanstrom) +- [#1569](https://github.com/request/request/pull/1569) Fix pause before response arrives (@kevinoid) +- [#1558](https://github.com/request/request/pull/1558) Emit error instead of throw (@simov) +- [#1568](https://github.com/request/request/pull/1568) Fix stall when piping gzipped response (@kevinoid) +- [#1560](https://github.com/request/request/pull/1560) Update combined-stream (@apechimp) +- [#1543](https://github.com/request/request/pull/1543) Initial support for oauth_body_hash on json payloads (@simov, @aesopwolf) +- [#1541](https://github.com/request/request/pull/1541) Fix coveralls (@simov) +- [#1540](https://github.com/request/request/pull/1540) Fix recursive defaults for convenience methods (@simov) +- [#1536](https://github.com/request/request/pull/1536) More eslint style rules (@froatsnook) +- [#1533](https://github.com/request/request/pull/1533) Adding dependency status bar to README.md (@YasharF) +- [#1539](https://github.com/request/request/pull/1539) ensure the latest version of har-validator is included (@ahmadnassri) +- [#1516](https://github.com/request/request/pull/1516) forever+pool test (@devTristan) + +### v2.55.0 (2015/04/05) +- [#1520](https://github.com/request/request/pull/1520) Refactor defaults (@simov) +- [#1525](https://github.com/request/request/pull/1525) Delete request headers with undefined value. (@froatsnook) +- [#1521](https://github.com/request/request/pull/1521) Add promise tests (@simov) +- [#1518](https://github.com/request/request/pull/1518) Fix defaults (@simov) +- [#1515](https://github.com/request/request/pull/1515) Allow static invoking of convenience methods (@simov) +- [#1505](https://github.com/request/request/pull/1505) Fix multipart boundary extraction regexp (@simov) +- [#1510](https://github.com/request/request/pull/1510) Fix basic auth form data (@simov) + +### v2.54.0 (2015/03/24) +- [#1501](https://github.com/request/request/pull/1501) HTTP Archive 1.2 support (@ahmadnassri) +- [#1486](https://github.com/request/request/pull/1486) Add a test for the forever agent (@akshayp) +- [#1500](https://github.com/request/request/pull/1500) Adding handling for no auth method and null bearer (@philberg) +- [#1498](https://github.com/request/request/pull/1498) Add table of contents in readme (@simov) +- [#1477](https://github.com/request/request/pull/1477) Add support for qs options via qsOptions key (@simov) +- [#1496](https://github.com/request/request/pull/1496) Parameters encoded to base 64 should be decoded as UTF-8, not ASCII. (@albanm) +- [#1494](https://github.com/request/request/pull/1494) Update eslint (@froatsnook) +- [#1474](https://github.com/request/request/pull/1474) Require Colon in Basic Auth (@erykwalder) +- [#1481](https://github.com/request/request/pull/1481) Fix baseUrl and redirections. (@burningtree) +- [#1469](https://github.com/request/request/pull/1469) Feature/base url (@froatsnook) +- [#1459](https://github.com/request/request/pull/1459) Add option to time request/response cycle (including rollup of redirects) (@aaron-em) +- [#1468](https://github.com/request/request/pull/1468) Re-enable io.js/node 0.12 build (@simov, @mikeal, @BBB) +- [#1442](https://github.com/request/request/pull/1442) Fixed the issue with strictSSL tests on 0.12 & io.js by explicitly setting a cipher that matches the cert. (@BBB, @nicolasmccurdy, @demohi, @simov, @0x4139) +- [#1460](https://github.com/request/request/pull/1460) localAddress or proxy config is lost when redirecting (@simov, @0x4139) +- [#1453](https://github.com/request/request/pull/1453) Test on Node.js 0.12 and io.js with allowed failures (@nicolasmccurdy, @demohi) +- [#1426](https://github.com/request/request/pull/1426) Fixing tests to pass on io.js and node 0.12 (only test-https.js stiff failing) (@mikeal) +- [#1446](https://github.com/request/request/pull/1446) Missing HTTP referer header with redirects Fixes #1038 (@simov, @guimonz) +- [#1428](https://github.com/request/request/pull/1428) Deprecate Node v0.8.x (@nylen) +- [#1436](https://github.com/request/request/pull/1436) Add ability to set a requester without setting default options (@tikotzky) +- [#1435](https://github.com/request/request/pull/1435) dry up verb methods (@sethpollack) +- [#1423](https://github.com/request/request/pull/1423) Allow fully qualified multipart content-type header (@simov) +- [#1430](https://github.com/request/request/pull/1430) Fix recursive requester (@tikotzky) +- [#1429](https://github.com/request/request/pull/1429) Throw error when making HEAD request with a body (@tikotzky) +- [#1419](https://github.com/request/request/pull/1419) Add note that the project is broken in 0.12.x (@nylen) +- [#1413](https://github.com/request/request/pull/1413) Fix basic auth (@simov) +- [#1397](https://github.com/request/request/pull/1397) Improve pipe-from-file tests (@nylen) + +### v2.53.0 (2015/02/02) +- [#1396](https://github.com/request/request/pull/1396) Do not rfc3986 escape JSON bodies (@nylen, @simov) +- [#1392](https://github.com/request/request/pull/1392) Improve `timeout` option description (@watson) + +### v2.52.0 (2015/02/02) +- [#1383](https://github.com/request/request/pull/1383) Add missing HTTPS options that were not being passed to tunnel (@brichard19) (@nylen) +- [#1388](https://github.com/request/request/pull/1388) Upgrade mime-types package version (@roderickhsiao) +- [#1389](https://github.com/request/request/pull/1389) Revise Setup Tunnel Function (@seanstrom) +- [#1374](https://github.com/request/request/pull/1374) Allow explicitly disabling tunneling for proxied https destinations (@nylen) +- [#1376](https://github.com/request/request/pull/1376) Use karma-browserify for tests. Add browser test coverage reporter. (@eiriksm) +- [#1366](https://github.com/request/request/pull/1366) Refactor OAuth into separate module (@simov) +- [#1373](https://github.com/request/request/pull/1373) Rewrite tunnel test to be pure Node.js (@nylen) +- [#1371](https://github.com/request/request/pull/1371) Upgrade test reporter (@nylen) +- [#1360](https://github.com/request/request/pull/1360) Refactor basic, bearer, digest auth logic into separate class (@simov) +- [#1354](https://github.com/request/request/pull/1354) Remove circular dependency from debugging code (@nylen) +- [#1351](https://github.com/request/request/pull/1351) Move digest auth into private prototype method (@simov) +- [#1352](https://github.com/request/request/pull/1352) Update hawk dependency to ~2.3.0 (@mridgway) +- [#1353](https://github.com/request/request/pull/1353) Correct travis-ci badge (@dogancelik) +- [#1349](https://github.com/request/request/pull/1349) Make sure we return on errored browser requests. (@eiriksm) +- [#1346](https://github.com/request/request/pull/1346) getProxyFromURI Extraction Refactor (@seanstrom) +- [#1337](https://github.com/request/request/pull/1337) Standardize test ports on 6767 (@nylen) +- [#1341](https://github.com/request/request/pull/1341) Emit FormData error events as Request error events (@nylen, @rwky) +- [#1343](https://github.com/request/request/pull/1343) Clean up readme badges, and add Travis and Coveralls badges (@nylen) +- [#1345](https://github.com/request/request/pull/1345) Update README.md (@Aaron-Hartwig) +- [#1338](https://github.com/request/request/pull/1338) Always wait for server.close() callback in tests (@nylen) +- [#1342](https://github.com/request/request/pull/1342) Add mock https server and redo start of browser tests for this purpose. (@eiriksm) +- [#1339](https://github.com/request/request/pull/1339) Improve auth docs (@nylen) +- [#1335](https://github.com/request/request/pull/1335) Add support for OAuth plaintext signature method (@simov) +- [#1332](https://github.com/request/request/pull/1332) Add clean script to remove test-browser.js after the tests run (@seanstrom) +- [#1327](https://github.com/request/request/pull/1327) Fix errors generating coverage reports. (@nylen) +- [#1330](https://github.com/request/request/pull/1330) Return empty buffer upon empty response body and encoding is set to null (@seanstrom) +- [#1326](https://github.com/request/request/pull/1326) Use faster container-based infrastructure on Travis (@nylen) +- [#1315](https://github.com/request/request/pull/1315) Implement rfc3986 option (@simov, @nylen, @apoco, @DullReferenceException, @mmalecki, @oliamb, @cliffcrosland, @LewisJEllis, @eiriksm, @poislagarde) +- [#1314](https://github.com/request/request/pull/1314) Detect urlencoded form data header via regex (@simov) +- [#1317](https://github.com/request/request/pull/1317) Improve OAuth1.0 server side flow example (@simov) + +### v2.51.0 (2014/12/10) +- [#1310](https://github.com/request/request/pull/1310) Revert changes introduced in https://github.com/request/request/pull/1282 (@simov) + +### v2.50.0 (2014/12/09) +- [#1308](https://github.com/request/request/pull/1308) Add browser test to keep track of browserify compability. (@eiriksm) +- [#1299](https://github.com/request/request/pull/1299) Add optional support for jsonReviver (@poislagarde) +- [#1277](https://github.com/request/request/pull/1277) Add Coveralls configuration (@simov) +- [#1307](https://github.com/request/request/pull/1307) Upgrade form-data, add back browserify compability. Fixes #455. (@eiriksm) +- [#1305](https://github.com/request/request/pull/1305) Fix typo in README.md (@LewisJEllis) +- [#1288](https://github.com/request/request/pull/1288) Update README.md to explain custom file use case (@cliffcrosland) + +### v2.49.0 (2014/11/28) +- [#1295](https://github.com/request/request/pull/1295) fix(proxy): no-proxy false positive (@oliamb) +- [#1292](https://github.com/request/request/pull/1292) Upgrade `caseless` to 0.8.1 (@mmalecki) +- [#1276](https://github.com/request/request/pull/1276) Set transfer encoding for multipart/related to chunked by default (@simov) +- [#1275](https://github.com/request/request/pull/1275) Fix multipart content-type headers detection (@simov) +- [#1269](https://github.com/request/request/pull/1269) adds streams example for review (@tbuchok) +- [#1238](https://github.com/request/request/pull/1238) Add examples README.md (@simov) + +### v2.48.0 (2014/11/12) +- [#1263](https://github.com/request/request/pull/1263) Fixed a syntax error / typo in README.md (@xna2) +- [#1253](https://github.com/request/request/pull/1253) Add multipart chunked flag (@simov, @nylen) +- [#1251](https://github.com/request/request/pull/1251) Clarify that defaults() does not modify global defaults (@nylen) +- [#1250](https://github.com/request/request/pull/1250) Improve documentation for pool and maxSockets options (@nylen) +- [#1237](https://github.com/request/request/pull/1237) Documenting error handling when using streams (@vmattos) +- [#1244](https://github.com/request/request/pull/1244) Finalize changelog command (@nylen) +- [#1241](https://github.com/request/request/pull/1241) Fix typo (@alexanderGugel) +- [#1223](https://github.com/request/request/pull/1223) Show latest version number instead of "upcoming" in changelog (@nylen) +- [#1236](https://github.com/request/request/pull/1236) Document how to use custom CA in README (#1229) (@hypesystem) +- [#1228](https://github.com/request/request/pull/1228) Support for oauth with RSA-SHA1 signing (@nylen) +- [#1216](https://github.com/request/request/pull/1216) Made json and multipart options coexist (@nylen, @simov) +- [#1225](https://github.com/request/request/pull/1225) Allow header white/exclusive lists in any case. (@RReverser) + +### v2.47.0 (2014/10/26) +- [#1222](https://github.com/request/request/pull/1222) Move from mikeal/request to request/request (@nylen) +- [#1220](https://github.com/request/request/pull/1220) update qs dependency to 2.3.1 (@FredKSchott) +- [#1212](https://github.com/request/request/pull/1212) Improve tests/test-timeout.js (@nylen) +- [#1219](https://github.com/request/request/pull/1219) remove old globalAgent workaround for node 0.4 (@request) +- [#1214](https://github.com/request/request/pull/1214) Remove cruft left over from optional dependencies (@nylen) +- [#1215](https://github.com/request/request/pull/1215) Add proxyHeaderExclusiveList option for proxy-only headers. (@RReverser) +- [#1211](https://github.com/request/request/pull/1211) Allow 'Host' header instead of 'host' and remember case across redirects (@nylen) +- [#1208](https://github.com/request/request/pull/1208) Improve release script (@nylen) +- [#1213](https://github.com/request/request/pull/1213) Support for custom cookie store (@nylen, @mitsuru) +- [#1197](https://github.com/request/request/pull/1197) Clean up some code around setting the agent (@FredKSchott) +- [#1209](https://github.com/request/request/pull/1209) Improve multipart form append test (@simov) +- [#1207](https://github.com/request/request/pull/1207) Update changelog (@nylen) +- [#1185](https://github.com/request/request/pull/1185) Stream multipart/related bodies (@simov) + +### v2.46.0 (2014/10/23) +- [#1198](https://github.com/request/request/pull/1198) doc for TLS/SSL protocol options (@shawnzhu) +- [#1200](https://github.com/request/request/pull/1200) Add a Gitter chat badge to README.md (@gitter-badger) +- [#1196](https://github.com/request/request/pull/1196) Upgrade taper test reporter to v0.3.0 (@nylen) +- [#1199](https://github.com/request/request/pull/1199) Fix lint error: undeclared var i (@nylen) +- [#1191](https://github.com/request/request/pull/1191) Move self.proxy decision logic out of init and into a helper (@FredKSchott) +- [#1190](https://github.com/request/request/pull/1190) Move _buildRequest() logic back into init (@FredKSchott) +- [#1186](https://github.com/request/request/pull/1186) Support Smarter Unix URL Scheme (@FredKSchott) +- [#1178](https://github.com/request/request/pull/1178) update form documentation for new usage (@FredKSchott) +- [#1180](https://github.com/request/request/pull/1180) Enable no-mixed-requires linting rule (@nylen) +- [#1184](https://github.com/request/request/pull/1184) Don't forward authorization header across redirects to different hosts (@nylen) +- [#1183](https://github.com/request/request/pull/1183) Correct README about pre and postamble CRLF using multipart and not mult... (@netpoetica) +- [#1179](https://github.com/request/request/pull/1179) Lint tests directory (@nylen) +- [#1169](https://github.com/request/request/pull/1169) add metadata for form-data file field (@dotcypress) +- [#1173](https://github.com/request/request/pull/1173) remove optional dependencies (@seanstrom) +- [#1165](https://github.com/request/request/pull/1165) Cleanup event listeners and remove function creation from init (@FredKSchott) +- [#1174](https://github.com/request/request/pull/1174) update the request.cookie docs to have a valid cookie example (@seanstrom) +- [#1168](https://github.com/request/request/pull/1168) create a detach helper and use detach helper in replace of nextTick (@seanstrom) +- [#1171](https://github.com/request/request/pull/1171) in post can send form data and use callback (@MiroRadenovic) +- [#1159](https://github.com/request/request/pull/1159) accept charset for x-www-form-urlencoded content-type (@seanstrom) +- [#1157](https://github.com/request/request/pull/1157) Update README.md: body with json=true (@Rob--W) +- [#1164](https://github.com/request/request/pull/1164) Disable tests/test-timeout.js on Travis (@nylen) +- [#1153](https://github.com/request/request/pull/1153) Document how to run a single test (@nylen) +- [#1144](https://github.com/request/request/pull/1144) adds documentation for the "response" event within the streaming section (@tbuchok) +- [#1162](https://github.com/request/request/pull/1162) Update eslintrc file to no longer allow past errors (@FredKSchott) +- [#1155](https://github.com/request/request/pull/1155) Support/use self everywhere (@seanstrom) +- [#1161](https://github.com/request/request/pull/1161) fix no-use-before-define lint warnings (@emkay) +- [#1156](https://github.com/request/request/pull/1156) adding curly brackets to get rid of lint errors (@emkay) +- [#1151](https://github.com/request/request/pull/1151) Fix localAddress test on OS X (@nylen) +- [#1145](https://github.com/request/request/pull/1145) documentation: fix outdated reference to setCookieSync old name in README (@FredKSchott) +- [#1131](https://github.com/request/request/pull/1131) Update pool documentation (@FredKSchott) +- [#1143](https://github.com/request/request/pull/1143) Rewrite all tests to use tape (@nylen) +- [#1137](https://github.com/request/request/pull/1137) Add ability to specifiy querystring lib in options. (@jgrund) +- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@cappslock) +- [#1134](https://github.com/request/request/pull/1134) Fix multiple redirects and `self.followRedirect` (@blakeembrey) +- [#1130](https://github.com/request/request/pull/1130) documentation fix: add note about npm test for contributing (@FredKSchott) +- [#1120](https://github.com/request/request/pull/1120) Support/refactor request setup tunnel (@seanstrom) +- [#1129](https://github.com/request/request/pull/1129) linting fix: convert double quote strings to use single quotes (@FredKSchott) +- [#1124](https://github.com/request/request/pull/1124) linting fix: remove unneccesary semi-colons (@FredKSchott) + +### v2.45.0 (2014/10/06) +- [#1128](https://github.com/request/request/pull/1128) Add test for setCookie regression (@nylen) +- [#1127](https://github.com/request/request/pull/1127) added tests around using objects as values in a query string (@bcoe) +- [#1103](https://github.com/request/request/pull/1103) Support/refactor request constructor (@nylen, @seanstrom) +- [#1119](https://github.com/request/request/pull/1119) add basic linting to request library (@FredKSchott) +- [#1121](https://github.com/request/request/pull/1121) Revert "Explicitly use sync versions of cookie functions" (@nylen) +- [#1118](https://github.com/request/request/pull/1118) linting fix: Restructure bad empty if statement (@FredKSchott) +- [#1117](https://github.com/request/request/pull/1117) Fix a bad check for valid URIs (@FredKSchott) +- [#1113](https://github.com/request/request/pull/1113) linting fix: space out operators (@FredKSchott) +- [#1116](https://github.com/request/request/pull/1116) Fix typo in `noProxyHost` definition (@FredKSchott) +- [#1114](https://github.com/request/request/pull/1114) linting fix: Added a `new` operator that was missing when creating and throwing a new error (@FredKSchott) +- [#1096](https://github.com/request/request/pull/1096) No_proxy support (@samcday) +- [#1107](https://github.com/request/request/pull/1107) linting-fix: remove unused variables (@FredKSchott) +- [#1112](https://github.com/request/request/pull/1112) linting fix: Make return values consistent and more straitforward (@FredKSchott) +- [#1111](https://github.com/request/request/pull/1111) linting fix: authPieces was getting redeclared (@FredKSchott) +- [#1105](https://github.com/request/request/pull/1105) Use strict mode in request (@FredKSchott) +- [#1110](https://github.com/request/request/pull/1110) linting fix: replace lazy '==' with more strict '===' (@FredKSchott) +- [#1109](https://github.com/request/request/pull/1109) linting fix: remove function call from if-else conditional statement (@FredKSchott) +- [#1102](https://github.com/request/request/pull/1102) Fix to allow setting a `requester` on recursive calls to `request.defaults` (@tikotzky) +- [#1095](https://github.com/request/request/pull/1095) Tweaking engines in package.json (@pdehaan) +- [#1082](https://github.com/request/request/pull/1082) Forward the socket event from the httpModule request (@seanstrom) +- [#972](https://github.com/request/request/pull/972) Clarify gzip handling in the README (@kevinoid) +- [#1089](https://github.com/request/request/pull/1089) Mention that encoding defaults to utf8, not Buffer (@stuartpb) +- [#1088](https://github.com/request/request/pull/1088) Fix cookie example in README.md and make it more clear (@pipi32167) +- [#1027](https://github.com/request/request/pull/1027) Add support for multipart form data in request options. (@crocket) +- [#1076](https://github.com/request/request/pull/1076) use Request.abort() to abort the request when the request has timed-out (@seanstrom) +- [#1068](https://github.com/request/request/pull/1068) add optional postamble required by .NET multipart requests (@netpoetica) + +### v2.43.0 (2014/09/18) +- [#1057](https://github.com/request/request/pull/1057) Defaults should not overwrite defined options (@davidwood) +- [#1046](https://github.com/request/request/pull/1046) Propagate datastream errors, useful in case gzip fails. (@ZJONSSON, @Janpot) +- [#1063](https://github.com/request/request/pull/1063) copy the input headers object #1060 (@finnp) +- [#1031](https://github.com/request/request/pull/1031) Explicitly use sync versions of cookie functions (@ZJONSSON) +- [#1056](https://github.com/request/request/pull/1056) Fix redirects when passing url.parse(x) as URL to convenience method (@nylen) + +### v2.42.0 (2014/09/04) +- [#1053](https://github.com/request/request/pull/1053) Fix #1051 Parse auth properly when using non-tunneling proxy (@isaacs) + +### v2.41.0 (2014/09/04) +- [#1050](https://github.com/request/request/pull/1050) Pass whitelisted headers to tunneling proxy. Organize all tunneling logic. (@isaacs, @Feldhacker) +- [#1035](https://github.com/request/request/pull/1035) souped up nodei.co badge (@rvagg) +- [#1048](https://github.com/request/request/pull/1048) Aws is now possible over a proxy (@steven-aerts) +- [#1039](https://github.com/request/request/pull/1039) extract out helper functions to a helper file (@seanstrom) +- [#1021](https://github.com/request/request/pull/1021) Support/refactor indexjs (@seanstrom) +- [#1033](https://github.com/request/request/pull/1033) Improve and document debug options (@nylen) +- [#1034](https://github.com/request/request/pull/1034) Fix readme headings (@nylen) +- [#1030](https://github.com/request/request/pull/1030) Allow recursive request.defaults (@tikotzky) +- [#1029](https://github.com/request/request/pull/1029) Fix a couple of typos (@nylen) +- [#675](https://github.com/request/request/pull/675) Checking for SSL fault on connection before reading SSL properties (@VRMink) +- [#989](https://github.com/request/request/pull/989) Added allowRedirect function. Should return true if redirect is allowed or false otherwise (@doronin) +- [#1025](https://github.com/request/request/pull/1025) [fixes #1023] Set self._ended to true once response has ended (@mridgway) +- [#1020](https://github.com/request/request/pull/1020) Add back removed debug metadata (@FredKSchott) +- [#1008](https://github.com/request/request/pull/1008) Moving to module instead of cutomer buffer concatenation. (@mikeal) +- [#770](https://github.com/request/request/pull/770) Added dependency badge for README file; (@timgluz, @mafintosh, @lalitkapoor, @stash, @bobyrizov) +- [#1016](https://github.com/request/request/pull/1016) toJSON no longer results in an infinite loop, returns simple objects (@FredKSchott) +- [#1018](https://github.com/request/request/pull/1018) Remove pre-0.4.4 HTTPS fix (@mmalecki) +- [#1006](https://github.com/request/request/pull/1006) Migrate to caseless, fixes #1001 (@mikeal) +- [#995](https://github.com/request/request/pull/995) Fix parsing array of objects (@sjonnet19) +- [#999](https://github.com/request/request/pull/999) Fix fallback for browserify for optional modules. (@eiriksm) +- [#996](https://github.com/request/request/pull/996) Wrong oauth signature when multiple same param keys exist [updated] (@bengl, @hyjin) + +### v2.40.0 (2014/08/06) +- [#992](https://github.com/request/request/pull/992) Fix security vulnerability. Update qs (@poeticninja) +- [#988](https://github.com/request/request/pull/988) “--” -> “—” (@upisfree) +- [#987](https://github.com/request/request/pull/987) Show optional modules as being loaded by the module that reqeusted them (@iarna) + +### v2.39.0 (2014/07/24) +- [#976](https://github.com/request/request/pull/976) Update README.md (@pvoznenko) + +### v2.38.0 (2014/07/22) +- [#952](https://github.com/request/request/pull/952) Adding support to client certificate with proxy use case (@ofirshaked) +- [#884](https://github.com/request/request/pull/884) Documented tough-cookie installation. (@wbyoung) +- [#935](https://github.com/request/request/pull/935) Correct repository url (@fritx) +- [#963](https://github.com/request/request/pull/963) Update changelog (@nylen) +- [#960](https://github.com/request/request/pull/960) Support gzip with encoding on node pre-v0.9.4 (@kevinoid) +- [#953](https://github.com/request/request/pull/953) Add async Content-Length computation when using form-data (@LoicMahieu) +- [#844](https://github.com/request/request/pull/844) Add support for HTTP[S]_PROXY environment variables. Fixes #595. (@jvmccarthy) +- [#946](https://github.com/request/request/pull/946) defaults: merge headers (@aj0strow) + +### v2.37.0 (2014/07/07) +- [#957](https://github.com/request/request/pull/957) Silence EventEmitter memory leak warning #311 (@watson) +- [#955](https://github.com/request/request/pull/955) check for content-length header before setting it in nextTick (@camilleanne) +- [#951](https://github.com/request/request/pull/951) Add support for gzip content decoding (@kevinoid) +- [#949](https://github.com/request/request/pull/949) Manually enter querystring in form option (@charlespwd) +- [#944](https://github.com/request/request/pull/944) Make request work with browserify (@eiriksm) +- [#943](https://github.com/request/request/pull/943) New mime module (@eiriksm) +- [#927](https://github.com/request/request/pull/927) Bump version of hawk dep. (@samccone) +- [#907](https://github.com/request/request/pull/907) append secureOptions to poolKey (@medovob) + +### v2.35.0 (2014/05/17) +- [#901](https://github.com/request/request/pull/901) Fixes #555 (@pigulla) +- [#897](https://github.com/request/request/pull/897) merge with default options (@vohof) +- [#891](https://github.com/request/request/pull/891) fixes 857 - options object is mutated by calling request (@lalitkapoor) +- [#869](https://github.com/request/request/pull/869) Pipefilter test (@tgohn) +- [#866](https://github.com/request/request/pull/866) Fix typo (@dandv) +- [#861](https://github.com/request/request/pull/861) Add support for RFC 6750 Bearer Tokens (@phedny) +- [#809](https://github.com/request/request/pull/809) upgrade tunnel-proxy to 0.4.0 (@ksato9700) +- [#850](https://github.com/request/request/pull/850) Fix word consistency in readme (@0xNobody) +- [#810](https://github.com/request/request/pull/810) add some exposition to mpu example in README.md (@mikermcneil) +- [#840](https://github.com/request/request/pull/840) improve error reporting for invalid protocols (@FND) +- [#821](https://github.com/request/request/pull/821) added secureOptions back (@nw) +- [#815](https://github.com/request/request/pull/815) Create changelog based on pull requests (@lalitkapoor) + +### v2.34.0 (2014/02/18) +- [#516](https://github.com/request/request/pull/516) UNIX Socket URL Support (@lyuzashi) +- [#801](https://github.com/request/request/pull/801) 794 ignore cookie parsing and domain errors (@lalitkapoor) +- [#802](https://github.com/request/request/pull/802) Added the Apache license to the package.json. (@keskival) +- [#793](https://github.com/request/request/pull/793) Adds content-length calculation when submitting forms using form-data li... (@Juul) +- [#785](https://github.com/request/request/pull/785) Provide ability to override content-type when `json` option used (@vvo) +- [#781](https://github.com/request/request/pull/781) simpler isReadStream function (@joaojeronimo) + +### v2.32.0 (2014/01/16) +- [#767](https://github.com/request/request/pull/767) Use tough-cookie CookieJar sync API (@stash) +- [#764](https://github.com/request/request/pull/764) Case-insensitive authentication scheme (@bobyrizov) +- [#763](https://github.com/request/request/pull/763) Upgrade tough-cookie to 0.10.0 (@stash) +- [#744](https://github.com/request/request/pull/744) Use Cookie.parse (@lalitkapoor) +- [#757](https://github.com/request/request/pull/757) require aws-sign2 (@mafintosh) + +### v2.31.0 (2014/01/08) +- [#645](https://github.com/request/request/pull/645) update twitter api url to v1.1 (@mick) +- [#746](https://github.com/request/request/pull/746) README: Markdown code highlight (@weakish) +- [#745](https://github.com/request/request/pull/745) updating setCookie example to make it clear that the callback is required (@emkay) +- [#742](https://github.com/request/request/pull/742) Add note about JSON output body type (@iansltx) +- [#741](https://github.com/request/request/pull/741) README example is using old cookie jar api (@emkay) +- [#736](https://github.com/request/request/pull/736) Fix callback arguments documentation (@mmalecki) + +### v2.30.0 (2013/12/13) +- [#732](https://github.com/request/request/pull/732) JSHINT: Creating global 'for' variable. Should be 'for (var ...'. (@Fritz-Lium) +- [#730](https://github.com/request/request/pull/730) better HTTP DIGEST support (@dai-shi) +- [#728](https://github.com/request/request/pull/728) Fix TypeError when calling request.cookie (@scarletmeow) + +### v2.29.0 (2013/12/06) +- [#727](https://github.com/request/request/pull/727) fix requester bug (@jchris) + +### v2.28.0 (2013/12/04) +- [#724](https://github.com/request/request/pull/724) README.md: add custom HTTP Headers example. (@tcort) +- [#719](https://github.com/request/request/pull/719) Made a comment gender neutral. (@unsetbit) +- [#715](https://github.com/request/request/pull/715) Request.multipart no longer crashes when header 'Content-type' present (@pastaclub) +- [#710](https://github.com/request/request/pull/710) Fixing listing in callback part of docs. (@lukasz-zak) +- [#696](https://github.com/request/request/pull/696) Edited README.md for formatting and clarity of phrasing (@Zearin) +- [#694](https://github.com/request/request/pull/694) Typo in README (@VRMink) +- [#690](https://github.com/request/request/pull/690) Handle blank password in basic auth. (@diversario) +- [#682](https://github.com/request/request/pull/682) Optional dependencies (@Turbo87) +- [#683](https://github.com/request/request/pull/683) Travis CI support (@Turbo87) +- [#674](https://github.com/request/request/pull/674) change cookie module,to tough-cookie.please check it . (@sxyizhiren) +- [#666](https://github.com/request/request/pull/666) make `ciphers` and `secureProtocol` to work in https request (@richarddong) +- [#656](https://github.com/request/request/pull/656) Test case for #304. (@diversario) +- [#662](https://github.com/request/request/pull/662) option.tunnel to explicitly disable tunneling (@seanmonstar) +- [#659](https://github.com/request/request/pull/659) fix failure when running with NODE_DEBUG=request, and a test for that (@jrgm) +- [#630](https://github.com/request/request/pull/630) Send random cnonce for HTTP Digest requests (@wprl) + +### v2.27.0 (2013/08/15) +- [#619](https://github.com/request/request/pull/619) decouple things a bit (@joaojeronimo) + +### v2.26.0 (2013/08/07) +- [#613](https://github.com/request/request/pull/613) Fixes #583, moved initialization of self.uri.pathname (@lexander) +- [#605](https://github.com/request/request/pull/605) Only include ":" + pass in Basic Auth if it's defined (fixes #602) (@bendrucker) + +### v2.24.0 (2013/07/23) +- [#596](https://github.com/request/request/pull/596) Global agent is being used when pool is specified (@Cauldrath) +- [#594](https://github.com/request/request/pull/594) Emit complete event when there is no callback (@RomainLK) +- [#601](https://github.com/request/request/pull/601) Fixed a small typo (@michalstanko) + +### v2.23.0 (2013/07/23) +- [#589](https://github.com/request/request/pull/589) Prevent setting headers after they are sent (@geek) +- [#587](https://github.com/request/request/pull/587) Global cookie jar disabled by default (@threepointone) + +### v2.22.0 (2013/07/05) +- [#544](https://github.com/request/request/pull/544) Update http-signature version. (@davidlehn) +- [#581](https://github.com/request/request/pull/581) Fix spelling of "ignoring." (@bigeasy) +- [#568](https://github.com/request/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette) +- [#564](https://github.com/request/request/pull/564) Fix redirections (@criloz) +- [#541](https://github.com/request/request/pull/541) The exported request function doesn't have an auth method (@tschaub) +- [#542](https://github.com/request/request/pull/542) Expose Request class (@regality) + +### v2.21.0 (2013/04/30) +- [#536](https://github.com/request/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando) +- [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva) +- [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath) +- [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) +- [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421) +- [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka) + +### v2.17.0 (2013/04/22) +- [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421) +- [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421) +- [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun) +- [#510](https://github.com/request/request/pull/510) Add HTTP Signature support. (@davidlehn) +- [#502](https://github.com/request/request/pull/502) Fix POST (and probably other) requests that are retried after 401 Unauthorized (@nylen) +- [#508](https://github.com/request/request/pull/508) Honor the .strictSSL option when using proxies (tunnel-agent) (@jhs) +- [#512](https://github.com/request/request/pull/512) Make password optional to support the format: http://username@hostname/ (@pajato1) +- [#513](https://github.com/request/request/pull/513) add 'localAddress' support (@yyfrankyy) +- [#498](https://github.com/request/request/pull/498) Moving response emit above setHeaders on destination streams (@kenperkins) +- [#490](https://github.com/request/request/pull/490) Empty response body (3-rd argument) must be passed to callback as an empty string (@Olegas) +- [#479](https://github.com/request/request/pull/479) Changing so if Accept header is explicitly set, sending json does not ov... (@RoryH) +- [#475](https://github.com/request/request/pull/475) Use `unescape` from `querystring` (@shimaore) +- [#473](https://github.com/request/request/pull/473) V0.10 compat (@isaacs) +- [#471](https://github.com/request/request/pull/471) Using querystring library from visionmedia (@kbackowski) +- [#461](https://github.com/request/request/pull/461) Strip the UTF8 BOM from a UTF encoded response (@kppullin) +- [#460](https://github.com/request/request/pull/460) hawk 0.10.0 (@hueniverse) +- [#462](https://github.com/request/request/pull/462) if query params are empty, then request path shouldn't end with a '?' (merges cleanly now) (@jaipandya) +- [#456](https://github.com/request/request/pull/456) hawk 0.9.0 (@hueniverse) +- [#429](https://github.com/request/request/pull/429) Copy options before adding callback. (@nrn, @nfriedly, @youurayy, @jplock, @kapetan, @landeiro, @othiym23, @mmalecki) +- [#454](https://github.com/request/request/pull/454) Destroy the response if present when destroying the request (clean merge) (@mafintosh) +- [#310](https://github.com/request/request/pull/310) Twitter Oauth Stuff Out of Date; Now Updated (@joemccann, @isaacs, @mscdex) +- [#413](https://github.com/request/request/pull/413) rename googledoodle.png to .jpg (@nfriedly, @youurayy, @jplock, @kapetan, @landeiro, @othiym23, @mmalecki) +- [#448](https://github.com/request/request/pull/448) Convenience method for PATCH (@mloar) +- [#444](https://github.com/request/request/pull/444) protect against double callbacks on error path (@spollack) +- [#433](https://github.com/request/request/pull/433) Added support for HTTPS cert & key (@mmalecki) +- [#430](https://github.com/request/request/pull/430) Respect specified {Host,host} headers, not just {host} (@andrewschaaf) +- [#415](https://github.com/request/request/pull/415) Fixed a typo. (@jerem) +- [#338](https://github.com/request/request/pull/338) Add more auth options, including digest support (@nylen) +- [#403](https://github.com/request/request/pull/403) Optimize environment lookup to happen once only (@mmalecki) +- [#398](https://github.com/request/request/pull/398) Add more reporting to tests (@mmalecki) +- [#388](https://github.com/request/request/pull/388) Ensure "safe" toJSON doesn't break EventEmitters (@othiym23) +- [#381](https://github.com/request/request/pull/381) Resolving "Invalid signature. Expected signature base string: " (@landeiro) +- [#380](https://github.com/request/request/pull/380) Fixes missing host header on retried request when using forever agent (@mac-) +- [#376](https://github.com/request/request/pull/376) Headers lost on redirect (@kapetan) +- [#375](https://github.com/request/request/pull/375) Fix for missing oauth_timestamp parameter (@jplock) +- [#374](https://github.com/request/request/pull/374) Correct Host header for proxy tunnel CONNECT (@youurayy) +- [#370](https://github.com/request/request/pull/370) Twitter reverse auth uses x_auth_mode not x_auth_type (@drudge) +- [#369](https://github.com/request/request/pull/369) Don't remove x_auth_mode for Twitter reverse auth (@drudge) +- [#344](https://github.com/request/request/pull/344) Make AWS auth signing find headers correctly (@nlf) +- [#363](https://github.com/request/request/pull/363) rfc3986 on base_uri, now passes tests (@jeffmarshall) +- [#362](https://github.com/request/request/pull/362) Running `rfc3986` on `base_uri` in `oauth.hmacsign` instead of just `encodeURIComponent` (@jeffmarshall) +- [#361](https://github.com/request/request/pull/361) Don't create a Content-Length header if we already have it set (@danjenkins) +- [#360](https://github.com/request/request/pull/360) Delete self._form along with everything else on redirect (@jgautier) +- [#355](https://github.com/request/request/pull/355) stop sending erroneous headers on redirected requests (@azylman) +- [#332](https://github.com/request/request/pull/332) Fix #296 - Only set Content-Type if body exists (@Marsup) +- [#343](https://github.com/request/request/pull/343) Allow AWS to work in more situations, added a note in the README on its usage (@nlf) +- [#320](https://github.com/request/request/pull/320) request.defaults() doesn't need to wrap jar() (@StuartHarris) +- [#322](https://github.com/request/request/pull/322) Fix + test for piped into request bumped into redirect. #321 (@alexindigo) +- [#326](https://github.com/request/request/pull/326) Do not try to remove listener from an undefined connection (@strk) +- [#318](https://github.com/request/request/pull/318) Pass servername to tunneling secure socket creation (@isaacs) +- [#317](https://github.com/request/request/pull/317) Workaround for #313 (@isaacs) +- [#293](https://github.com/request/request/pull/293) Allow parser errors to bubble up to request (@mscdex) +- [#290](https://github.com/request/request/pull/290) A test for #289 (@isaacs) +- [#280](https://github.com/request/request/pull/280) Like in node.js print options if NODE_DEBUG contains the word request (@Filirom1) +- [#207](https://github.com/request/request/pull/207) Fix #206 Change HTTP/HTTPS agent when redirecting between protocols (@isaacs) +- [#214](https://github.com/request/request/pull/214) documenting additional behavior of json option (@jphaas) +- [#272](https://github.com/request/request/pull/272) Boundary begins with CRLF? (@elspoono, @timshadel, @naholyr, @nanodocumet, @TehShrike) +- [#284](https://github.com/request/request/pull/284) Remove stray `console.log()` call in multipart generator. (@bcherry) +- [#241](https://github.com/request/request/pull/241) Composability updates suggested by issue #239 (@polotek) +- [#282](https://github.com/request/request/pull/282) OAuth Authorization header contains non-"oauth_" parameters (@jplock) +- [#279](https://github.com/request/request/pull/279) fix tests with boundary by injecting boundry from header (@benatkin) +- [#273](https://github.com/request/request/pull/273) Pipe back pressure issue (@mafintosh) +- [#268](https://github.com/request/request/pull/268) I'm not OCD seriously (@TehShrike) +- [#263](https://github.com/request/request/pull/263) Bug in OAuth key generation for sha1 (@nanodocumet) +- [#265](https://github.com/request/request/pull/265) uncaughtException when redirected to invalid URI (@naholyr) +- [#262](https://github.com/request/request/pull/262) JSON test should check for equality (@timshadel) +- [#261](https://github.com/request/request/pull/261) Setting 'pool' to 'false' does NOT disable Agent pooling (@timshadel) +- [#249](https://github.com/request/request/pull/249) Fix for the fix of your (closed) issue #89 where self.headers[content-length] is set to 0 for all methods (@sethbridges, @polotek, @zephrax, @jeromegn) +- [#255](https://github.com/request/request/pull/255) multipart allow body === '' ( the empty string ) (@Filirom1) +- [#260](https://github.com/request/request/pull/260) fixed just another leak of 'i' (@sreuter) +- [#246](https://github.com/request/request/pull/246) Fixing the set-cookie header (@jeromegn) +- [#243](https://github.com/request/request/pull/243) Dynamic boundary (@zephrax) +- [#240](https://github.com/request/request/pull/240) don't error when null is passed for options (@polotek) +- [#211](https://github.com/request/request/pull/211) Replace all occurrences of special chars in RFC3986 (@chriso) +- [#224](https://github.com/request/request/pull/224) Multipart content-type change (@janjongboom) +- [#217](https://github.com/request/request/pull/217) need to use Authorization (titlecase) header with Tumblr OAuth (@visnup) +- [#203](https://github.com/request/request/pull/203) Fix cookie and redirect bugs and add auth support for HTTPS tunnel (@milewise) +- [#199](https://github.com/request/request/pull/199) Tunnel (@isaacs) +- [#198](https://github.com/request/request/pull/198) Bugfix on forever usage of util.inherits (@isaacs) +- [#197](https://github.com/request/request/pull/197) Make ForeverAgent work with HTTPS (@isaacs) +- [#193](https://github.com/request/request/pull/193) Fixes GH-119 (@goatslacker) +- [#188](https://github.com/request/request/pull/188) Add abort support to the returned request (@itay) +- [#176](https://github.com/request/request/pull/176) Querystring option (@csainty) +- [#182](https://github.com/request/request/pull/182) Fix request.defaults to support (uri, options, callback) api (@twilson63) +- [#180](https://github.com/request/request/pull/180) Modified the post, put, head and del shortcuts to support uri optional param (@twilson63) +- [#179](https://github.com/request/request/pull/179) fix to add opts in .pipe(stream, opts) (@substack) +- [#177](https://github.com/request/request/pull/177) Issue #173 Support uri as first and optional config as second argument (@twilson63) +- [#170](https://github.com/request/request/pull/170) can't create a cookie in a wrapped request (defaults) (@fabianonunes) +- [#168](https://github.com/request/request/pull/168) Picking off an EasyFix by adding some missing mimetypes. (@serby) +- [#161](https://github.com/request/request/pull/161) Fix cookie jar/headers.cookie collision (#125) (@papandreou) +- [#162](https://github.com/request/request/pull/162) Fix issue #159 (@dpetukhov) +- [#90](https://github.com/request/request/pull/90) add option followAllRedirects to follow post/put redirects (@jroes) +- [#148](https://github.com/request/request/pull/148) Retry Agent (@thejh) +- [#146](https://github.com/request/request/pull/146) Multipart should respect content-type if previously set (@apeace) +- [#144](https://github.com/request/request/pull/144) added "form" option to readme (@petejkim) +- [#133](https://github.com/request/request/pull/133) Fixed cookies parsing (@afanasy) +- [#135](https://github.com/request/request/pull/135) host vs hostname (@iangreenleaf) +- [#132](https://github.com/request/request/pull/132) return the body as a Buffer when encoding is set to null (@jahewson) +- [#112](https://github.com/request/request/pull/112) Support using a custom http-like module (@jhs) +- [#104](https://github.com/request/request/pull/104) Cookie handling contains bugs (@janjongboom) +- [#121](https://github.com/request/request/pull/121) Another patch for cookie handling regression (@jhurliman) +- [#117](https://github.com/request/request/pull/117) Remove the global `i` (@3rd-Eden) +- [#110](https://github.com/request/request/pull/110) Update to Iris Couch URL (@jhs) +- [#86](https://github.com/request/request/pull/86) Can't post binary to multipart requests (@kkaefer) +- [#105](https://github.com/request/request/pull/105) added test for proxy option. (@dominictarr) +- [#102](https://github.com/request/request/pull/102) Implemented cookies - closes issue 82: https://github.com/mikeal/request/issues/82 (@alessioalex) +- [#97](https://github.com/request/request/pull/97) Typo in previous pull causes TypeError in non-0.5.11 versions (@isaacs) +- [#96](https://github.com/request/request/pull/96) Authless parsed url host support (@isaacs) +- [#81](https://github.com/request/request/pull/81) Enhance redirect handling (@danmactough) +- [#78](https://github.com/request/request/pull/78) Don't try to do strictSSL for non-ssl connections (@isaacs) +- [#76](https://github.com/request/request/pull/76) Bug when a request fails and a timeout is set (@Marsup) +- [#70](https://github.com/request/request/pull/70) add test script to package.json (@isaacs, @aheckmann) +- [#73](https://github.com/request/request/pull/73) Fix #71 Respect the strictSSL flag (@isaacs) +- [#69](https://github.com/request/request/pull/69) Flatten chunked requests properly (@isaacs) +- [#67](https://github.com/request/request/pull/67) fixed global variable leaks (@aheckmann) +- [#66](https://github.com/request/request/pull/66) Do not overwrite established content-type headers for read stream deliver (@voodootikigod) +- [#53](https://github.com/request/request/pull/53) Parse json: Issue #51 (@benatkin) +- [#45](https://github.com/request/request/pull/45) Added timeout option (@mbrevoort) +- [#35](https://github.com/request/request/pull/35) The "end" event isn't emitted for some responses (@voxpelli) +- [#31](https://github.com/request/request/pull/31) Error on piping a request to a destination (@tobowers) \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/CONTRIBUTING.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/CONTRIBUTING.md new file mode 100644 index 00000000..06b1968d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/CONTRIBUTING.md @@ -0,0 +1,44 @@ +# This is an OPEN Open Source Project + +----------------------------------------- + +## What? + +Individuals making significant and valuable contributions are given +commit-access to the project to contribute as they see fit. This project is +more like an open wiki than a standard guarded open source project. + +## Rules + +There are a few basic ground-rules for contributors: + +1. **No `--force` pushes** or modifying the Git history in any way. +1. **Non-master branches** ought to be used for ongoing work. +1. **External API changes and significant modifications** ought to be subject + to an **internal pull-request** to solicit feedback from other contributors. +1. Internal pull-requests to solicit feedback are *encouraged* for any other + non-trivial contribution but left to the discretion of the contributor. +1. For significant changes wait a full 24 hours before merging so that active + contributors who are distributed throughout the world have a chance to weigh + in. +1. Contributors should attempt to adhere to the prevailing code-style. +1. Run `npm test` locally before submitting your PR, to catch any easy to miss + style & testing issues. To diagnose test failures, there are two ways to + run a single test file: + - `node_modules/.bin/taper tests/test-file.js` - run using the default + [`taper`](https://github.com/nylen/taper) test reporter. + - `node tests/test-file.js` - view the raw + [tap](https://testanything.org/) output. + + +## Releases + +Declaring formal releases remains the prerogative of the project maintainer. + +## Changes to this arrangement + +This is an experiment and feedback is welcome! This document may also be +subject to pull-requests or changes by contributors where you believe you have +something valuable to add or change. + +----------------------------------------- diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/README.md new file mode 100644 index 00000000..77e30df5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/README.md @@ -0,0 +1,1094 @@ + +# Request - Simplified HTTP client + +[![npm package](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/) + +[![Build status](https://img.shields.io/travis/request/request.svg?style=flat-square)](https://travis-ci.org/request/request) +[![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master) +[![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request) +[![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request) +[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge) + + +## Super simple to use + +Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default. + +```js +var request = require('request'); +request('http://www.google.com', function (error, response, body) { + if (!error && response.statusCode == 200) { + console.log(body) // Show the HTML for the Google homepage. + } +}) +``` + + +## Table of contents + +- [Streaming](#streaming) +- [Forms](#forms) +- [HTTP Authentication](#http-authentication) +- [Custom HTTP Headers](#custom-http-headers) +- [OAuth Signing](#oauth-signing) +- [Proxies](#proxies) +- [Unix Domain Sockets](#unix-domain-sockets) +- [TLS/SSL Protocol](#tlsssl-protocol) +- [Support for HAR 1.2](#support-for-har-12) +- [**All Available Options**](#requestoptions-callback) + +Request also offers [convenience methods](#convenience-methods) like +`request.defaults` and `request.post`, and there are +lots of [usage examples](#examples) and several +[debugging techniques](#debugging). + + +--- + + +## Streaming + +You can stream any response to a file stream. + +```js +request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png')) +``` + +You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one). + +```js +fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json')) +``` + +Request can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers. + +```js +request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) +``` + +Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage). + +```js +request + .get('http://google.com/img.png') + .on('response', function(response) { + console.log(response.statusCode) // 200 + console.log(response.headers['content-type']) // 'image/png' + }) + .pipe(request.put('http://mysite.com/img.png')) +``` + +To easily handle errors when streaming requests, listen to the `error` event before piping: + +```js +request + .get('http://mysite.com/doodle.png') + .on('error', function(err) { + console.log(err) + }) + .pipe(fs.createWriteStream('doodle.png')) +``` + +Now let’s get fancy. + +```js +http.createServer(function (req, resp) { + if (req.url === '/doodle.png') { + if (req.method === 'PUT') { + req.pipe(request.put('http://mysite.com/doodle.png')) + } else if (req.method === 'GET' || req.method === 'HEAD') { + request.get('http://mysite.com/doodle.png').pipe(resp) + } + } +}) +``` + +You can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do: + +```js +http.createServer(function (req, resp) { + if (req.url === '/doodle.png') { + var x = request('http://mysite.com/doodle.png') + req.pipe(x) + x.pipe(resp) + } +}) +``` + +And since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :) + +```js +req.pipe(request('http://mysite.com/doodle.png')).pipe(resp) +``` + +Also, none of this new functionality conflicts with requests previous features, it just expands them. + +```js +var r = request.defaults({'proxy':'http://localproxy.com'}) + +http.createServer(function (req, resp) { + if (req.url === '/doodle.png') { + r.get('http://google.com/doodle.png').pipe(resp) + } +}) +``` + +You can still use intermediate proxies, the requests will still follow HTTP forwards, etc. + +[back to top](#table-of-contents) + + +--- + + +## Forms + +`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API. + + +#### application/x-www-form-urlencoded (URL-Encoded Forms) + +URL-encoded forms are simple. + +```js +request.post('http://service.com/upload', {form:{key:'value'}}) +// or +request.post('http://service.com/upload').form({key:'value'}) +// or +request.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ }) +``` + + +#### multipart/form-data (Multipart Form Uploads) + +For `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option. + + +```js +var formData = { + // Pass a simple key-value pair + my_field: 'my_value', + // Pass data via Buffers + my_buffer: new Buffer([1, 2, 3]), + // Pass data via Streams + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), + // Pass multiple values /w an Array + attachments: [ + fs.createReadStream(__dirname + '/attachment1.jpg'), + fs.createReadStream(__dirname + '/attachment2.jpg') + ], + // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS} + // Use case: for some types of streams, you'll need to provide "file"-related information manually. + // See the `form-data` README for more information about options: https://github.com/form-data/form-data + custom_file: { + value: fs.createReadStream('/dev/urandom'), + options: { + filename: 'topsecret.jpg', + contentType: 'image/jpg' + } + } +}; +request.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.) + +```js +// NOTE: Advanced use-case, for normal use see 'formData' usage above +var r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...}) +var form = r.form(); +form.append('my_field', 'my_value'); +form.append('my_buffer', new Buffer([1, 2, 3])); +form.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'}); +``` +See the [form-data README](https://github.com/form-data/form-data) for more information & examples. + + +#### multipart/related + +Some variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options. + +```js + request({ + method: 'PUT', + preambleCRLF: true, + postambleCRLF: true, + uri: 'http://service.com/upload', + multipart: [ + { + 'content-type': 'application/json', + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' }, + { body: fs.createReadStream('image.png') } + ], + // alternatively pass an object containing additional options + multipart: { + chunked: false, + data: [ + { + 'content-type': 'application/json', + body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + }, + { body: 'I am an attachment' } + ] + } + }, + function (error, response, body) { + if (error) { + return console.error('upload failed:', error); + } + console.log('Upload successful! Server responded with:', body); + }) +``` + +[back to top](#table-of-contents) + + +--- + + +## HTTP Authentication + +```js +request.get('http://some.server.com/').auth('username', 'password', false); +// or +request.get('http://some.server.com/', { + 'auth': { + 'user': 'username', + 'pass': 'password', + 'sendImmediately': false + } +}); +// or +request.get('http://some.server.com/').auth(null, null, true, 'bearerToken'); +// or +request.get('http://some.server.com/', { + 'auth': { + 'bearer': 'bearerToken' + } +}); +``` + +If passed as an option, `auth` should be a hash containing values: + +- `user` || `username` +- `pass` || `password` +- `sendImmediately` (optional) +- `bearer` (optional) + +The method form takes parameters +`auth(username, password, sendImmediately, bearer)`. + +`sendImmediately` defaults to `true`, which causes a basic or bearer +authentication header to be sent. If `sendImmediately` is `false`, then +`request` will retry with a proper authentication header after receiving a +`401` response from the server (which must contain a `WWW-Authenticate` header +indicating the required authentication method). + +Note that you can also specify basic authentication using the URL itself, as +detailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt). Simply pass the +`user:password` before the host with an `@` sign: + +```js +var username = 'username', + password = 'password', + url = 'http://' + username + ':' + password + '@some.server.com'; + +request({url: url}, function (error, response, body) { + // Do more stuff with 'body' here +}); +``` + +Digest authentication is supported, but it only works with `sendImmediately` +set to `false`; otherwise `request` will send basic authentication on the +initial request, which will probably cause the request to fail. + +Bearer authentication is supported, and is activated when the `bearer` value is +available. The value may be either a `String` or a `Function` returning a +`String`. Using a function to supply the bearer token is particularly useful if +used in conjunction with `defaults` to allow a single function to supply the +last known token at the time of sending a request, or to compute one on the fly. + +[back to top](#table-of-contents) + + +--- + + +## Custom HTTP Headers + +HTTP Headers, such as `User-Agent`, can be set in the `options` object. +In the example below, we call the github API to find out the number +of stars and forks for the request repository. This requires a +custom `User-Agent` header as well as https. + +```js +var request = require('request'); + +var options = { + url: 'https://api.github.com/repos/request/request', + headers: { + 'User-Agent': 'request' + } +}; + +function callback(error, response, body) { + if (!error && response.statusCode == 200) { + var info = JSON.parse(body); + console.log(info.stargazers_count + " Stars"); + console.log(info.forks_count + " Forks"); + } +} + +request(options, callback); +``` + +[back to top](#table-of-contents) + + +--- + + +## OAuth Signing + +[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported. The +default signing algorithm is +[HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2): + +```js +// OAuth1.0 - 3-legged server side flow (Twitter example) +// step 1 +var qs = require('querystring') + , oauth = + { callback: 'http://mysite.com/callback/' + , consumer_key: CONSUMER_KEY + , consumer_secret: CONSUMER_SECRET + } + , url = 'https://api.twitter.com/oauth/request_token' + ; +request.post({url:url, oauth:oauth}, function (e, r, body) { + // Ideally, you would take the body in the response + // and construct a URL that a user clicks on (like a sign in button). + // The verifier is only available in the response after a user has + // verified with twitter that they are authorizing your app. + + // step 2 + var req_data = qs.parse(body) + var uri = 'https://api.twitter.com/oauth/authenticate' + + '?' + qs.stringify({oauth_token: req_data.oauth_token}) + // redirect the user to the authorize uri + + // step 3 + // after the user is redirected back to your server + var auth_data = qs.parse(body) + , oauth = + { consumer_key: CONSUMER_KEY + , consumer_secret: CONSUMER_SECRET + , token: auth_data.oauth_token + , token_secret: req_data.oauth_token_secret + , verifier: auth_data.oauth_verifier + } + , url = 'https://api.twitter.com/oauth/access_token' + ; + request.post({url:url, oauth:oauth}, function (e, r, body) { + // ready to make signed requests on behalf of the user + var perm_data = qs.parse(body) + , oauth = + { consumer_key: CONSUMER_KEY + , consumer_secret: CONSUMER_SECRET + , token: perm_data.oauth_token + , token_secret: perm_data.oauth_token_secret + } + , url = 'https://api.twitter.com/1.1/users/show.json' + , qs = + { screen_name: perm_data.screen_name + , user_id: perm_data.user_id + } + ; + request.get({url:url, oauth:oauth, qs:qs, json:true}, function (e, r, user) { + console.log(user) + }) + }) +}) +``` + +For [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make +the following changes to the OAuth options object: +* Pass `signature_method : 'RSA-SHA1'` +* Instead of `consumer_secret`, specify a `private_key` string in + [PEM format](http://how2ssl.com/articles/working_with_pem_files/) + +For [PLAINTEXT signing](http://oauth.net/core/1.0/#anchor22), make +the following changes to the OAuth options object: +* Pass `signature_method : 'PLAINTEXT'` + +To send OAuth parameters via query params or in a post body as described in The +[Consumer Request Parameters](http://oauth.net/core/1.0/#consumer_req_param) +section of the oauth1 spec: +* Pass `transport_method : 'query'` or `transport_method : 'body'` in the OAuth + options object. +* `transport_method` defaults to `'header'` + +To use [Request Body Hash](https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html) you can either +* Manually generate the body hash and pass it as a string `body_hash: '...'` +* Automatically generate the body hash by passing `body_hash: true` + +[back to top](#table-of-contents) + + +--- + + +## Proxies + +If you specify a `proxy` option, then the request (and any subsequent +redirects) will be sent via a connection to the proxy server. + +If your endpoint is an `https` url, and you are using a proxy, then +request will send a `CONNECT` request to the proxy server *first*, and +then use the supplied connection to connect to the endpoint. + +That is, first it will make a request like: + +``` +HTTP/1.1 CONNECT endpoint-server.com:80 +Host: proxy-server.com +User-Agent: whatever user agent you specify +``` + +and then the proxy server make a TCP connection to `endpoint-server` +on port `80`, and return a response that looks like: + +``` +HTTP/1.1 200 OK +``` + +At this point, the connection is left open, and the client is +communicating directly with the `endpoint-server.com` machine. + +See [the wikipedia page on HTTP Tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel) +for more information. + +By default, when proxying `http` traffic, request will simply make a +standard proxied `http` request. This is done by making the `url` +section of the initial line of the request a fully qualified url to +the endpoint. + +For example, it will make a single request that looks like: + +``` +HTTP/1.1 GET http://endpoint-server.com/some-url +Host: proxy-server.com +Other-Headers: all go here + +request body or whatever +``` + +Because a pure "http over http" tunnel offers no additional security +or other features, it is generally simpler to go with a +straightforward HTTP proxy in this case. However, if you would like +to force a tunneling proxy, you may set the `tunnel` option to `true`. + +You can also make a standard proxied `http` request by explicitly setting +`tunnel : false`, but **note that this will allow the proxy to see the traffic +to/from the destination server**. + +If you are using a tunneling proxy, you may set the +`proxyHeaderWhiteList` to share certain headers with the proxy. + +You can also set the `proxyHeaderExclusiveList` to share certain +headers only with the proxy and not with destination host. + +By default, this set is: + +``` +accept +accept-charset +accept-encoding +accept-language +accept-ranges +cache-control +content-encoding +content-language +content-length +content-location +content-md5 +content-range +content-type +connection +date +expect +max-forwards +pragma +proxy-authorization +referer +te +transfer-encoding +user-agent +via +``` + +Note that, when using a tunneling proxy, the `proxy-authorization` +header and any headers from custom `proxyHeaderExclusiveList` are +*never* sent to the endpoint server, but only to the proxy server. + + +### Controlling proxy behaviour using environment variables + +The following environment variables are respected by `request`: + + * `HTTP_PROXY` / `http_proxy` + * `HTTPS_PROXY` / `https_proxy` + * `NO_PROXY` / `no_proxy` + +When `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request. + +`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables. + +Here's some examples of valid `no_proxy` values: + + * `google.com` - don't proxy HTTP/HTTPS requests to Google. + * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google. + * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo! + * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether. + +[back to top](#table-of-contents) + + +--- + + +## UNIX Domain Sockets + +`request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme: + +```js +/* Pattern */ 'http://unix:SOCKET:PATH' +/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path') +``` + +Note: The `SOCKET` path is assumed to be absolute to the root of the host file system. + +[back to top](#table-of-contents) + + +--- + + +## TLS/SSL Protocol + +TLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be +set directly in `options` object, in the `agentOptions` property of the `options` object, or even in `https.globalAgent.options`. Keep in mind that, although `agentOptions` allows for a slightly wider range of configurations, the recommended way is via `options` object directly, as using `agentOptions` or `https.globalAgent.options` would not be applied in the same way in proxied environments (as data travels through a TLS connection instead of an http/https agent). + +```js +var fs = require('fs') + , path = require('path') + , certFile = path.resolve(__dirname, 'ssl/client.crt') + , keyFile = path.resolve(__dirname, 'ssl/client.key') + , caFile = path.resolve(__dirname, 'ssl/ca.cert.pem') + , request = require('request'); + +var options = { + url: 'https://api.some-server.com/', + cert: fs.readFileSync(certFile), + key: fs.readFileSync(keyFile), + passphrase: 'password', + ca: fs.readFileSync(caFile) + } +}; + +request.get(options); +``` + +### Using `options.agentOptions` + +In the example below, we call an API requires client side SSL certificate +(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol: + +```js +var fs = require('fs') + , path = require('path') + , certFile = path.resolve(__dirname, 'ssl/client.crt') + , keyFile = path.resolve(__dirname, 'ssl/client.key') + , request = require('request'); + +var options = { + url: 'https://api.some-server.com/', + agentOptions: { + cert: fs.readFileSync(certFile), + key: fs.readFileSync(keyFile), + // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format: + // pfx: fs.readFileSync(pfxFilePath), + passphrase: 'password', + securityOptions: 'SSL_OP_NO_SSLv3' + } +}; + +request.get(options); +``` + +It is able to force using SSLv3 only by specifying `secureProtocol`: + +```js +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + secureProtocol: 'SSLv3_method' + } +}); +``` + +It is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs). +This can be useful, for example, when using self-signed certificates. +To require a different root certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`. +The certificate the domain presents must be signed by the root certificate specified: + +```js +request.get({ + url: 'https://api.some-server.com/', + agentOptions: { + ca: fs.readFileSync('ca.cert.pem') + } +}); +``` + +[back to top](#table-of-contents) + + +--- + +## Support for HAR 1.2 + +The `options.har` property will override the values: `url`, `method`, `qs`, `headers`, `form`, `formData`, `body`, `json`, as well as construct multipart data and read files from disk when `request.postData.params[].fileName` is present without a matching `value`. + +a validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching. + +```js + var request = require('request') + request({ + // will be ignored + method: 'GET', + uri: 'http://www.google.com', + + // HTTP Archive Request Object + har: { + url: 'http://www.mockbin.com/har', + method: 'POST', + headers: [ + { + name: 'content-type', + value: 'application/x-www-form-urlencoded' + } + ], + postData: { + mimeType: 'application/x-www-form-urlencoded', + params: [ + { + name: 'foo', + value: 'bar' + }, + { + name: 'hello', + value: 'world' + } + ] + } + } + }) + + // a POST request will be sent to http://www.mockbin.com + // with body an application/x-www-form-urlencoded body: + // foo=bar&hello=world +``` + +[back to top](#table-of-contents) + + +--- + +## request(options, callback) + +The first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional. + +- `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()` +- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain. If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string. +- `method` - http method (default: `"GET"`) +- `headers` - http headers (default: `{}`) + +--- + +- `qs` - object containing querystring values to be appended to the `uri` +- `qsParseOptions` - object containing options to pass to the [qs.parse](https://github.com/hapijs/qs#parsing-objects) method. Alternatively pass options to the [querystring.parse](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}` +- `qsStringifyOptions` - object containing options to pass to the [qs.stringify](https://github.com/hapijs/qs#stringifying) method. Alternatively pass options to the [querystring.stringify](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}`. For example, to change the way arrays are converted to query strings using the `qs` module pass the `arrayFormat` option with one of `indices|brackets|repeat` +- `useQuerystring` - If true, use `querystring` to stringify and parse + querystrings, otherwise use `qs` (default: `false`). Set this option to + `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the + default `foo[0]=bar&foo[1]=baz`. + +--- + +- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object. +- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See "Forms" section above. +- `formData` - Data to pass for a `multipart/form-data` request. See + [Forms](#forms) section above. +- `multipart` - array of objects which contain their own headers and `body` + attributes. Sends a `multipart/related` request. See [Forms](#forms) section + above. + - Alternatively you can pass in an object `{chunked: false, data: []}` where + `chunked` is used to specify whether the request is sent in + [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) + In non-chunked requests, data items with body streams are not allowed. +- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request. +- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request. +- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header. Additionally, parses the response body as JSON. +- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body. + +--- + +- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional). See documentation above. +- `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above. +- `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example). +- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services) +- `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options. + +--- + +- `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise. +- `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`) +- `maxRedirects` - the maximum number of redirects to follow (default: `10`) +- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain. + +--- + +- `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.) +- `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response. **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below. +- `jar` - If `true`, remember cookies for future use (or define your custom cookie jar; see examples section) + +--- + +- `agent` - `http(s).Agent` instance to use +- `agentClass` - alternatively specify your agent's class name +- `agentOptions` - and pass its options. **Note:** for HTTPS see [tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback) and the [documentation above](#using-optionsagentoptions). +- `forever` - set to `true` to use the [forever-agent](https://github.com/request/forever-agent) **Note:** Defaults to `http(s).Agent({keepAlive:true})` in node 0.12+ +- `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as your options allow for it). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. **Note:** `pool` is used only when the `agent` option is not specified. + - A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`). + - Note that if you are sending multiple requests in a loop and creating + multiple new `pool` objects, `maxSockets` will not work as intended. To + work around this, either use [`request.defaults`](#requestdefaultsoptions) + with your pool options or create the pool object with the `maxSockets` + property outside of the loop. +- `timeout` - Integer containing the number of milliseconds to wait for a +server to send response headers (and start the response body) before aborting +the request. Note that if the underlying TCP connection cannot be established, +the OS-wide TCP connection timeout will overrule the `timeout` option ([the +default in Linux can be anywhere from 20-120 seconds][linux-timeout]). + +[linux-timeout]: http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout + +--- + +- `localAddress` - Local interface to bind for network connections. +- `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`) +- `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option. +- `tunnel` - controls the behavior of + [HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling) + as follows: + - `undefined` (default) - `true` if the destination is `https`, `false` otherwise + - `true` - always tunnel to the destination by making a `CONNECT` request to + the proxy + - `false` - request the destination as a `GET` request. +- `proxyHeaderWhiteList` - A whitelist of headers to send to a + tunneling proxy. +- `proxyHeaderExclusiveList` - A whitelist of headers to send + exclusively to a tunneling proxy and not to destination. + +--- + +- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's `elapsedTime` property. +- `har` - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)* + +The callback argument gets 3 arguments: + +1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object) +2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object +3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied) + +[back to top](#table-of-contents) + + +--- + +## Convenience methods + +There are also shorthand methods for different HTTP METHODs and some other conveniences. + + +### request.defaults(options) + +This method **returns a wrapper** around the normal request API that defaults +to whatever options you pass to it. + +**Note:** `request.defaults()` **does not** modify the global request API; +instead, it **returns a wrapper** that has your default settings applied to it. + +**Note:** You can call `.defaults()` on the wrapper that is returned from +`request.defaults` to add/override defaults that were previously defaulted. + +For example: +```js +//requests using baseRequest() will set the 'x-token' header +var baseRequest = request.defaults({ + headers: {'x-token': 'my-token'} +}) + +//requests using specialRequest() will include the 'x-token' header set in +//baseRequest and will also include the 'special' header +var specialRequest = baseRequest.defaults({ + headers: {special: 'special value'} +}) +``` + +### request.put + +Same as `request()`, but defaults to `method: "PUT"`. + +```js +request.put(url) +``` + +### request.patch + +Same as `request()`, but defaults to `method: "PATCH"`. + +```js +request.patch(url) +``` + +### request.post + +Same as `request()`, but defaults to `method: "POST"`. + +```js +request.post(url) +``` + +### request.head + +Same as `request()`, but defaults to `method: "HEAD"`. + +```js +request.head(url) +``` + +### request.del + +Same as `request()`, but defaults to `method: "DELETE"`. + +```js +request.del(url) +``` + +### request.get + +Same as `request()` (for uniformity). + +```js +request.get(url) +``` +### request.cookie + +Function that creates a new cookie. + +```js +request.cookie('key1=value1') +``` +### request.jar() + +Function that creates a new cookie jar. + +```js +request.jar() +``` + +[back to top](#table-of-contents) + + +--- + + +## Debugging + +There are at least three ways to debug the operation of `request`: + +1. Launch the node process like `NODE_DEBUG=request node script.js` + (`lib,request,otherlib` works too). + +2. Set `require('request').debug = true` at any time (this does the same thing + as #1). + +3. Use the [request-debug module](https://github.com/request/request-debug) to + view request and response headers and bodies. + +[back to top](#table-of-contents) + + +--- + +## Timeouts + +Most requests to external servers should have a timeout attached, in case the +server is not responding in a timely manner. Without a timeout, your code may +have a socket open/consume resources for minutes or more. + +There are two main types of timeouts: **connection timeouts** and **read +timeouts**. A connect timeout occurs if the timeout is hit while your client is +attempting to establish a connection to a remote machine (corresponding to the +[connect() call][connect] on the socket). A read timeout occurs any time the +server is too slow to send back a part of the response. + +These two situations have widely different implications for what went wrong +with the request, so it's useful to be able to distinguish them. You can detect +timeout errors by checking `err.code` for an 'ETIMEDOUT' value. Further, you +can detect whether the timeout was a connection timeout by checking if the +`err.connect` property is set to `true`. + +```js +request.get('http://10.255.255.1', {timeout: 1500}, function(err) { + console.log(err.code === 'ETIMEDOUT'); + // Set to `true` if the timeout was a connection timeout, `false` or + // `undefined` otherwise. + console.log(err.connect === true); + process.exit(0); +}); +``` + +[connect]: http://linux.die.net/man/2/connect + +## Examples: + +```js + var request = require('request') + , rand = Math.floor(Math.random()*100000000).toString() + ; + request( + { method: 'PUT' + , uri: 'http://mikeal.iriscouch.com/testjs/' + rand + , multipart: + [ { 'content-type': 'application/json' + , body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}}) + } + , { body: 'I am an attachment' } + ] + } + , function (error, response, body) { + if(response.statusCode == 201){ + console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand) + } else { + console.log('error: '+ response.statusCode) + console.log(body) + } + } + ) +``` + +For backwards-compatibility, response compression is not supported by default. +To accept gzip-compressed responses, set the `gzip` option to `true`. Note +that the body data passed through `request` is automatically decompressed +while the response object is unmodified and will contain compressed data if +the server sent a compressed response. + +```js + var request = require('request') + request( + { method: 'GET' + , uri: 'http://www.google.com' + , gzip: true + } + , function (error, response, body) { + // body is the decompressed response body + console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity')) + console.log('the decoded data is: ' + body) + } + ).on('data', function(data) { + // decompressed data as it is received + console.log('decoded chunk: ' + data) + }) + .on('response', function(response) { + // unmodified http.IncomingMessage object + response.on('data', function(data) { + // compressed data as it is received + console.log('received ' + data.length + ' bytes of compressed data') + }) + }) +``` + +Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`). + +```js +var request = request.defaults({jar: true}) +request('http://www.google.com', function () { + request('http://images.google.com') +}) +``` + +To use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`) + +```js +var j = request.jar() +var request = request.defaults({jar:j}) +request('http://www.google.com', function () { + request('http://images.google.com') +}) +``` + +OR + +```js +var j = request.jar(); +var cookie = request.cookie('key1=value1'); +var url = 'http://www.google.com'; +j.setCookie(cookie, url); +request({url: url, jar: j}, function () { + request('http://images.google.com') +}) +``` + +To use a custom cookie store (such as a +[`FileCookieStore`](https://github.com/mitsuru/tough-cookie-filestore) +which supports saving to and restoring from JSON files), pass it as a parameter +to `request.jar()`: + +```js +var FileCookieStore = require('tough-cookie-filestore'); +// NOTE - currently the 'cookies.json' file must already exist! +var j = request.jar(new FileCookieStore('cookies.json')); +request = request.defaults({ jar : j }) +request('http://www.google.com', function() { + request('http://images.google.com') +}) +``` + +The cookie store must be a +[`tough-cookie`](https://github.com/SalesforceEng/tough-cookie) +store and it must support synchronous operations; see the +[`CookieStore` API docs](https://github.com/SalesforceEng/tough-cookie#cookiestore-api) +for details. + +To inspect your cookie jar after a request: + +```js +var j = request.jar() +request({url: 'http://www.google.com', jar: j}, function () { + var cookie_string = j.getCookieString(url); // "key1=value1; key2=value2; ..." + var cookies = j.getCookies(url); + // [{key: 'key1', value: 'value1', domain: "www.google.com", ...}, ...] +}) +``` + +[back to top](#table-of-contents) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/index.js new file mode 100755 index 00000000..4d0c748d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/index.js @@ -0,0 +1,156 @@ +// Copyright 2010-2012 Mikeal Rogers +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict' + +var extend = require('extend') + , cookies = require('./lib/cookies') + , helpers = require('./lib/helpers') + +var isFunction = helpers.isFunction + , paramsHaveRequestBody = helpers.paramsHaveRequestBody + + +// organize params for patch, post, put, head, del +function initParams(uri, options, callback) { + if (typeof options === 'function') { + callback = options + } + + var params = {} + if (typeof options === 'object') { + extend(params, options, {uri: uri}) + } else if (typeof uri === 'string') { + extend(params, {uri: uri}) + } else { + extend(params, uri) + } + + params.callback = callback + return params +} + +function request (uri, options, callback) { + if (typeof uri === 'undefined') { + throw new Error('undefined is not a valid uri or options object.') + } + + var params = initParams(uri, options, callback) + + if (params.method === 'HEAD' && paramsHaveRequestBody(params)) { + throw new Error('HTTP HEAD requests MUST NOT include a request body.') + } + + return new request.Request(params) +} + +function verbFunc (verb) { + var method = verb === 'del' ? 'DELETE' : verb.toUpperCase() + return function (uri, options, callback) { + var params = initParams(uri, options, callback) + params.method = method + return request(params, params.callback) + } +} + +// define like this to please codeintel/intellisense IDEs +request.get = verbFunc('get') +request.head = verbFunc('head') +request.post = verbFunc('post') +request.put = verbFunc('put') +request.patch = verbFunc('patch') +request.del = verbFunc('del') + +request.jar = function (store) { + return cookies.jar(store) +} + +request.cookie = function (str) { + return cookies.parse(str) +} + +function wrapRequestMethod (method, options, requester, verb) { + + return function (uri, opts, callback) { + var params = initParams(uri, opts, callback) + + var target = {} + extend(true, target, options, params) + + target.pool = params.pool || options.pool + + if (verb) { + target.method = (verb === 'del' ? 'DELETE' : verb.toUpperCase()) + } + + if (isFunction(requester)) { + method = requester + } + + return method(target, target.callback) + } +} + +request.defaults = function (options, requester) { + var self = this + + options = options || {} + + if (typeof options === 'function') { + requester = options + options = {} + } + + var defaults = wrapRequestMethod(self, options, requester) + + var verbs = ['get', 'head', 'post', 'put', 'patch', 'del'] + verbs.forEach(function(verb) { + defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb) + }) + + defaults.cookie = wrapRequestMethod(self.cookie, options, requester) + defaults.jar = self.jar + defaults.defaults = self.defaults + return defaults +} + +request.forever = function (agentOptions, optionsArg) { + var options = {} + if (optionsArg) { + extend(options, optionsArg) + } + if (agentOptions) { + options.agentOptions = agentOptions + } + + options.forever = true + return request.defaults(options) +} + +// Exports + +module.exports = request +request.Request = require('./request') +request.initParams = initParams + +// Backwards compatibility for request.debug +Object.defineProperty(request, 'debug', { + enumerable : true, + get : function() { + return request.Request.debug + }, + set : function(debug) { + request.Request.debug = debug + } +}) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/auth.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/auth.js new file mode 100644 index 00000000..1cb69521 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/auth.js @@ -0,0 +1,168 @@ +'use strict' + +var caseless = require('caseless') + , uuid = require('node-uuid') + , helpers = require('./helpers') + +var md5 = helpers.md5 + , toBase64 = helpers.toBase64 + + +function Auth (request) { + // define all public properties here + this.request = request + this.hasAuth = false + this.sentAuth = false + this.bearerToken = null + this.user = null + this.pass = null +} + +Auth.prototype.basic = function (user, pass, sendImmediately) { + var self = this + if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) { + self.request.emit('error', new Error('auth() received invalid user or password')) + } + self.user = user + self.pass = pass + self.hasAuth = true + var header = user + ':' + (pass || '') + if (sendImmediately || typeof sendImmediately === 'undefined') { + var authHeader = 'Basic ' + toBase64(header) + self.sentAuth = true + return authHeader + } +} + +Auth.prototype.bearer = function (bearer, sendImmediately) { + var self = this + self.bearerToken = bearer + self.hasAuth = true + if (sendImmediately || typeof sendImmediately === 'undefined') { + if (typeof bearer === 'function') { + bearer = bearer() + } + var authHeader = 'Bearer ' + (bearer || '') + self.sentAuth = true + return authHeader + } +} + +Auth.prototype.digest = function (method, path, authHeader) { + // TODO: More complete implementation of RFC 2617. + // - handle challenge.domain + // - support qop="auth-int" only + // - handle Authentication-Info (not necessarily?) + // - check challenge.stale (not necessarily?) + // - increase nc (not necessarily?) + // For reference: + // http://tools.ietf.org/html/rfc2617#section-3 + // https://github.com/bagder/curl/blob/master/lib/http_digest.c + + var self = this + + var challenge = {} + var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi + for (;;) { + var match = re.exec(authHeader) + if (!match) { + break + } + challenge[match[1]] = match[2] || match[3] + } + + /** + * RFC 2617: handle both MD5 and MD5-sess algorithms. + * + * If the algorithm directive's value is "MD5" or unspecified, then HA1 is + * HA1=MD5(username:realm:password) + * If the algorithm directive's value is "MD5-sess", then HA1 is + * HA1=MD5(MD5(username:realm:password):nonce:cnonce) + */ + var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) { + var ha1 = md5(user + ':' + realm + ':' + pass) + if (algorithm && algorithm.toLowerCase() === 'md5-sess') { + return md5(ha1 + ':' + nonce + ':' + cnonce) + } else { + return ha1 + } + } + + var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' + var nc = qop && '00000001' + var cnonce = qop && uuid().replace(/-/g, '') + var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce) + var ha2 = md5(method + ':' + path) + var digestResponse = qop + ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) + : md5(ha1 + ':' + challenge.nonce + ':' + ha2) + var authValues = { + username: self.user, + realm: challenge.realm, + nonce: challenge.nonce, + uri: path, + qop: qop, + response: digestResponse, + nc: nc, + cnonce: cnonce, + algorithm: challenge.algorithm, + opaque: challenge.opaque + } + + authHeader = [] + for (var k in authValues) { + if (authValues[k]) { + if (k === 'qop' || k === 'nc' || k === 'algorithm') { + authHeader.push(k + '=' + authValues[k]) + } else { + authHeader.push(k + '="' + authValues[k] + '"') + } + } + } + authHeader = 'Digest ' + authHeader.join(', ') + self.sentAuth = true + return authHeader +} + +Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) { + var self = this + , request = self.request + + var authHeader + if (bearer === undefined && user === undefined) { + self.request.emit('error', new Error('no auth mechanism defined')) + } else if (bearer !== undefined) { + authHeader = self.bearer(bearer, sendImmediately) + } else { + authHeader = self.basic(user, pass, sendImmediately) + } + if (authHeader) { + request.setHeader('authorization', authHeader) + } +} + +Auth.prototype.onResponse = function (response) { + var self = this + , request = self.request + + if (!self.hasAuth || self.sentAuth) { return null } + + var c = caseless(response.headers) + + var authHeader = c.get('www-authenticate') + var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase() + request.debug('reauth', authVerb) + + switch (authVerb) { + case 'basic': + return self.basic(self.user, self.pass, true) + + case 'bearer': + return self.bearer(self.bearerToken, true) + + case 'digest': + return self.digest(request.method, request.path, authHeader) + } +} + +exports.Auth = Auth diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/cookies.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/cookies.js new file mode 100644 index 00000000..412c07d6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/cookies.js @@ -0,0 +1,39 @@ +'use strict' + +var tough = require('tough-cookie') + +var Cookie = tough.Cookie + , CookieJar = tough.CookieJar + + +exports.parse = function(str) { + if (str && str.uri) { + str = str.uri + } + if (typeof str !== 'string') { + throw new Error('The cookie function only accepts STRING as param') + } + return Cookie.parse(str, {loose: true}) +} + +// Adapt the sometimes-Async api of tough.CookieJar to our requirements +function RequestJar(store) { + var self = this + self._jar = new CookieJar(store, {looseMode: true}) +} +RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { + var self = this + return self._jar.setCookieSync(cookieOrStr, uri, options || {}) +} +RequestJar.prototype.getCookieString = function(uri) { + var self = this + return self._jar.getCookieStringSync(uri) +} +RequestJar.prototype.getCookies = function(uri) { + var self = this + return self._jar.getCookiesSync(uri) +} + +exports.jar = function(store) { + return new RequestJar(store) +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/getProxyFromURI.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/getProxyFromURI.js new file mode 100644 index 00000000..c2013a6e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/getProxyFromURI.js @@ -0,0 +1,79 @@ +'use strict' + +function formatHostname(hostname) { + // canonicalize the hostname, so that 'oogle.com' won't match 'google.com' + return hostname.replace(/^\.*/, '.').toLowerCase() +} + +function parseNoProxyZone(zone) { + zone = zone.trim().toLowerCase() + + var zoneParts = zone.split(':', 2) + , zoneHost = formatHostname(zoneParts[0]) + , zonePort = zoneParts[1] + , hasPort = zone.indexOf(':') > -1 + + return {hostname: zoneHost, port: zonePort, hasPort: hasPort} +} + +function uriInNoProxy(uri, noProxy) { + var port = uri.port || (uri.protocol === 'https:' ? '443' : '80') + , hostname = formatHostname(uri.hostname) + , noProxyList = noProxy.split(',') + + // iterate through the noProxyList until it finds a match. + return noProxyList.map(parseNoProxyZone).some(function(noProxyZone) { + var isMatchedAt = hostname.indexOf(noProxyZone.hostname) + , hostnameMatched = ( + isMatchedAt > -1 && + (isMatchedAt === hostname.length - noProxyZone.hostname.length) + ) + + if (noProxyZone.hasPort) { + return (port === noProxyZone.port) && hostnameMatched + } + + return hostnameMatched + }) +} + +function getProxyFromURI(uri) { + // Decide the proper request proxy to use based on the request URI object and the + // environmental variables (NO_PROXY, HTTP_PROXY, etc.) + // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html) + + var noProxy = process.env.NO_PROXY || process.env.no_proxy || '' + + // if the noProxy is a wildcard then return null + + if (noProxy === '*') { + return null + } + + // if the noProxy is not empty and the uri is found return null + + if (noProxy !== '' && uriInNoProxy(uri, noProxy)) { + return null + } + + // Check for HTTP or HTTPS Proxy in environment Else default to null + + if (uri.protocol === 'http:') { + return process.env.HTTP_PROXY || + process.env.http_proxy || null + } + + if (uri.protocol === 'https:') { + return process.env.HTTPS_PROXY || + process.env.https_proxy || + process.env.HTTP_PROXY || + process.env.http_proxy || null + } + + // if none of that works, return null + // (What uri protocol are you using then?) + + return null +} + +module.exports = getProxyFromURI diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/har.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/har.js new file mode 100644 index 00000000..ceb1cd10 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/har.js @@ -0,0 +1,214 @@ +'use strict' + +var fs = require('fs') +var qs = require('querystring') +var validate = require('har-validator') +var util = require('util') + +function Har (request) { + this.request = request +} + +Har.prototype.reducer = function (obj, pair) { + // new property ? + if (obj[pair.name] === undefined) { + obj[pair.name] = pair.value + return obj + } + + // existing? convert to array + var arr = [ + obj[pair.name], + pair.value + ] + + obj[pair.name] = arr + + return obj +} + +Har.prototype.prep = function (data) { + // construct utility properties + data.queryObj = {} + data.headersObj = {} + data.postData.jsonObj = false + data.postData.paramsObj = false + + // construct query objects + if (data.queryString && data.queryString.length) { + data.queryObj = data.queryString.reduce(this.reducer, {}) + } + + // construct headers objects + if (data.headers && data.headers.length) { + // loweCase header keys + data.headersObj = data.headers.reduceRight(function (headers, header) { + headers[header.name] = header.value + return headers + }, {}) + } + + // construct Cookie header + if (data.cookies && data.cookies.length) { + var cookies = data.cookies.map(function (cookie) { + return cookie.name + '=' + cookie.value + }) + + if (cookies.length) { + data.headersObj.cookie = cookies.join('; ') + } + } + + // prep body + function some (arr) { + return arr.some(function (type) { + return data.postData.mimeType.indexOf(type) === 0 + }) + } + + if (some([ + 'multipart/mixed', + 'multipart/related', + 'multipart/form-data', + 'multipart/alternative'])) { + + // reset values + data.postData.mimeType = 'multipart/form-data' + } + + else if (some([ + 'application/x-www-form-urlencoded'])) { + + if (!data.postData.params) { + data.postData.text = '' + } else { + data.postData.paramsObj = data.postData.params.reduce(this.reducer, {}) + + // always overwrite + data.postData.text = qs.stringify(data.postData.paramsObj) + } + } + + else if (some([ + 'text/json', + 'text/x-json', + 'application/json', + 'application/x-json'])) { + + data.postData.mimeType = 'application/json' + + if (data.postData.text) { + try { + data.postData.jsonObj = JSON.parse(data.postData.text) + } catch (e) { + this.request.debug(e) + + // force back to text/plain + data.postData.mimeType = 'text/plain' + } + } + } + + return data +} + +Har.prototype.options = function (options) { + // skip if no har property defined + if (!options.har) { + return options + } + + var har = util._extend({}, options.har) + + // only process the first entry + if (har.log && har.log.entries) { + har = har.log.entries[0] + } + + // add optional properties to make validation successful + har.url = har.url || options.url || options.uri || options.baseUrl || '/' + har.httpVersion = har.httpVersion || 'HTTP/1.1' + har.queryString = har.queryString || [] + har.headers = har.headers || [] + har.cookies = har.cookies || [] + har.postData = har.postData || {} + har.postData.mimeType = har.postData.mimeType || 'application/octet-stream' + + har.bodySize = 0 + har.headersSize = 0 + har.postData.size = 0 + + if (!validate.request(har)) { + return options + } + + // clean up and get some utility properties + var req = this.prep(har) + + // construct new options + if (req.url) { + options.url = req.url + } + + if (req.method) { + options.method = req.method + } + + if (Object.keys(req.queryObj).length) { + options.qs = req.queryObj + } + + if (Object.keys(req.headersObj).length) { + options.headers = req.headersObj + } + + function test (type) { + return req.postData.mimeType.indexOf(type) === 0 + } + if (test('application/x-www-form-urlencoded')) { + options.form = req.postData.paramsObj + } + else if (test('application/json')) { + if (req.postData.jsonObj) { + options.body = req.postData.jsonObj + options.json = true + } + } + else if (test('multipart/form-data')) { + options.formData = {} + + req.postData.params.forEach(function (param) { + var attachment = {} + + if (!param.fileName && !param.fileName && !param.contentType) { + options.formData[param.name] = param.value + return + } + + // attempt to read from disk! + if (param.fileName && !param.value) { + attachment.value = fs.createReadStream(param.fileName) + } else if (param.value) { + attachment.value = param.value + } + + if (param.fileName) { + attachment.options = { + filename: param.fileName, + contentType: param.contentType ? param.contentType : null + } + } + + options.formData[param.name] = attachment + }) + } + else { + if (req.postData.text) { + options.body = req.postData.text + } + } + + return options +} + +exports.Har = Har diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/helpers.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/helpers.js new file mode 100644 index 00000000..5e859460 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/helpers.js @@ -0,0 +1,74 @@ +'use strict' + +var jsonSafeStringify = require('json-stringify-safe') + , crypto = require('crypto') + +function deferMethod() { + if (typeof setImmediate === 'undefined') { + return process.nextTick + } + + return setImmediate +} + +function isFunction(value) { + return typeof value === 'function' +} + +function paramsHaveRequestBody(params) { + return ( + params.body || + params.requestBodyStream || + (params.json && typeof params.json !== 'boolean') || + params.multipart + ) +} + +function safeStringify (obj) { + var ret + try { + ret = JSON.stringify(obj) + } catch (e) { + ret = jsonSafeStringify(obj) + } + return ret +} + +function md5 (str) { + return crypto.createHash('md5').update(str).digest('hex') +} + +function isReadStream (rs) { + return rs.readable && rs.path && rs.mode +} + +function toBase64 (str) { + return (new Buffer(str || '', 'utf8')).toString('base64') +} + +function copy (obj) { + var o = {} + Object.keys(obj).forEach(function (i) { + o[i] = obj[i] + }) + return o +} + +function version () { + var numbers = process.version.replace('v', '').split('.') + return { + major: parseInt(numbers[0], 10), + minor: parseInt(numbers[1], 10), + patch: parseInt(numbers[2], 10) + } +} + +exports.isFunction = isFunction +exports.paramsHaveRequestBody = paramsHaveRequestBody +exports.safeStringify = safeStringify +exports.md5 = md5 +exports.isReadStream = isReadStream +exports.toBase64 = toBase64 +exports.copy = copy +exports.version = version +exports.defer = deferMethod() diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/multipart.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/multipart.js new file mode 100644 index 00000000..03618588 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/multipart.js @@ -0,0 +1,109 @@ +'use strict' + +var uuid = require('node-uuid') + , CombinedStream = require('combined-stream') + , isstream = require('isstream') + + +function Multipart (request) { + this.request = request + this.boundary = uuid() + this.chunked = false + this.body = null +} + +Multipart.prototype.isChunked = function (options) { + var self = this + , chunked = false + , parts = options.data || options + + if (!parts.forEach) { + self.request.emit('error', new Error('Argument error, options.multipart.')) + } + + if (options.chunked !== undefined) { + chunked = options.chunked + } + + if (self.request.getHeader('transfer-encoding') === 'chunked') { + chunked = true + } + + if (!chunked) { + parts.forEach(function (part) { + if (typeof part.body === 'undefined') { + self.request.emit('error', new Error('Body attribute missing in multipart.')) + } + if (isstream(part.body)) { + chunked = true + } + }) + } + + return chunked +} + +Multipart.prototype.setHeaders = function (chunked) { + var self = this + + if (chunked && !self.request.hasHeader('transfer-encoding')) { + self.request.setHeader('transfer-encoding', 'chunked') + } + + var header = self.request.getHeader('content-type') + + if (!header || header.indexOf('multipart') === -1) { + self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary) + } else { + if (header.indexOf('boundary') !== -1) { + self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1') + } else { + self.request.setHeader('content-type', header + '; boundary=' + self.boundary) + } + } +} + +Multipart.prototype.build = function (parts, chunked) { + var self = this + var body = chunked ? new CombinedStream() : [] + + function add (part) { + return chunked ? body.append(part) : body.push(new Buffer(part)) + } + + if (self.request.preambleCRLF) { + add('\r\n') + } + + parts.forEach(function (part) { + var preamble = '--' + self.boundary + '\r\n' + Object.keys(part).forEach(function (key) { + if (key === 'body') { return } + preamble += key + ': ' + part[key] + '\r\n' + }) + preamble += '\r\n' + add(preamble) + add(part.body) + add('\r\n') + }) + add('--' + self.boundary + '--') + + if (self.request.postambleCRLF) { + add('\r\n') + } + + return body +} + +Multipart.prototype.onRequest = function (options) { + var self = this + + var chunked = self.isChunked(options) + , parts = options.data || options + + self.setHeaders(chunked) + self.chunked = chunked + self.body = self.build(parts, chunked) +} + +exports.Multipart = Multipart diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/oauth.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/oauth.js new file mode 100644 index 00000000..c24209b8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/oauth.js @@ -0,0 +1,147 @@ +'use strict' + +var url = require('url') + , qs = require('qs') + , caseless = require('caseless') + , uuid = require('node-uuid') + , oauth = require('oauth-sign') + , crypto = require('crypto') + + +function OAuth (request) { + this.request = request + this.params = null +} + +OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) { + var oa = {} + for (var i in _oauth) { + oa['oauth_' + i] = _oauth[i] + } + if (!oa.oauth_version) { + oa.oauth_version = '1.0' + } + if (!oa.oauth_timestamp) { + oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString() + } + if (!oa.oauth_nonce) { + oa.oauth_nonce = uuid().replace(/-/g, '') + } + if (!oa.oauth_signature_method) { + oa.oauth_signature_method = 'HMAC-SHA1' + } + + var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key + delete oa.oauth_consumer_secret + delete oa.oauth_private_key + + var token_secret = oa.oauth_token_secret + delete oa.oauth_token_secret + + var realm = oa.oauth_realm + delete oa.oauth_realm + delete oa.oauth_transport_method + + var baseurl = uri.protocol + '//' + uri.host + uri.pathname + var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&')) + + oa.oauth_signature = oauth.sign( + oa.oauth_signature_method, + method, + baseurl, + params, + consumer_secret_or_private_key, + token_secret) + + if (realm) { + oa.realm = realm + } + + return oa +} + +OAuth.prototype.buildBodyHash = function(_oauth, body) { + if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) { + this.request.emit('error', new Error('oauth: ' + _oauth.signature_method + + ' signature_method not supported with body_hash signing.')) + } + + var shasum = crypto.createHash('sha1') + shasum.update(body || '') + var sha1 = shasum.digest('hex') + + return new Buffer(sha1).toString('base64') +} + +OAuth.prototype.concatParams = function (oa, sep, wrap) { + wrap = wrap || '' + + var params = Object.keys(oa).filter(function (i) { + return i !== 'realm' && i !== 'oauth_signature' + }).sort() + + if (oa.realm) { + params.splice(0, 0, 'realm') + } + params.push('oauth_signature') + + return params.map(function (i) { + return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap + }).join(sep) +} + +OAuth.prototype.onRequest = function (_oauth) { + var self = this + self.params = _oauth + + var uri = self.request.uri || {} + , method = self.request.method || '' + , headers = caseless(self.request.headers) + , body = self.request.body || '' + , qsLib = self.request.qsLib || qs + + var form + , query + , contentType = headers.get('content-type') || '' + , formContentType = 'application/x-www-form-urlencoded' + , transport = _oauth.transport_method || 'header' + + if (contentType.slice(0, formContentType.length) === formContentType) { + contentType = formContentType + form = body + } + if (uri.query) { + query = uri.query + } + if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) { + self.request.emit('error', new Error('oauth: transport_method of body requires POST ' + + 'and content-type ' + formContentType)) + } + + if (!form && typeof _oauth.body_hash === 'boolean') { + _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString()) + } + + var oa = self.buildParams(_oauth, uri, method, query, form, qsLib) + + switch (transport) { + case 'header': + self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"')) + break + + case 'query': + var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&') + self.request.uri = url.parse(href) + self.request.path = self.request.uri.path + break + + case 'body': + self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&') + break + + default: + self.request.emit('error', new Error('oauth: transport_method invalid')) + } +} + +exports.OAuth = OAuth diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/querystring.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/querystring.js new file mode 100644 index 00000000..baf5e802 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/querystring.js @@ -0,0 +1,51 @@ +'use strict' + +var qs = require('qs') + , querystring = require('querystring') + + +function Querystring (request) { + this.request = request + this.lib = null + this.useQuerystring = null + this.parseOptions = null + this.stringifyOptions = null +} + +Querystring.prototype.init = function (options) { + if (this.lib) {return} + + this.useQuerystring = options.useQuerystring + this.lib = (this.useQuerystring ? querystring : qs) + + this.parseOptions = options.qsParseOptions || {} + this.stringifyOptions = options.qsStringifyOptions || {} +} + +Querystring.prototype.stringify = function (obj) { + return (this.useQuerystring) + ? this.rfc3986(this.lib.stringify(obj, + this.stringifyOptions.sep || null, + this.stringifyOptions.eq || null, + this.stringifyOptions)) + : this.lib.stringify(obj, this.stringifyOptions) +} + +Querystring.prototype.parse = function (str) { + return (this.useQuerystring) + ? this.lib.parse(str, + this.parseOptions.sep || null, + this.parseOptions.eq || null, + this.parseOptions) + : this.lib.parse(str, this.parseOptions) +} + +Querystring.prototype.rfc3986 = function (str) { + return str.replace(/[!'()*]/g, function (c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +Querystring.prototype.unescape = querystring.unescape + +exports.Querystring = Querystring diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/redirect.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/redirect.js new file mode 100644 index 00000000..040dfe0e --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/redirect.js @@ -0,0 +1,153 @@ +'use strict' + +var url = require('url') +var isUrl = /^https?:/ + +function Redirect (request) { + this.request = request + this.followRedirect = true + this.followRedirects = true + this.followAllRedirects = false + this.allowRedirect = function () {return true} + this.maxRedirects = 10 + this.redirects = [] + this.redirectsFollowed = 0 + this.removeRefererHeader = false +} + +Redirect.prototype.onRequest = function (options) { + var self = this + + if (options.maxRedirects !== undefined) { + self.maxRedirects = options.maxRedirects + } + if (typeof options.followRedirect === 'function') { + self.allowRedirect = options.followRedirect + } + if (options.followRedirect !== undefined) { + self.followRedirects = !!options.followRedirect + } + if (options.followAllRedirects !== undefined) { + self.followAllRedirects = options.followAllRedirects + } + if (self.followRedirects || self.followAllRedirects) { + self.redirects = self.redirects || [] + } + if (options.removeRefererHeader !== undefined) { + self.removeRefererHeader = options.removeRefererHeader + } +} + +Redirect.prototype.redirectTo = function (response) { + var self = this + , request = self.request + + var redirectTo = null + if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) { + var location = response.caseless.get('location') + request.debug('redirect', location) + + if (self.followAllRedirects) { + redirectTo = location + } else if (self.followRedirects) { + switch (request.method) { + case 'PATCH': + case 'PUT': + case 'POST': + case 'DELETE': + // Do not follow redirects + break + default: + redirectTo = location + break + } + } + } else if (response.statusCode === 401) { + var authHeader = request._auth.onResponse(response) + if (authHeader) { + request.setHeader('authorization', authHeader) + redirectTo = request.uri + } + } + return redirectTo +} + +Redirect.prototype.onResponse = function (response) { + var self = this + , request = self.request + + var redirectTo = self.redirectTo(response) + if (!redirectTo || !self.allowRedirect.call(request, response)) { + return false + } + + request.debug('redirect to', redirectTo) + + // ignore any potential response body. it cannot possibly be useful + // to us at this point. + // response.resume should be defined, but check anyway before calling. Workaround for browserify. + if (response.resume) { + response.resume() + } + + if (self.redirectsFollowed >= self.maxRedirects) { + request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href)) + return false + } + self.redirectsFollowed += 1 + + if (!isUrl.test(redirectTo)) { + redirectTo = url.resolve(request.uri.href, redirectTo) + } + + var uriPrev = request.uri + request.uri = url.parse(redirectTo) + + // handle the case where we change protocol from https to http or vice versa + if (request.uri.protocol !== uriPrev.protocol) { + delete request.agent + } + + self.redirects.push( + { statusCode : response.statusCode + , redirectUri: redirectTo + } + ) + if (self.followAllRedirects && request.method !== 'HEAD' + && response.statusCode !== 401 && response.statusCode !== 307) { + request.method = 'GET' + } + // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215 + delete request.src + delete request.req + delete request._started + if (response.statusCode !== 401 && response.statusCode !== 307) { + // Remove parameters from the previous response, unless this is the second request + // for a server that requires digest authentication. + delete request.body + delete request._form + if (request.headers) { + request.removeHeader('host') + request.removeHeader('content-type') + request.removeHeader('content-length') + if (request.uri.hostname !== request.originalHost.split(':')[0]) { + // Remove authorization if changing hostnames (but not if just + // changing ports or protocols). This matches the behavior of curl: + // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710 + request.removeHeader('authorization') + } + } + } + + if (!self.removeRefererHeader) { + request.setHeader('referer', uriPrev.href) + } + + request.emit('redirect') + + request.init() + + return true +} + +exports.Redirect = Redirect diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/tunnel.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/tunnel.js new file mode 100644 index 00000000..918aec69 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/lib/tunnel.js @@ -0,0 +1,178 @@ +'use strict' + +var url = require('url') + , tunnel = require('tunnel-agent') + +var defaultProxyHeaderWhiteList = [ + 'accept', + 'accept-charset', + 'accept-encoding', + 'accept-language', + 'accept-ranges', + 'cache-control', + 'content-encoding', + 'content-language', + 'content-length', + 'content-location', + 'content-md5', + 'content-range', + 'content-type', + 'connection', + 'date', + 'expect', + 'max-forwards', + 'pragma', + 'referer', + 'te', + 'transfer-encoding', + 'user-agent', + 'via' +] + +var defaultProxyHeaderExclusiveList = [ + 'proxy-authorization' +] + +function constructProxyHost(uriObject) { + var port = uriObject.port + , protocol = uriObject.protocol + , proxyHost = uriObject.hostname + ':' + + if (port) { + proxyHost += port + } else if (protocol === 'https:') { + proxyHost += '443' + } else { + proxyHost += '80' + } + + return proxyHost +} + +function constructProxyHeaderWhiteList(headers, proxyHeaderWhiteList) { + var whiteList = proxyHeaderWhiteList + .reduce(function (set, header) { + set[header.toLowerCase()] = true + return set + }, {}) + + return Object.keys(headers) + .filter(function (header) { + return whiteList[header.toLowerCase()] + }) + .reduce(function (set, header) { + set[header] = headers[header] + return set + }, {}) +} + +function constructTunnelOptions (request, proxyHeaders) { + var proxy = request.proxy + + var tunnelOptions = { + proxy : { + host : proxy.hostname, + port : +proxy.port, + proxyAuth : proxy.auth, + headers : proxyHeaders + }, + headers : request.headers, + ca : request.ca, + cert : request.cert, + key : request.key, + passphrase : request.passphrase, + pfx : request.pfx, + ciphers : request.ciphers, + rejectUnauthorized : request.rejectUnauthorized, + secureOptions : request.secureOptions, + secureProtocol : request.secureProtocol + } + + return tunnelOptions +} + +function constructTunnelFnName(uri, proxy) { + var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http') + var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http') + return [uriProtocol, proxyProtocol].join('Over') +} + +function getTunnelFn(request) { + var uri = request.uri + var proxy = request.proxy + var tunnelFnName = constructTunnelFnName(uri, proxy) + return tunnel[tunnelFnName] +} + + +function Tunnel (request) { + this.request = request + this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList + this.proxyHeaderExclusiveList = [] + if (typeof request.tunnel !== 'undefined') { + this.tunnelOverride = request.tunnel + } +} + +Tunnel.prototype.isEnabled = function () { + var self = this + , request = self.request + // Tunnel HTTPS by default. Allow the user to override this setting. + + // If self.tunnelOverride is set (the user specified a value), use it. + if (typeof self.tunnelOverride !== 'undefined') { + return self.tunnelOverride + } + + // If the destination is HTTPS, tunnel. + if (request.uri.protocol === 'https:') { + return true + } + + // Otherwise, do not use tunnel. + return false +} + +Tunnel.prototype.setup = function (options) { + var self = this + , request = self.request + + options = options || {} + + if (typeof request.proxy === 'string') { + request.proxy = url.parse(request.proxy) + } + + if (!request.proxy || !request.tunnel) { + return false + } + + // Setup Proxy Header Exclusive List and White List + if (options.proxyHeaderWhiteList) { + self.proxyHeaderWhiteList = options.proxyHeaderWhiteList + } + if (options.proxyHeaderExclusiveList) { + self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList + } + + var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList) + var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList) + + // Setup Proxy Headers and Proxy Headers Host + // Only send the Proxy White Listed Header names + var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList) + proxyHeaders.host = constructProxyHost(request.uri) + + proxyHeaderExclusiveList.forEach(request.removeHeader, request) + + // Set Agent from Tunnel Data + var tunnelFn = getTunnelFn(request) + var tunnelOptions = constructTunnelOptions(request, proxyHeaders) + request.agent = tunnelFn(tunnelOptions) + + return true +} + +Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList +Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList +exports.Tunnel = Tunnel diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/.bin/har-validator b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/.bin/har-validator new file mode 100755 index 00000000..fd7cc0d3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/.bin/har-validator @@ -0,0 +1,56 @@ +#!/usr/bin/env node + +'use strict' + +var chalk = require('chalk') +var cmd = require('commander') +var fs = require('fs') +var path = require('path') +var pkg = require('../package.json') +var Promise = require('pinkie-promise') +var validate = require('..') +var ValidationError = require('../lib/error') + +cmd + .version(pkg.version) + .usage('[options] ') + .option('-s, --schema [name]', 'validate schema name (log, request, response, etc ...)') + .parse(process.argv) + +if (!cmd.args.length) { + cmd.help() +} + +cmd.args.map(function (fileName) { + var file = chalk.yellow.italic(path.basename(fileName)) + + new Promise(function (resolve, reject) { + fs.readFile(fileName, function (err, data) { + return err === null ? resolve(data) : reject(err) + }) + }) + + .then(JSON.parse) + + .then(cmd.schema ? validate[cmd.schema] : validate) + + .then(function (data) { + console.log('%s [%s] is valid', chalk.green('✓'), file) + }) + + .catch(function (err) { + if (err instanceof SyntaxError) { + return console.error('%s [%s] failed to read JSON: %s', chalk.red('✖'), file, chalk.red(err.message)) + } + + if (err instanceof ValidationError) { + err.errors.forEach(function (details) { + console.error('%s [%s] failed validation: (%s: %s) %s', chalk.red('✖'), file, chalk.cyan.italic(details.field), chalk.magenta.italic(details.value), chalk.red(details.message)) + }) + + return + } + + console.error('%s [%s] an unknown error has occured: %s', chalk.red('✖'), file, chalk.red(err.message)) + }) +}) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/.bin/uuid b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/.bin/uuid new file mode 100755 index 00000000..f732e991 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/.bin/uuid @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +var path = require('path'); +var uuid = require(path.join(__dirname, '..')); + +var arg = process.argv[2]; + +if ('--help' === arg) { + console.log('\n USAGE: uuid [version] [options]\n\n'); + console.log(' options:\n'); + console.log(' --help Display this message and exit\n'); + process.exit(0); +} + +if (null == arg) { + console.log(uuid()); + process.exit(0); +} + +if ('v1' !== arg && 'v4' !== arg) { + console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"'); + process.exit(1); +} + +console.log(uuid[arg]()); +process.exit(0); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/README.md new file mode 100644 index 00000000..763564e0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/README.md @@ -0,0 +1,4 @@ +aws-sign +======== + +AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/index.js new file mode 100644 index 00000000..ac720930 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/index.js @@ -0,0 +1,212 @@ + +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = require('crypto') + , parse = require('url').parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.queryStringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) + } + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') +} +module.exports.canonicalizeResource = canonicalizeResource diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/package.json new file mode 100644 index 00000000..0fe40d0b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/aws-sign2/package.json @@ -0,0 +1,49 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "aws-sign2", + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", + "version": "0.6.0", + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" + }, + "license": "Apache-2.0", + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" + }, + "homepage": "https://github.com/mikeal/aws-sign#readme", + "_id": "aws-sign2@0.6.0", + "scripts": {}, + "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "_from": "aws-sign2@>=0.6.0 <0.7.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + } + ], + "dist": { + "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.jshintrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.jshintrc new file mode 100644 index 00000000..c8ef3ca4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.jshintrc @@ -0,0 +1,59 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": false + , "passfail": false +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.npmignore new file mode 100644 index 00000000..40b878db --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.npmignore @@ -0,0 +1 @@ +node_modules/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.travis.yml new file mode 100644 index 00000000..81c08141 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +before_install: + - curl --location http://git.io/1OcIZA | bash -s +node_js: + - 0.8 + - 0.10 + - 0.11 +branches: + only: + - master +notifications: + email: + - rod@vagg.org +script: npm test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/LICENSE.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/LICENSE.md new file mode 100644 index 00000000..ccb24797 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/LICENSE.md @@ -0,0 +1,13 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2014 bl contributors +---------------------------------- + +*bl contributors listed at * + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/README.md new file mode 100644 index 00000000..4d87866a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/README.md @@ -0,0 +1,200 @@ +# bl *(BufferList)* + +[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl) + +**A Node.js Buffer list collector, reader and streamer thingy.** + +[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/) +[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/) + +**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them! + +The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently. + +```js +const BufferList = require('bl') + +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) +bl.append('hi') // bl will also accept & convert Strings +bl.append(new Buffer('j')) +bl.append(new Buffer([ 0x3, 0x4 ])) + +console.log(bl.length) // 12 + +console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij' +console.log(bl.slice(3, 10).toString('ascii')) // 'defghij' +console.log(bl.slice(3, 6).toString('ascii')) // 'def' +console.log(bl.slice(3, 8).toString('ascii')) // 'defgh' +console.log(bl.slice(5, 10).toString('ascii')) // 'fghij' + +// or just use toString! +console.log(bl.toString()) // 'abcdefghij\u0003\u0004' +console.log(bl.toString('ascii', 3, 8)) // 'defgh' +console.log(bl.toString('ascii', 5, 10)) // 'fghij' + +// other standard Buffer readables +console.log(bl.readUInt16BE(10)) // 0x0304 +console.log(bl.readUInt16LE(10)) // 0x0403 +``` + +Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**: + +```js +const bl = require('bl') + , fs = require('fs') + +fs.createReadStream('README.md') + .pipe(bl(function (err, data) { // note 'new' isn't strictly required + // `data` is a complete Buffer object containing the full data + console.log(data.toString()) + })) +``` + +Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream. + +Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!): +```js +const hyperquest = require('hyperquest') + , bl = require('bl') + , url = 'https://raw.github.com/rvagg/bl/master/README.md' + +hyperquest(url).pipe(bl(function (err, data) { + console.log(data.toString()) +})) +``` + +Or, use it as a readable stream to recompose a list of Buffers to an output source: + +```js +const BufferList = require('bl') + , fs = require('fs') + +var bl = new BufferList() +bl.append(new Buffer('abcd')) +bl.append(new Buffer('efg')) +bl.append(new Buffer('hi')) +bl.append(new Buffer('j')) + +bl.pipe(fs.createWriteStream('gibberish.txt')) +``` + +## API + + * new BufferList([ callback ]) + * bl.length + * bl.append(buffer) + * bl.get(index) + * bl.slice([ start[, end ] ]) + * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) + * bl.duplicate() + * bl.consume(bytes) + * bl.toString([encoding, [ start, [ end ]]]) + * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + * Streams + +-------------------------------------------------------- + +### new BufferList([ callback | buffer | buffer array ]) +The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. + +Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. + +`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: + +```js +var bl = require('bl') +var myinstance = bl() + +// equivilant to: + +var BufferList = require('bl') +var myinstance = new BufferList() +``` + +-------------------------------------------------------- + +### bl.length +Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list. + +-------------------------------------------------------- + +### bl.append(buffer) +`append(buffer)` adds an additional buffer or BufferList to the internal list. + +-------------------------------------------------------- + +### bl.get(index) +`get()` will return the byte at the specified index. + +-------------------------------------------------------- + +### bl.slice([ start, [ end ] ]) +`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. + +If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer. + +-------------------------------------------------------- + +### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) +`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively. + +-------------------------------------------------------- + +### bl.duplicate() +`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: + +```js +var bl = new BufferList() + +bl.append('hello') +bl.append(' world') +bl.append('\n') + +bl.duplicate().pipe(process.stdout, { end: false }) + +console.log(bl.toString()) +``` + +-------------------------------------------------------- + +### bl.consume(bytes) +`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data. + +-------------------------------------------------------- + +### bl.toString([encoding, [ start, [ end ]]]) +`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information. + +-------------------------------------------------------- + +### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() + +All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently. + +See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. + +-------------------------------------------------------- + +### Streams +**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance. + +-------------------------------------------------------- + +## Contributors + +**bl** is brought to you by the following hackers: + + * [Rod Vagg](https://github.com/rvagg) + * [Matteo Collina](https://github.com/mcollina) + * [Jarett Cruger](https://github.com/jcrugzz) + +======= + + +## License & copyright + +Copyright (c) 2013-2014 bl contributors (listed above). + +bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/bl.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/bl.js new file mode 100644 index 00000000..7a2f9978 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/bl.js @@ -0,0 +1,216 @@ +var DuplexStream = require('readable-stream/duplex') + , util = require('util') + +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) + + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { + this._callback = callback + + var piper = function (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function (src) { + src.on('error', piper) + }) + this.on('unpipe', function (src) { + src.removeListener('error', piper) + }) + } + else if (Buffer.isBuffer(callback)) + this.append(callback) + else if (Array.isArray(callback)) { + callback.forEach(function (b) { + Buffer.isBuffer(b) && this.append(b) + }.bind(this)) + } + + DuplexStream.call(this) +} + +util.inherits(BufferList, DuplexStream) + +BufferList.prototype._offset = function (offset) { + var tot = 0, i = 0, _t + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t) + return [ i, offset - tot ] + tot = _t + } +} + +BufferList.prototype.append = function (buf) { + var isBuffer = Buffer.isBuffer(buf) || + buf instanceof BufferList + + this._bufs.push(isBuffer ? buf : new Buffer(buf)) + this.length += buf.length + return this +} + +BufferList.prototype._write = function (buf, encoding, callback) { + this.append(buf) + if (callback) + callback() +} + +BufferList.prototype._read = function (size) { + if (!this.length) + return this.push(null) + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} + +BufferList.prototype.end = function (chunk) { + DuplexStream.prototype.end.call(this, chunk) + + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } +} + +BufferList.prototype.get = function (index) { + return this.slice(index, index + 1)[0] +} + +BufferList.prototype.slice = function (start, end) { + return this.copy(null, 0, start, end) +} + +BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || new Buffer(0) + if (srcEnd <= 0) + return dst || new Buffer(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) // slice, just return a full concat + return Buffer.concat(this._bufs) + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = new Buffer(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + break + } + + bufoff += l + bytes -= l + + if (start) + start = 0 + } + + return dst +} + +BufferList.prototype.toString = function (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function (bytes) { + while (this._bufs.length) { + if (bytes > this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + +BufferList.prototype.duplicate = function () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + +BufferList.prototype.destroy = function () { + this._bufs.length = 0; + this.length = 0; + this.push(null); +} + +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } + + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + +module.exports = BufferList diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore new file mode 100644 index 00000000..38344f87 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.npmignore @@ -0,0 +1,5 @@ +build/ +test/ +examples/ +fs.js +zlib.js \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml new file mode 100644 index 00000000..cfe1c943 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.travis.yml @@ -0,0 +1,50 @@ +sudo: false +language: node_js +before_install: + - npm install -g npm@2 + - npm install -g npm +notifications: + email: false +matrix: + include: + - node_js: '0.8' + env: TASK=test + - node_js: '0.10' + env: TASK=test + - node_js: '0.11' + env: TASK=test + - node_js: '0.12' + env: TASK=test + - node_js: 1 + env: TASK=test + - node_js: 2 + env: TASK=test + - node_js: 3 + env: TASK=test + - node_js: 4 + env: TASK=test + - node_js: 5 + env: TASK=test + - node_js: node + env: TASK=test + - node_js: node + env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="41..beta" + - node_js: node + env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="36..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="['6.1', '7.1', '8.2']" + - node_js: node + env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="['6.1', '7.1', '8.2']" + - node_js: node + env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" + - node_js: node + env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" +script: "npm run $TASK" +env: + global: + - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= + - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml new file mode 100644 index 00000000..96d9cfbd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/.zuul.yml @@ -0,0 +1 @@ +ui: tape diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE new file mode 100644 index 00000000..e3d4e695 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md new file mode 100644 index 00000000..f9fb5205 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md @@ -0,0 +1,36 @@ +# readable-stream + +***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) + + +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) + + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) + +```bash +npm install --save readable-stream +``` + +***Node-core streams for userland*** + +This package is a mirror of the Streams2 and Streams3 implementations in +Node-core, including [documentation](doc/stream.markdown). + +If you want to guarantee a stable streams base, regardless of what version of +Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). + +As of version 2.0.0 **readable-stream** uses semantic versioning. + +# Streams WG Team Members + +* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> + - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B +* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> + - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 +* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> + - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D +* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> +* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> +* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown new file mode 100644 index 00000000..f84543a2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown @@ -0,0 +1,1696 @@ +# Stream + + Stability: 2 - Stable + +A stream is an abstract interface implemented by various objects in +Node.js. For example a [request to an HTTP +server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is +[stdout][]. Streams are readable, writable, or both. All streams are +instances of [EventEmitter][] + +You can load the Stream base classes by doing `require('stream')`. +There are base classes provided for [Readable][] streams, [Writable][] +streams, [Duplex][] streams, and [Transform][] streams. + +This document is split up into 3 sections. The first explains the +parts of the API that you need to be aware of to use streams in your +programs. If you never implement a streaming API yourself, you can +stop there. + +The second section explains the parts of the API that you need to use +if you implement your own custom streams yourself. The API is +designed to make this easy for you to do. + +The third section goes into more depth about how streams work, +including some of the internal mechanisms and functions that you +should probably not modify unless you definitely know what you are +doing. + + +## API for Stream Consumers + + + +Streams can be either [Readable][], [Writable][], or both ([Duplex][]). + +All streams are EventEmitters, but they also have other custom methods +and properties depending on whether they are Readable, Writable, or +Duplex. + +If a stream is both Readable and Writable, then it implements all of +the methods and events below. So, a [Duplex][] or [Transform][] stream is +fully described by this API, though their implementation may be +somewhat different. + +It is not necessary to implement Stream interfaces in order to consume +streams in your programs. If you **are** implementing streaming +interfaces in your own program, please also refer to +[API for Stream Implementors][] below. + +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: + +```javascript +var http = require('http'); + +var server = http.createServer(function (req, res) { + // req is an http.IncomingMessage, which is a Readable Stream + // res is an http.ServerResponse, which is a Writable Stream + + var body = ''; + // we want to get the data as utf8 strings + // If you don't set an encoding, then you'll get Buffer objects + req.setEncoding('utf8'); + + // Readable streams emit 'data' events once a listener is added + req.on('data', function (chunk) { + body += chunk; + }); + + // the end event tells you that you have entire body + req.on('end', function () { + try { + var data = JSON.parse(body); + } catch (er) { + // uh oh! bad json! + res.statusCode = 400; + return res.end('error: ' + er.message); + } + + // write back something interesting to the user: + res.write(typeof data); + res.end(); + }); +}); + +server.listen(1337); + +// $ curl localhost:1337 -d '{}' +// object +// $ curl localhost:1337 -d '"foo"' +// string +// $ curl localhost:1337 -d 'not json' +// error: Unexpected token o +``` + +### Class: stream.Readable + + + +The Readable stream interface is the abstraction for a *source* of +data that you are reading from. In other words, data comes *out* of a +Readable stream. + +A Readable stream will not start emitting data until you indicate that +you are ready to receive it. + +Readable streams have two "modes": a **flowing mode** and a **paused +mode**. When in flowing mode, data is read from the underlying system +and provided to your program as fast as possible. In paused mode, you +must explicitly call `stream.read()` to get chunks of data out. +Streams start out in paused mode. + +**Note**: If no data event handlers are attached, and there are no +[`pipe()`][] destinations, and the stream is switched into flowing +mode, then data will be lost. + +You can switch to flowing mode by doing any of the following: + +* Adding a [`'data'` event][] handler to listen for data. +* Calling the [`resume()`][] method to explicitly open the flow. +* Calling the [`pipe()`][] method to send the data to a [Writable][]. + +You can switch back to paused mode by doing either of the following: + +* If there are no pipe destinations, by calling the [`pause()`][] + method. +* If there are pipe destinations, by removing any [`'data'` event][] + handlers, and removing all pipe destinations by calling the + [`unpipe()`][] method. + +Note that, for backwards compatibility reasons, removing `'data'` +event handlers will **not** automatically pause the stream. Also, if +there are piped destinations, then calling `pause()` will not +guarantee that the stream will *remain* paused once those +destinations drain and ask for more data. + +Examples of readable streams include: + +* [http responses, on the client](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage) +* [http requests, on the server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage) +* [fs read streams](https://iojs.org/dist/v5.0.0/doc/api/fs.html#fs_class_fs_readstream) +* [zlib streams][] +* [crypto streams][] +* [tcp sockets][] +* [child process stdout and stderr][] +* [process.stdin][] + +#### Event: 'readable' + +When a chunk of data can be read from the stream, it will emit a +`'readable'` event. + +In some cases, listening for a `'readable'` event will cause some data +to be read into the internal buffer from the underlying system, if it +hadn't already. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', function() { + // there is some data to read now +}); +``` + +Once the internal buffer is drained, a `readable` event will fire +again when more data is available. + +The `readable` event is not emitted in the "flowing" mode with the +sole exception of the last one, on end-of-stream. + +The 'readable' event indicates that the stream has new information: +either new data is available or the end of the stream has been reached. +In the former case, `.read()` will return that data. In the latter case, +`.read()` will return null. For instance, in the following example, `foo.txt` +is an empty file: + +```javascript +var fs = require('fs'); +var rr = fs.createReadStream('foo.txt'); +rr.on('readable', function() { + console.log('readable:', rr.read()); +}); +rr.on('end', function() { + console.log('end'); +}); +``` + +The output of running this script is: + +``` +bash-3.2$ node test.js +readable: null +end +``` + +#### Event: 'data' + +* `chunk` {Buffer | String} The chunk of data. + +Attaching a `data` event listener to a stream that has not been +explicitly paused will switch the stream into flowing mode. Data will +then be passed as soon as it is available. + +If you just want to get all the data out of the stream as fast as +possible, this is the best way to do so. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('data', function(chunk) { + console.log('got %d bytes of data', chunk.length); +}); +``` + +#### Event: 'end' + +This event fires when there will be no more data to read. + +Note that the `end` event **will not fire** unless the data is +completely consumed. This can be done by switching into flowing mode, +or by calling `read()` repeatedly until you get to the end. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('data', function(chunk) { + console.log('got %d bytes of data', chunk.length); +}); +readable.on('end', function() { + console.log('there will be no more data.'); +}); +``` + +#### Event: 'close' + +Emitted when the stream and any of its underlying resources (a file +descriptor, for example) have been closed. The event indicates that +no more events will be emitted, and no further computation will occur. + +Not all streams will emit the 'close' event. + +#### Event: 'error' + +* {Error Object} + +Emitted if there was an error receiving data. + +#### readable.read([size]) + +* `size` {Number} Optional argument to specify how much data to read. +* Return {String | Buffer | null} + +The `read()` method pulls some data out of the internal buffer and +returns it. If there is no data available, then it will return +`null`. + +If you pass in a `size` argument, then it will return that many +bytes. If `size` bytes are not available, then it will return `null`, +unless we've ended, in which case it will return the data remaining +in the buffer. + +If you do not specify a `size` argument, then it will return all the +data in the internal buffer. + +This method should only be called in paused mode. In flowing mode, +this method is called automatically until the internal buffer is +drained. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('readable', function() { + var chunk; + while (null !== (chunk = readable.read())) { + console.log('got %d bytes of data', chunk.length); + } +}); +``` + +If this method returns a data chunk, then it will also trigger the +emission of a [`'data'` event][]. + +Note that calling `readable.read([size])` after the `end` event has been +triggered will return `null`. No runtime error will be raised. + +#### readable.setEncoding(encoding) + +* `encoding` {String} The encoding to use. +* Return: `this` + +Call this function to cause the stream to return strings of the +specified encoding instead of Buffer objects. For example, if you do +`readable.setEncoding('utf8')`, then the output data will be +interpreted as UTF-8 data, and returned as strings. If you do +`readable.setEncoding('hex')`, then the data will be encoded in +hexadecimal string format. + +This properly handles multi-byte characters that would otherwise be +potentially mangled if you simply pulled the Buffers directly and +called `buf.toString(encoding)` on them. If you want to read the data +as strings, always use this method. + +```javascript +var readable = getReadableStreamSomehow(); +readable.setEncoding('utf8'); +readable.on('data', function(chunk) { + assert.equal(typeof chunk, 'string'); + console.log('got %d characters of string data', chunk.length); +}); +``` + +#### readable.resume() + +* Return: `this` + +This method will cause the readable stream to resume emitting `data` +events. + +This method will switch the stream into flowing mode. If you do *not* +want to consume the data from a stream, but you *do* want to get to +its `end` event, you can call [`readable.resume()`][] to open the flow of +data. + +```javascript +var readable = getReadableStreamSomehow(); +readable.resume(); +readable.on('end', function() { + console.log('got to the end, but did not read anything'); +}); +``` + +#### readable.pause() + +* Return: `this` + +This method will cause a stream in flowing mode to stop emitting +`data` events, switching out of flowing mode. Any data that becomes +available will remain in the internal buffer. + +```javascript +var readable = getReadableStreamSomehow(); +readable.on('data', function(chunk) { + console.log('got %d bytes of data', chunk.length); + readable.pause(); + console.log('there will be no more data for 1 second'); + setTimeout(function() { + console.log('now data will start flowing again'); + readable.resume(); + }, 1000); +}); +``` + +#### readable.isPaused() + +* Return: `Boolean` + +This method returns whether or not the `readable` has been **explicitly** +paused by client code (using `readable.pause()` without a corresponding +`readable.resume()`). + +```javascript +var readable = new stream.Readable + +readable.isPaused() // === false +readable.pause() +readable.isPaused() // === true +readable.resume() +readable.isPaused() // === false +``` + +#### readable.pipe(destination[, options]) + +* `destination` {[Writable][] Stream} The destination for writing data +* `options` {Object} Pipe options + * `end` {Boolean} End the writer when the reader ends. Default = `true` + +This method pulls all the data out of a readable stream, and writes it +to the supplied destination, automatically managing the flow so that +the destination is not overwhelmed by a fast readable stream. + +Multiple destinations can be piped to safely. + +```javascript +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt' +readable.pipe(writable); +``` + +This function returns the destination stream, so you can set up pipe +chains like so: + +```javascript +var r = fs.createReadStream('file.txt'); +var z = zlib.createGzip(); +var w = fs.createWriteStream('file.txt.gz'); +r.pipe(z).pipe(w); +``` + +For example, emulating the Unix `cat` command: + +```javascript +process.stdin.pipe(process.stdout); +``` + +By default [`end()`][] is called on the destination when the source stream +emits `end`, so that `destination` is no longer writable. Pass `{ end: +false }` as `options` to keep the destination stream open. + +This keeps `writer` open so that "Goodbye" can be written at the +end. + +```javascript +reader.pipe(writer, { end: false }); +reader.on('end', function() { + writer.end('Goodbye\n'); +}); +``` + +Note that `process.stderr` and `process.stdout` are never closed until +the process exits, regardless of the specified options. + +#### readable.unpipe([destination]) + +* `destination` {[Writable][] Stream} Optional specific stream to unpipe + +This method will remove the hooks set up for a previous `pipe()` call. + +If the destination is not specified, then all pipes are removed. + +If the destination is specified, but no pipe is set up for it, then +this is a no-op. + +```javascript +var readable = getReadableStreamSomehow(); +var writable = fs.createWriteStream('file.txt'); +// All the data from readable goes into 'file.txt', +// but only for the first second +readable.pipe(writable); +setTimeout(function() { + console.log('stop writing to file.txt'); + readable.unpipe(writable); + console.log('manually close the file stream'); + writable.end(); +}, 1000); +``` + +#### readable.unshift(chunk) + +* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue + +This is useful in certain cases where a stream is being consumed by a +parser, which needs to "un-consume" some data that it has +optimistically pulled out of the source, so that the stream can be +passed on to some other party. + +Note that `stream.unshift(chunk)` cannot be called after the `end` event +has been triggered; a runtime error will be raised. + +If you find that you must often call `stream.unshift(chunk)` in your +programs, consider implementing a [Transform][] stream instead. (See API +for Stream Implementors, below.) + +```javascript +// Pull off a header delimited by \n\n +// use unshift() if we get too much +// Call the callback with (error, header, stream) +var StringDecoder = require('string_decoder').StringDecoder; +function parseHeader(stream, callback) { + stream.on('error', callback); + stream.on('readable', onReadable); + var decoder = new StringDecoder('utf8'); + var header = ''; + function onReadable() { + var chunk; + while (null !== (chunk = stream.read())) { + var str = decoder.write(chunk); + if (str.match(/\n\n/)) { + // found the header boundary + var split = str.split(/\n\n/); + header += split.shift(); + var remaining = split.join('\n\n'); + var buf = new Buffer(remaining, 'utf8'); + if (buf.length) + stream.unshift(buf); + stream.removeListener('error', callback); + stream.removeListener('readable', onReadable); + // now the body of the message can be read from the stream. + callback(null, header, stream); + } else { + // still reading the header. + header += str; + } + } + } +} +``` +Note that, unlike `stream.push(chunk)`, `stream.unshift(chunk)` will not +end the reading process by resetting the internal reading state of the +stream. This can cause unexpected results if `unshift` is called during a +read (i.e. from within a `_read` implementation on a custom stream). Following +the call to `unshift` with an immediate `stream.push('')` will reset the +reading state appropriately, however it is best to simply avoid calling +`unshift` while in the process of performing a read. + +#### readable.wrap(stream) + +* `stream` {Stream} An "old style" readable stream + +Versions of Node.js prior to v0.10 had streams that did not implement the +entire Streams API as it is today. (See "Compatibility" below for +more information.) + +If you are using an older Node.js library that emits `'data'` events and +has a [`pause()`][] method that is advisory only, then you can use the +`wrap()` method to create a [Readable][] stream that uses the old stream +as its data source. + +You will very rarely ever need to call this function, but it exists +as a convenience for interacting with old Node.js programs and libraries. + +For example: + +```javascript +var OldReader = require('./old-api-module.js').OldReader; +var oreader = new OldReader; +var Readable = require('stream').Readable; +var myReader = new Readable().wrap(oreader); + +myReader.on('readable', function() { + myReader.read(); // etc. +}); +``` + + +### Class: stream.Writable + + + +The Writable stream interface is an abstraction for a *destination* +that you are writing data *to*. + +Examples of writable streams include: + +* [http requests, on the client](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_class_http_clientrequest) +* [http responses, on the server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_class_http_serverresponse) +* [fs write streams](https://iojs.org/dist/v5.0.0/doc/api/fs.html#fs_class_fs_writestream) +* [zlib streams][] +* [crypto streams][] +* [tcp sockets][] +* [child process stdin](https://iojs.org/dist/v5.0.0/doc/api/child_process.html#child_process_child_stdin) +* [process.stdout][], [process.stderr][] + +#### writable.write(chunk[, encoding][, callback]) + +* `chunk` {String | Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} True if the data was handled completely. + +This method writes some data to the underlying system, and calls the +supplied callback once the data has been fully handled. + +The return value indicates if you should continue writing right now. +If the data had to be buffered internally, then it will return +`false`. Otherwise, it will return `true`. + +This return value is strictly advisory. You MAY continue to write, +even if it returns `false`. However, writes will be buffered in +memory, so it is best not to do this excessively. Instead, wait for +the `drain` event before writing more data. + +#### Event: 'drain' + +If a [`writable.write(chunk)`][] call returns false, then the `drain` +event will indicate when it is appropriate to begin writing more data +to the stream. + +```javascript +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + var i = 1000000; + write(); + function write() { + var ok = true; + do { + i -= 1; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` + +#### writable.cork() + +Forces buffering of all writes. + +Buffered data will be flushed either at `.uncork()` or at `.end()` call. + +#### writable.uncork() + +Flush all data, buffered since `.cork()` call. + +#### writable.setDefaultEncoding(encoding) + +* `encoding` {String} The new default encoding + +Sets the default encoding for a writable stream. + +#### writable.end([chunk][, encoding][, callback]) + +* `chunk` {String | Buffer} Optional data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Call this method when no more data will be written to the stream. If +supplied, the callback is attached as a listener on the `finish` event. + +Calling [`write()`][] after calling [`end()`][] will raise an error. + +```javascript +// write 'hello, ' and then end with 'world!' +var file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +#### Event: 'finish' + +When the [`end()`][] method has been called, and all data has been flushed +to the underlying system, this event is emitted. + +```javascript +var writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #' + i + '!\n'); +} +writer.end('this is the end\n'); +writer.on('finish', function() { + console.error('all writes are now complete.'); +}); +``` + +#### Event: 'pipe' + +* `src` {[Readable][] Stream} source stream that is piping to this writable + +This is emitted whenever the `pipe()` method is called on a readable +stream, adding this writable to its set of destinations. + +```javascript +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('pipe', function(src) { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +#### Event: 'unpipe' + +* `src` {[Readable][] Stream} The source stream that [unpiped][] this writable + +This is emitted whenever the [`unpipe()`][] method is called on a +readable stream, removing this writable from its set of destinations. + +```javascript +var writer = getWritableStreamSomehow(); +var reader = getReadableStreamSomehow(); +writer.on('unpipe', function(src) { + console.error('something has stopped piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +#### Event: 'error' + +* {Error object} + +Emitted if there was an error when writing or piping data. + +### Class: stream.Duplex + +Duplex streams are streams that implement both the [Readable][] and +[Writable][] interfaces. See above for usage. + +Examples of Duplex streams include: + +* [tcp sockets][] +* [zlib streams][] +* [crypto streams][] + + +### Class: stream.Transform + +Transform streams are [Duplex][] streams where the output is in some way +computed from the input. They implement both the [Readable][] and +[Writable][] interfaces. See above for usage. + +Examples of Transform streams include: + +* [zlib streams][] +* [crypto streams][] + + +## API for Stream Implementors + + + +To implement any sort of stream, the pattern is the same: + +1. Extend the appropriate parent class in your own subclass. (The + [`util.inherits`][] method is particularly helpful for this.) +2. Call the appropriate parent class constructor in your constructor, + to be sure that the internal mechanisms are set up properly. +2. Implement one or more specific methods, as detailed below. + +The class to extend and the method(s) to implement depend on the sort +of stream class you are writing: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Use-case

+
+

Class

+
+

Method(s) to implement

+
+

Reading only

+
+

[Readable](#stream_class_stream_readable_1)

+
+

[_read][]

+
+

Writing only

+
+

[Writable](#stream_class_stream_writable_1)

+
+

[_write][], _writev

+
+

Reading and writing

+
+

[Duplex](#stream_class_stream_duplex_1)

+
+

[_read][], [_write][], _writev

+
+

Operate on written data, then read the result

+
+

[Transform](#stream_class_stream_transform_1)

+
+

_transform, _flush

+
+ +In your implementation code, it is very important to never call the +methods described in [API for Stream Consumers][] above. Otherwise, you +can potentially cause adverse side effects in programs that consume +your streaming interfaces. + +### Class: stream.Readable + + + +`stream.Readable` is an abstract class designed to be extended with an +underlying implementation of the [`_read(size)`][] method. + +Please see above under [API for Stream Consumers][] for how to consume +streams in your programs. What follows is an explanation of how to +implement Readable streams in your programs. + +#### Example: A Counting Stream + + + +This is a basic example of a Readable stream. It emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. + +```javascript +var Readable = require('stream').Readable; +var util = require('util'); +util.inherits(Counter, Readable); + +function Counter(opt) { + Readable.call(this, opt); + this._max = 1000000; + this._index = 1; +} + +Counter.prototype._read = function() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = new Buffer(str, 'ascii'); + this.push(buf); + } +}; +``` + +#### Example: SimpleProtocol v1 (Sub-optimal) + +This is similar to the `parseHeader` function described above, but +implemented as a custom stream. Also, note that this implementation +does not convert the incoming data to a string. + +However, this would be better implemented as a [Transform][] stream. See +below for a better implementation. + +```javascript +// A parser for a simple data protocol. +// The "header" is a JSON object, followed by 2 \n characters, and +// then a message body. +// +// NOTE: This can be done more simply as a Transform stream! +// Using Readable directly for this is sub-optimal. See the +// alternative example below under the Transform section. + +var Readable = require('stream').Readable; +var util = require('util'); + +util.inherits(SimpleProtocol, Readable); + +function SimpleProtocol(source, options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(source, options); + + Readable.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + + // source is a readable stream, such as a socket or file + this._source = source; + + var self = this; + source.on('end', function() { + self.push(null); + }); + + // give it a kick whenever the source is readable + // read(0) will not consume any bytes + source.on('readable', function() { + self.read(0); + }); + + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._read = function(n) { + if (!this._inBody) { + var chunk = this._source.read(); + + // if the source doesn't have data, we don't have data yet. + if (chunk === null) + return this.push(''); + + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + this.push(''); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // now, because we got some extra data, unshift the rest + // back into the read queue so that our consumer will see it. + var b = chunk.slice(split); + this.unshift(b); + // calling unshift by itself does not reset the reading state + // of the stream; since we're inside _read, doing an additional + // push('') will reset the state appropriately. + this.push(''); + + // and let them know that we are done parsing the header. + this.emit('header', this.header); + } + } else { + // from there on, just provide the data to our consumer. + // careful not to push(null), since that would indicate EOF. + var chunk = this._source.read(); + if (chunk) this.push(chunk); + } +}; + +// Usage: +// var parser = new SimpleProtocol(source); +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + + +#### new stream.Readable([options]) + +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Default=16kb, or 16 for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Default=null + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that stream.read(n) returns + a single value instead of a Buffer of size n. Default=false + +In classes that extend the Readable class, make sure to call the +Readable constructor so that the buffering settings can be properly +initialized. + +#### readable.\_read(size) + +* `size` {Number} Number of bytes to read asynchronously + +Note: **Implement this method, but do NOT call it directly.** + +This method is prefixed with an underscore because it is internal to the +class that defines it and should only be called by the internal Readable +class methods. All Readable stream implementations must provide a _read +method to fetch data from the underlying resource. + +When _read is called, if data is available from the resource, `_read` should +start pushing that data into the read queue by calling `this.push(dataChunk)`. +`_read` should continue reading from the resource and pushing data until push +returns false, at which point it should stop reading from the resource. Only +when _read is called again after it has stopped should it start reading +more data from the resource and pushing that data onto the queue. + +Note: once the `_read()` method is called, it will not be called again until +the `push` method is called. + +The `size` argument is advisory. Implementations where a "read" is a +single call that returns data can use this to know how much data to +fetch. Implementations where that is not relevant, such as TCP or +TLS, may ignore this argument, and simply provide data whenever it +becomes available. There is no need, for example to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][]. + +#### readable.push(chunk[, encoding]) + +* `chunk` {Buffer | null | String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* return {Boolean} Whether or not more pushes should be performed + +Note: **This method should be called by Readable implementors, NOT +by consumers of Readable streams.** + +If a value other than null is passed, The `push()` method adds a chunk of data +into the queue for subsequent stream processors to consume. If `null` is +passed, it signals the end of the stream (EOF), after which no more data +can be written. + +The data added with `push` can be pulled out by calling the `read()` method +when the `'readable'`event fires. + +This API is designed to be as flexible as possible. For example, +you may be wrapping a lower-level source which has some sort of +pause/resume mechanism, and a data callback. In those cases, you +could wrap the low-level source object by doing something like this: + +```javascript +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. + +util.inherits(SourceWrapper, Readable); + +function SourceWrapper(options) { + Readable.call(this, options); + + this._source = getLowlevelSourceObject(); + var self = this; + + // Every time there's data, we push it into the internal buffer. + this._source.ondata = function(chunk) { + // if push() returns false, then we need to stop reading from source + if (!self.push(chunk)) + self._source.readStop(); + }; + + // When the source ends, we push the EOF-signaling `null` chunk + this._source.onend = function() { + self.push(null); + }; +} + +// _read will be called when the stream wants to pull more data in +// the advisory size argument is ignored in this case. +SourceWrapper.prototype._read = function(size) { + this._source.readStart(); +}; +``` + + +### Class: stream.Writable + + + +`stream.Writable` is an abstract class designed to be extended with an +underlying implementation of the [`_write(chunk, encoding, callback)`][] method. + +Please see above under [API for Stream Consumers][] for how to consume +writable streams in your programs. What follows is an explanation of +how to implement Writable streams in your programs. + +#### new stream.Writable([options]) + +* `options` {Object} + * `highWaterMark` {Number} Buffer level when [`write()`][] starts + returning false. Default=16kb, or 16 for `objectMode` streams + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`_write()`][]. Default=true + * `objectMode` {Boolean} Whether or not the `write(anyObj)` is + a valid operation. If set you can write arbitrary data instead + of only `Buffer` / `String` data. Default=false + +In classes that extend the Writable class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### writable.\_write(chunk, encoding, callback) + +* `chunk` {Buffer | String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunk. + +All Writable stream implementations must provide a [`_write()`][] +method to send data to the underlying resource. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Writable +class methods only. + +Call the callback using the standard `callback(error)` pattern to +signal that the write completed successfully or with an error. + +If the `decodeStrings` flag is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the sort of string that it is. This is to support +implementations that have an optimized handling for certain string +data encodings. If you do not explicitly set the `decodeStrings` +option to `false`, then you can safely ignore the `encoding` argument, +and assume that `chunk` will always be a Buffer. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### writable.\_writev(chunks, callback) + +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} Call this function (optionally with an error + argument) when you are done processing the supplied chunks. + +Note: **This function MUST NOT be called directly.** It may be +implemented by child classes, and called by the internal Writable +class methods only. + +This function is completely optional to implement. In most cases it is +unnecessary. If implemented, it will be called with all the chunks +that are buffered in the write queue. + + +### Class: stream.Duplex + + + +A "duplex" stream is one that is both Readable and Writable, such as a +TCP socket connection. + +Note that `stream.Duplex` is an abstract class designed to be extended +with an underlying implementation of the `_read(size)` and +[`_write(chunk, encoding, callback)`][] methods as you would with a +Readable or Writable stream class. + +Since JavaScript doesn't have multiple prototypal inheritance, this +class prototypally inherits from Readable, and then parasitically from +Writable. It is thus up to the user to implement both the lowlevel +`_read(n)` method as well as the lowlevel +[`_write(chunk, encoding, callback)`][] method on extension duplex classes. + +#### new stream.Duplex(options) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Default=false. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Default=false. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. + +In classes that extend the Duplex class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + + +### Class: stream.Transform + +A "transform" stream is a duplex stream where the output is causally +connected in some way to the input, such as a [zlib][] stream or a +[crypto][] stream. + +There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A zlib stream will produce output +that is either much smaller or much larger than its input. + +Rather than implement the [`_read()`][] and [`_write()`][] methods, Transform +classes must implement the `_transform()` method, and may optionally +also implement the `_flush()` method. (See below.) + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. + +In classes that extend the Transform class, make sure to call the +constructor so that the buffering settings can be properly +initialized. + +#### transform.\_transform(chunk, encoding, callback) + +* `chunk` {Buffer | String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} Call this function (optionally with an error + argument and data) when you are done processing the supplied chunk. + +Note: **This function MUST NOT be called directly.** It should be +implemented by child classes, and called by the internal Transform +class methods only. + +All Transform stream implementations must provide a `_transform` +method to accept input and produce output. + +`_transform` should do whatever has to be done in this specific +Transform class, to handle the bytes being written, and pass them off +to the readable portion of the interface. Do asynchronous I/O, +process things, and so on. + +Call `transform.push(outputChunk)` 0 or more times to generate output +from this input chunk, depending on how much data you want to output +as a result of this chunk. + +Call the callback function only when the current chunk is completely +consumed. Note that there may or may not be output as a result of any +particular input chunk. If you supply a second argument to the callback +it will be passed to the push method. In other words the following are +equivalent: + +```javascript +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### transform.\_flush(callback) + +* `callback` {Function} Call this function (optionally with an error + argument) when you are done flushing any remaining data. + +Note: **This function MUST NOT be called directly.** It MAY be implemented +by child classes, and if so, will be called by the internal Transform +class methods only. + +In some cases, your transform operation may need to emit a bit more +data at the end of the stream. For example, a `Zlib` compression +stream will store up some internal state so that it can optimally +compress the output. At the end, however, it needs to do the best it +can with what is left, so that the data will be complete. + +In those cases, you can implement a `_flush` method, which will be +called at the very end, after all the written data is consumed, but +before emitting `end` to signal the end of the readable side. Just +like with `_transform`, call `transform.push(chunk)` zero or more +times, as appropriate, and call `callback` when the flush operation is +complete. + +This method is prefixed with an underscore because it is internal to +the class that defines it, and should not be called directly by user +programs. However, you **are** expected to override this method in +your own extension classes. + +#### Events: 'finish' and 'end' + +The [`finish`][] and [`end`][] events are from the parent Writable +and Readable classes respectively. The `finish` event is fired after +`.end()` is called and all chunks have been processed by `_transform`, +`end` is fired after all data has been output which is after the callback +in `_flush` has been called. + +#### Example: `SimpleProtocol` parser v2 + +The example above of a simple protocol parser can be implemented +simply by using the higher level [Transform][] stream class, similar to +the `parseHeader` and `SimpleProtocol v1` examples above. + +In this example, rather than providing the input as an argument, it +would be piped into the parser, which is a more idiomatic Node.js stream +approach. + +```javascript +var util = require('util'); +var Transform = require('stream').Transform; +util.inherits(SimpleProtocol, Transform); + +function SimpleProtocol(options) { + if (!(this instanceof SimpleProtocol)) + return new SimpleProtocol(options); + + Transform.call(this, options); + this._inBody = false; + this._sawFirstCr = false; + this._rawHeader = []; + this.header = null; +} + +SimpleProtocol.prototype._transform = function(chunk, encoding, done) { + if (!this._inBody) { + // check if the chunk has a \n\n + var split = -1; + for (var i = 0; i < chunk.length; i++) { + if (chunk[i] === 10) { // '\n' + if (this._sawFirstCr) { + split = i; + break; + } else { + this._sawFirstCr = true; + } + } else { + this._sawFirstCr = false; + } + } + + if (split === -1) { + // still waiting for the \n\n + // stash the chunk, and try again. + this._rawHeader.push(chunk); + } else { + this._inBody = true; + var h = chunk.slice(0, split); + this._rawHeader.push(h); + var header = Buffer.concat(this._rawHeader).toString(); + try { + this.header = JSON.parse(header); + } catch (er) { + this.emit('error', new Error('invalid simple protocol data')); + return; + } + // and let them know that we are done parsing the header. + this.emit('header', this.header); + + // now, because we got some extra data, emit this first. + this.push(chunk.slice(split)); + } + } else { + // from there on, just provide the data to our consumer as-is. + this.push(chunk); + } + done(); +}; + +// Usage: +// var parser = new SimpleProtocol(); +// source.pipe(parser) +// Now parser is a readable stream that will emit 'header' +// with the parsed header data. +``` + + +### Class: stream.PassThrough + +This is a trivial implementation of a [Transform][] stream that simply +passes the input bytes across to the output. Its purpose is mainly +for examples and testing, but there are occasionally use cases where +it can come in handy as a building block for novel sorts of streams. + + +## Simplified Constructor API + + + +In simple cases there is now the added benefit of being able to construct a stream without inheritance. + +This can be done by passing the appropriate methods as constructor options: + +Examples: + +### Readable +```javascript +var readable = new stream.Readable({ + read: function(n) { + // sets this._read under the hood + } +}); +``` + +### Writable +```javascript +var writable = new stream.Writable({ + write: function(chunk, encoding, next) { + // sets this._write under the hood + } +}); + +// or + +var writable = new stream.Writable({ + writev: function(chunks, next) { + // sets this._writev under the hood + } +}); +``` + +### Duplex +```javascript +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + }, + write: function(chunk, encoding, next) { + // sets this._write under the hood + } +}); + +// or + +var duplex = new stream.Duplex({ + read: function(n) { + // sets this._read under the hood + }, + writev: function(chunks, next) { + // sets this._writev under the hood + } +}); +``` + +### Transform +```javascript +var transform = new stream.Transform({ + transform: function(chunk, encoding, next) { + // sets this._transform under the hood + }, + flush: function(done) { + // sets this._flush under the hood + } +}); +``` + +## Streams: Under the Hood + + + +### Buffering + + + +Both Writable and Readable streams will buffer data on an internal +object which can be retrieved from `_writableState.getBuffer()` or +`_readableState.buffer`, respectively. + +The amount of data that will potentially be buffered depends on the +`highWaterMark` option which is passed into the constructor. + +Buffering in Readable streams happens when the implementation calls +[`stream.push(chunk)`][]. If the consumer of the Stream does not call +`stream.read()`, then the data will sit in the internal queue until it +is consumed. + +Buffering in Writable streams happens when the user calls +[`stream.write(chunk)`][] repeatedly, even when `write()` returns `false`. + +The purpose of streams, especially with the `pipe()` method, is to +limit the buffering of data to acceptable levels, so that sources and +destinations of varying speed will not overwhelm the available memory. + +### `stream.read(0)` + +There are some cases where you want to trigger a refresh of the +underlying readable stream mechanisms, without actually consuming any +data. In that case, you can call `stream.read(0)`, which will always +return null. + +If the internal read buffer is below the `highWaterMark`, and the +stream is not currently reading, then calling `read(0)` will trigger +a low-level `_read` call. + +There is almost never a need to do this. However, you will see some +cases in Node.js's internals where this is done, particularly in the +Readable stream class internals. + +### `stream.push('')` + +Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an +interesting side effect. Because it *is* a call to +[`stream.push()`][], it will end the `reading` process. However, it +does *not* add any data to the readable buffer, so there's nothing for +a user to consume. + +Very rarely, there are cases where you have no data to provide now, +but the consumer of your stream (or, perhaps, another bit of your own +code) will know when to check again, by calling `stream.read(0)`. In +those cases, you *may* call `stream.push('')`. + +So far, the only use case for this functionality is in the +[tls.CryptoStream][] class, which is deprecated in Node.js/io.js v1.0. If you +find that you have to use `stream.push('')`, please consider another +approach, because it almost certainly indicates that something is +horribly wrong. + +### Compatibility with Older Node.js Versions + + + +In versions of Node.js prior to v0.10, the Readable stream interface was +simpler, but also less powerful and less useful. + +* Rather than waiting for you to call the `read()` method, `'data'` + events would start emitting immediately. If you needed to do some + I/O to decide how to handle data, then you had to store the chunks + in some kind of buffer so that they would not be lost. +* The [`pause()`][] method was advisory, rather than guaranteed. This + meant that you still had to be prepared to receive `'data'` events + even when the stream was in a paused state. + +In Node.js v0.10, the Readable class described below was added. +For backwards compatibility with older Node.js programs, Readable streams +switch into "flowing mode" when a `'data'` event handler is added, or +when the [`resume()`][] method is called. The effect is that, even if +you are not using the new `read()` method and `'readable'` event, you +no longer have to worry about losing `'data'` chunks. + +Most programs will continue to function normally. However, this +introduces an edge case in the following conditions: + +* No [`'data'` event][] handler is added. +* The [`resume()`][] method is never called. +* The stream is not piped to any writable destination. + +For example, consider the following code: + +```javascript +// WARNING! BROKEN! +net.createServer(function(socket) { + + // we add an 'end' method, but never consume the data + socket.on('end', function() { + // It will never get here. + socket.end('I got your message (but didnt read it)\n'); + }); + +}).listen(1337); +``` + +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in Node.js v0.10 and beyond, +the socket will remain paused forever. + +The workaround in this situation is to call the `resume()` method to +start the flow of data: + +```javascript +// Workaround +net.createServer(function(socket) { + + socket.on('end', function() { + socket.end('I got your message (but didnt read it)\n'); + }); + + // start the flow of data, discarding it. + socket.resume(); + +}).listen(1337); +``` + +In addition to new Readable streams switching into flowing mode, +pre-v0.10 style streams can be wrapped in a Readable class using the +`wrap()` method. + + +### Object Mode + + + +Normally, Streams operate on Strings and Buffers exclusively. + +Streams that are in **object mode** can emit generic JavaScript values +other than Buffers and Strings. + +A Readable stream in object mode will always return a single item from +a call to `stream.read(size)`, regardless of what the size argument +is. + +A Writable stream in object mode will always ignore the `encoding` +argument to `stream.write(data, encoding)`. + +The special value `null` still retains its special value for object +mode streams. That is, for object mode readable streams, `null` as a +return value from `stream.read()` indicates that there is no more +data, and [`stream.push(null)`][] will signal the end of stream data +(`EOF`). + +No streams in Node.js core are object mode streams. This pattern is only +used by userland streaming libraries. + +You should set `objectMode` in your stream child class constructor on +the options object. Setting `objectMode` mid-stream is not safe. + +For Duplex streams `objectMode` can be set exclusively for readable or +writable side with `readableObjectMode` and `writableObjectMode` +respectively. These options can be used to implement parsers and +serializers with Transform streams. + +```javascript +var util = require('util'); +var StringDecoder = require('string_decoder').StringDecoder; +var Transform = require('stream').Transform; +util.inherits(JSONParseStream, Transform); + +// Gets \n-delimited JSON string data, and emits the parsed objects +function JSONParseStream() { + if (!(this instanceof JSONParseStream)) + return new JSONParseStream(); + + Transform.call(this, { readableObjectMode : true }); + + this._buffer = ''; + this._decoder = new StringDecoder('utf8'); +} + +JSONParseStream.prototype._transform = function(chunk, encoding, cb) { + this._buffer += this._decoder.write(chunk); + // split on newlines + var lines = this._buffer.split(/\r?\n/); + // keep the last partial line buffered + this._buffer = lines.pop(); + for (var l = 0; l < lines.length; l++) { + var line = lines[l]; + try { + var obj = JSON.parse(line); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; + +JSONParseStream.prototype._flush = function(cb) { + // Just handle any leftover + var rem = this._buffer.trim(); + if (rem) { + try { + var obj = JSON.parse(rem); + } catch (er) { + this.emit('error', er); + return; + } + // push the parsed object out to the readable consumer + this.push(obj); + } + cb(); +}; +``` + + +[EventEmitter]: https://iojs.org/dist/v5.0.0/doc/api/events.html#events_class_events_eventemitter +[Object mode]: #stream_object_mode +[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding +[`stream.push(null)`]: #stream_readable_push_chunk_encoding +[`stream.push()`]: #stream_readable_push_chunk_encoding +[`unpipe()`]: #stream_readable_unpipe_destination +[unpiped]: #stream_readable_unpipe_destination +[tcp sockets]: https://iojs.org/dist/v5.0.0/doc/api/net.html#net_class_net_socket +[zlib streams]: zlib.html +[zlib]: zlib.html +[crypto streams]: crypto.html +[crypto]: crypto.html +[tls.CryptoStream]: https://iojs.org/dist/v5.0.0/doc/api/tls.html#tls_class_cryptostream +[process.stdin]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdin +[stdout]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdout +[process.stdout]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdout +[process.stderr]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stderr +[child process stdout and stderr]: https://iojs.org/dist/v5.0.0/doc/api/child_process.html#child_process_child_stdout +[API for Stream Consumers]: #stream_api_for_stream_consumers +[API for Stream Implementors]: #stream_api_for_stream_implementors +[Readable]: #stream_class_stream_readable +[Writable]: #stream_class_stream_writable +[Duplex]: #stream_class_stream_duplex +[Transform]: #stream_class_stream_transform +[`end`]: #stream_event_end +[`finish`]: #stream_event_finish +[`_read(size)`]: #stream_readable_read_size_1 +[`_read()`]: #stream_readable_read_size_1 +[_read]: #stream_readable_read_size_1 +[`writable.write(chunk)`]: #stream_writable_write_chunk_encoding_callback +[`write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback +[`write()`]: #stream_writable_write_chunk_encoding_callback +[`stream.write(chunk)`]: #stream_writable_write_chunk_encoding_callback +[`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1 +[`_write()`]: #stream_writable_write_chunk_encoding_callback_1 +[_write]: #stream_writable_write_chunk_encoding_callback_1 +[`util.inherits`]: https://iojs.org/dist/v5.0.0/doc/api/util.html#util_util_inherits_constructor_superconstructor +[`end()`]: #stream_writable_end_chunk_encoding_callback +[`'data'` event]: #stream_event_data +[`resume()`]: #stream_readable_resume +[`readable.resume()`]: #stream_readable_resume +[`pause()`]: #stream_readable_pause +[`unpipe()`]: #stream_readable_unpipe_destination +[`pipe()`]: #stream_readable_pipe_destination_options diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md new file mode 100644 index 00000000..83275f19 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -0,0 +1,60 @@ +# streams WG Meeting 2015-01-30 + +## Links + +* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg +* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 +* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ + +## Agenda + +Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. + +* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) +* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) +* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) +* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) + +## Minutes + +### adopt a charter + +* group: +1's all around + +### What versioning scheme should be adopted? +* group: +1’s 3.0.0 +* domenic+group: pulling in patches from other sources where appropriate +* mikeal: version independently, suggesting versions for io.js +* mikeal+domenic: work with TC to notify in advance of changes +simpler stream creation + +### streamline creation of streams +* sam: streamline creation of streams +* domenic: nice simple solution posted + but, we lose the opportunity to change the model + may not be backwards incompatible (double check keys) + + **action item:** domenic will check + +### remove implicit flowing of streams on(‘data’) +* add isFlowing / isPaused +* mikeal: worrying that we’re documenting polyfill methods – confuses users +* domenic: more reflective API is probably good, with warning labels for users +* new section for mad scientists (reflective stream access) +* calvin: name the “third state” +* mikeal: maybe borrow the name from whatwg? +* domenic: we’re missing the “third state” +* consensus: kind of difficult to name the third state +* mikeal: figure out differences in states / compat +* mathias: always flow on data – eliminates third state + * explore what it breaks + +**action items:** +* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) +* ask rod/build for infrastructure +* **chris**: explore the “flow on data” approach +* add isPaused/isFlowing +* add new docs section +* move isPaused to that section + + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js new file mode 100644 index 00000000..ca807af8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/duplex.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_duplex.js") diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js new file mode 100644 index 00000000..69558af0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js @@ -0,0 +1,82 @@ +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +'use strict'; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +module.exports = Duplex; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +var keys = objectKeys(Writable.prototype); +for (var v = 0; v < keys.length; v++) { + var method = keys[v]; + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +} + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + processNextTick(onEndNT, this); +} + +function onEndNT(self) { + self.end(); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js new file mode 100644 index 00000000..bddfdd01 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js @@ -0,0 +1,27 @@ +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +'use strict'; + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js new file mode 100644 index 00000000..90068ea2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js @@ -0,0 +1,973 @@ +'use strict'; + +module.exports = Readable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events'); + +/**/ +var EElistenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + + + +/**/ +var Stream; +(function (){try{ + Stream = require('st' + 'ream'); +}catch(_){}finally{ + if (!Stream) + Stream = require('events').EventEmitter; +}}()) +/**/ + +var Buffer = require('buffer').Buffer; + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + + + +/**/ +var debugUtil = require('util'); +var debug; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var StringDecoder; + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + var Duplex = require('./_stream_duplex'); + + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + if (options && typeof options.read === 'function') + this._read = options.read; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (!state.objectMode && typeof chunk === 'string') { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +Readable.prototype.isPaused = function() { + return this._readableState.flowing === false; +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (chunk === null) { + state.reading = false; + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + if (!addToFront) + state.reading = false; + + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) + state.buffer.unshift(chunk); + else + state.buffer.push(chunk); + + if (state.needReadable) + emitReadable(stream); + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (n === null || isNaN(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = computeNewHighWaterMark(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else { + return state.length; + } + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (typeof n !== 'number' || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (ret === null) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) + endReadable(this); + + if (ret !== null) + this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!(Buffer.isBuffer(chunk)) && + typeof chunk !== 'string' && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.ended) return; + if (state.decoder) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) + processNextTick(emitReadable_, stream); + else + emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + processNextTick(maybeReadMore_, stream, state); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + processNextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + cleanedUp = true; + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && + (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + if (state.pipesCount === 1 && + state.pipes[0] === dest && + src.listenerCount('data') === 1 && + !cleanedUp) { + debug('false write response, pause', src._readableState.awaitDrain); + src._readableState.awaitDrain++; + } + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + processNextTick(nReadingNextTick, this); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +function nReadingNextTick(self) { + debug('readable nexttick read 0'); + self.read(0); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + processNextTick(resume_, stream, state); + } +} + +function resume_(stream, state) { + if (!state.reading) { + debug('resume read 0'); + stream.read(0); + } + + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) + stream.read(0); +} + +Readable.prototype.pause = function() { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + debug('wrapped data'); + if (state.decoder) + chunk = state.decoder.write(chunk); + + // don't skip over falsy values in objectMode + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (this[i] === undefined && typeof stream[i] === 'function') { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }; }(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else if (list.length === 1) + ret = list[0]; + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + processNextTick(endReadableNT, state, stream); + } +} + +function endReadableNT(state, stream) { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js new file mode 100644 index 00000000..3675d18d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js @@ -0,0 +1,197 @@ +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +'use strict'; + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + + +function TransformState(stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (data !== null && data !== undefined) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') + this._transform = options.transform; + + if (typeof options.flush === 'function') + this._flush = options.flush; + } + + this.once('prefinish', function() { + if (typeof this._flush === 'function') + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (ts.writechunk !== null && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js new file mode 100644 index 00000000..23a2ba29 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js @@ -0,0 +1,527 @@ +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + +'use strict'; + +module.exports = Writable; + +/**/ +var processNextTick = require('process-nextick-args'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + + +/**/ +var internalUtil = { + deprecate: require('util-deprecate') +}; +/**/ + + + +/**/ +var Stream; +(function (){try{ + Stream = require('st' + 'ream'); +}catch(_){}finally{ + if (!Stream) + Stream = require('events').EventEmitter; +}}()) +/**/ + +var Buffer = require('buffer').Buffer; + +util.inherits(Writable, Stream); + +function nop() {} + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +function WritableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = this.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; +} + +WritableState.prototype.getBuffer = function writableStateGetBuffer() { + var current = this.bufferedRequest; + var out = []; + while (current) { + out.push(current); + current = current.next; + } + return out; +}; + +(function (){try { +Object.defineProperty(WritableState.prototype, 'buffer', { + get: internalUtil.deprecate(function() { + return this.getBuffer(); + }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + + 'instead.') +}); +}catch(_){}}()); + + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + if (options) { + if (typeof options.write === 'function') + this._write = options.write; + + if (typeof options.writev === 'function') + this._writev = options.writev; + } + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + processNextTick(cb, er); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + + if (!(Buffer.isBuffer(chunk)) && + typeof chunk !== 'string' && + chunk !== null && + chunk !== undefined && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + processNextTick(cb, er); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (typeof cb !== 'function') + cb = nop; + + if (state.ended) + writeAfterEnd(this, cb); + else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function() { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function() { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && + !state.corked && + !state.finished && + !state.bufferProcessing && + state.bufferedRequest) + clearBuffer(this, state); + } +}; + +Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { + // node::ParseEncoding() requires lower case. + if (typeof encoding === 'string') + encoding = encoding.toLowerCase(); + if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', +'ucs2', 'ucs-2','utf16le', 'utf-16le', 'raw'] +.indexOf((encoding + '').toLowerCase()) > -1)) + throw new TypeError('Unknown encoding: ' + encoding); + this._writableState.defaultEncoding = encoding; +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + typeof chunk === 'string') { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + + if (Buffer.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); + if (last) { + last.next = state.lastBufferedRequest; + } else { + state.bufferedRequest = state.lastBufferedRequest; + } + } else { + doWrite(stream, state, false, len, chunk, encoding, cb); + } + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) + stream._writev(chunk, state.onwrite); + else + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + --state.pendingcb; + if (sync) + processNextTick(cb, er); + else + cb(er); + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(state); + + if (!finished && + !state.corked && + !state.bufferProcessing && + state.bufferedRequest) { + clearBuffer(stream, state); + } + + if (sync) { + processNextTick(afterWrite, stream, state, finished, cb); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + var buffer = []; + var cbs = []; + while (entry) { + cbs.push(entry.callback); + buffer.push(entry); + entry = entry.next; + } + + // count the one we are adding, as well. + // TODO(isaacs) clean this up + state.pendingcb++; + state.lastBufferedRequest = null; + doWrite(stream, state, true, state.length, buffer, '', function(err) { + for (var i = 0; i < cbs.length; i++) { + state.pendingcb--; + cbs[i](err); + } + }); + + // Clear buffer + } else { + // Slow case, write chunks one-by-one + while (entry) { + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + entry = entry.next; + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + break; + } + } + + if (entry === null) + state.lastBufferedRequest = null; + } + state.bufferedRequest = entry; + state.bufferProcessing = false; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (typeof chunk === 'function') { + cb = chunk; + chunk = null; + encoding = null; + } else if (typeof encoding === 'function') { + cb = encoding; + encoding = null; + } + + if (chunk !== null && chunk !== undefined) + this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(state) { + return (state.ending && + state.length === 0 && + state.bufferedRequest === null && + !state.finished && + !state.writing); +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else { + prefinish(stream, state); + } + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + processNextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE new file mode 100644 index 00000000..d8d7f943 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE @@ -0,0 +1,19 @@ +Copyright Node.js contributors. All rights reserved. + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md new file mode 100644 index 00000000..5a76b414 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch new file mode 100644 index 00000000..a06d5c05 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// 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. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000..ff4c851c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +function isArray(arg) { + if (Array.isArray) { + return Array.isArray(arg); + } + return objectToString(arg) === '[object Array]'; +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 00000000..ddd227e6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,60 @@ +{ + "name": "core-util-is", + "version": "1.0.2", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is.git" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "scripts": { + "test": "tap test.js" + }, + "devDependencies": { + "tap": "^2.3.0" + }, + "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", + "homepage": "https://github.com/isaacs/core-util-is#readme", + "_id": "core-util-is@1.0.2", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "_from": "core-util-is@>=1.0.0 <1.1.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "dist": { + "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", + "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js new file mode 100644 index 00000000..1a490c65 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js @@ -0,0 +1,68 @@ +var assert = require('tap'); + +var t = require('./lib/util'); + +assert.equal(t.isArray([]), true); +assert.equal(t.isArray({}), false); + +assert.equal(t.isBoolean(null), false); +assert.equal(t.isBoolean(true), true); +assert.equal(t.isBoolean(false), true); + +assert.equal(t.isNull(null), true); +assert.equal(t.isNull(undefined), false); +assert.equal(t.isNull(false), false); +assert.equal(t.isNull(), false); + +assert.equal(t.isNullOrUndefined(null), true); +assert.equal(t.isNullOrUndefined(undefined), true); +assert.equal(t.isNullOrUndefined(false), false); +assert.equal(t.isNullOrUndefined(), true); + +assert.equal(t.isNumber(null), false); +assert.equal(t.isNumber('1'), false); +assert.equal(t.isNumber(1), true); + +assert.equal(t.isString(null), false); +assert.equal(t.isString('1'), true); +assert.equal(t.isString(1), false); + +assert.equal(t.isSymbol(null), false); +assert.equal(t.isSymbol('1'), false); +assert.equal(t.isSymbol(1), false); +assert.equal(t.isSymbol(Symbol()), true); + +assert.equal(t.isUndefined(null), false); +assert.equal(t.isUndefined(undefined), true); +assert.equal(t.isUndefined(false), false); +assert.equal(t.isUndefined(), true); + +assert.equal(t.isRegExp(null), false); +assert.equal(t.isRegExp('1'), false); +assert.equal(t.isRegExp(new RegExp()), true); + +assert.equal(t.isObject({}), true); +assert.equal(t.isObject([]), true); +assert.equal(t.isObject(new RegExp()), true); +assert.equal(t.isObject(new Date()), true); + +assert.equal(t.isDate(null), false); +assert.equal(t.isDate('1'), false); +assert.equal(t.isDate(new Date()), true); + +assert.equal(t.isError(null), false); +assert.equal(t.isError({ err: true }), false); +assert.equal(t.isError(new Error()), true); + +assert.equal(t.isFunction(null), false); +assert.equal(t.isFunction({ }), false); +assert.equal(t.isFunction(function() {}), true); + +assert.equal(t.isPrimitive(null), true); +assert.equal(t.isPrimitive(''), true); +assert.equal(t.isPrimitive(0), true); +assert.equal(t.isPrimitive(new Date()), false); + +assert.equal(t.isBuffer(null), false); +assert.equal(t.isBuffer({}), false); +assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE new file mode 100644 index 00000000..dea3013d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/LICENSE @@ -0,0 +1,16 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md new file mode 100644 index 00000000..b1c56658 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/README.md @@ -0,0 +1,42 @@ +Browser-friendly inheritance fully compatible with standard node.js +[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). + +This package exports standard `inherits` from node.js `util` module in +node environment, but also provides alternative browser-friendly +implementation through [browser +field](https://gist.github.com/shtylman/4339901). Alternative +implementation is a literal copy of standard one located in standalone +module to avoid requiring of `util`. It also has a shim for old +browsers with no `Object.create` support. + +While keeping you sure you are using standard `inherits` +implementation in node.js environment, it allows bundlers such as +[browserify](https://github.com/substack/node-browserify) to not +include full `util` package to your client code if all you need is +just `inherits` function. It worth, because browser shim for `util` +package is large and `inherits` is often the single function you need +from it. + +It's recommended to use this package instead of +`require('util').inherits` for any code that has chances to be used +not only in node.js but in browser too. + +## usage + +```js +var inherits = require('inherits'); +// then use exactly as the standard one +``` + +## note on version ~1.0 + +Version ~1.0 had completely different motivation and is not compatible +neither with 2.0 nor with standard node.js `inherits`. + +If you are using version ~1.0 and planning to switch to ~2.0, be +careful: + +* new version uses `super_` instead of `super` for referencing + superclass +* new version overwrites current prototype while old one preserves any + existing fields on it diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js new file mode 100644 index 00000000..29f5e24f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits.js @@ -0,0 +1 @@ +module.exports = require('util').inherits diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js new file mode 100644 index 00000000..c1e78a75 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/inherits_browser.js @@ -0,0 +1,23 @@ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json new file mode 100644 index 00000000..93d50784 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json @@ -0,0 +1,50 @@ +{ + "name": "inherits", + "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", + "version": "2.0.1", + "keywords": [ + "inheritance", + "class", + "klass", + "oop", + "object-oriented", + "inherits", + "browser", + "browserify" + ], + "main": "./inherits.js", + "browser": "./inherits_browser.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/inherits.git" + }, + "license": "ISC", + "scripts": { + "test": "node test" + }, + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "_id": "inherits@2.0.1", + "dist": { + "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "_from": "inherits@>=2.0.1 <2.1.0", + "_npmVersion": "1.3.8", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "readme": "ERROR: No README data found!", + "homepage": "https://github.com/isaacs/inherits#readme" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js new file mode 100644 index 00000000..fc53012d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/test.js @@ -0,0 +1,25 @@ +var inherits = require('./inherits.js') +var assert = require('assert') + +function test(c) { + assert(c.constructor === Child) + assert(c.constructor.super_ === Parent) + assert(Object.getPrototypeOf(c) === Child.prototype) + assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) + assert(c instanceof Child) + assert(c instanceof Parent) +} + +function Child() { + Parent.call(this) + test(this) +} + +function Parent() {} + +inherits(Child, Parent) + +var c = new Child +test(c) + +console.log('ok') diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 00000000..052a62b8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,54 @@ + +# isarray + +`Array#isArray` for older browsers. + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js new file mode 100644 index 00000000..ec58596a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js @@ -0,0 +1,209 @@ + +/** + * Require the given path. + * + * @param {String} path + * @return {Object} exports + * @api public + */ + +function require(path, parent, orig) { + var resolved = require.resolve(path); + + // lookup failed + if (null == resolved) { + orig = orig || path; + parent = parent || 'root'; + var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); + err.path = orig; + err.parent = parent; + err.require = true; + throw err; + } + + var module = require.modules[resolved]; + + // perform real require() + // by invoking the module's + // registered function + if (!module.exports) { + module.exports = {}; + module.client = module.component = true; + module.call(this, module.exports, require.relative(resolved), module); + } + + return module.exports; +} + +/** + * Registered modules. + */ + +require.modules = {}; + +/** + * Registered aliases. + */ + +require.aliases = {}; + +/** + * Resolve `path`. + * + * Lookup: + * + * - PATH/index.js + * - PATH.js + * - PATH + * + * @param {String} path + * @return {String} path or null + * @api private + */ + +require.resolve = function(path) { + if (path.charAt(0) === '/') path = path.slice(1); + var index = path + '/index.js'; + + var paths = [ + path, + path + '.js', + path + '.json', + path + '/index.js', + path + '/index.json' + ]; + + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + if (require.modules.hasOwnProperty(path)) return path; + } + + if (require.aliases.hasOwnProperty(index)) { + return require.aliases[index]; + } +}; + +/** + * Normalize `path` relative to the current path. + * + * @param {String} curr + * @param {String} path + * @return {String} + * @api private + */ + +require.normalize = function(curr, path) { + var segs = []; + + if ('.' != path.charAt(0)) return path; + + curr = curr.split('/'); + path = path.split('/'); + + for (var i = 0; i < path.length; ++i) { + if ('..' == path[i]) { + curr.pop(); + } else if ('.' != path[i] && '' != path[i]) { + segs.push(path[i]); + } + } + + return curr.concat(segs).join('/'); +}; + +/** + * Register module at `path` with callback `definition`. + * + * @param {String} path + * @param {Function} definition + * @api private + */ + +require.register = function(path, definition) { + require.modules[path] = definition; +}; + +/** + * Alias a module definition. + * + * @param {String} from + * @param {String} to + * @api private + */ + +require.alias = function(from, to) { + if (!require.modules.hasOwnProperty(from)) { + throw new Error('Failed to alias "' + from + '", it does not exist'); + } + require.aliases[to] = from; +}; + +/** + * Return a require function relative to the `parent` path. + * + * @param {String} parent + * @return {Function} + * @api private + */ + +require.relative = function(parent) { + var p = require.normalize(parent, '..'); + + /** + * lastIndexOf helper. + */ + + function lastIndexOf(arr, obj) { + var i = arr.length; + while (i--) { + if (arr[i] === obj) return i; + } + return -1; + } + + /** + * The relative require() itself. + */ + + function localRequire(path) { + var resolved = localRequire.resolve(path); + return require(resolved, parent, path); + } + + /** + * Resolve relative to the parent. + */ + + localRequire.resolve = function(path) { + var c = path.charAt(0); + if ('/' == c) return path.slice(1); + if ('.' == c) return require.normalize(p, path); + + // resolve deps by returning + // the dep in the nearest "deps" + // directory + var segs = parent.split('/'); + var i = lastIndexOf(segs, 'deps') + 1; + if (!i) i = 0; + path = segs.slice(0, i + 1).join('/') + '/deps/' + path; + return path; + }; + + /** + * Check if module is defined at `path`. + */ + + localRequire.exists = function(path) { + return require.modules.hasOwnProperty(localRequire.resolve(path)); + }; + + return localRequire; +}; +require.register("isarray/index.js", function(exports, require, module){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +}); +require.alias("isarray/index.js", "isarray/index.js"); + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 00000000..9e31b683 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 00000000..5f5ad45d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,3 @@ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 00000000..19228ab6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,53 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": {}, + "devDependencies": { + "tap": "*" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "_id": "isarray@0.0.1", + "dist": { + "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "_from": "isarray@0.0.1", + "_npmVersion": "1.2.18", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + }, + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml new file mode 100644 index 00000000..5ac98855 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" + - "0.12" + - "iojs" diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js new file mode 100644 index 00000000..049521ca --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = nextTick; + +function nextTick(fn) { + var args = new Array(arguments.length - 1); + var i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + process.nextTick(function afterTick() { + fn.apply(null, args); + }); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md new file mode 100644 index 00000000..c67e3532 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md @@ -0,0 +1,19 @@ +# Copyright (c) 2015 Calvin Metcalf + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json new file mode 100644 index 00000000..087586e8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -0,0 +1,45 @@ +{ + "name": "process-nextick-args", + "version": "1.0.3", + "description": "process.nextTick but always with args", + "main": "index.js", + "scripts": { + "test": "node test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" + }, + "homepage": "https://github.com/calvinmetcalf/process-nextick-args", + "devDependencies": { + "tap": "~0.2.6" + }, + "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8", + "_id": "process-nextick-args@1.0.3", + "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", + "_from": "process-nextick-args@>=1.0.0 <1.1.0", + "_npmVersion": "2.9.0", + "_nodeVersion": "2.5.0", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", + "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" + }, + "maintainers": [ + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md new file mode 100644 index 00000000..78e7cfae --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/readme.md @@ -0,0 +1,18 @@ +process-nextick-args +===== + +[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) + +```bash +npm install --save process-nextick-args +``` + +Always be able to pass arguments to process.nextTick, no matter the platform + +```js +var nextTick = require('process-nextick-args'); + +nextTick(function (a, b, c) { + console.log(a, b, c); +}, 'step', 3, 'profit'); +``` diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js new file mode 100644 index 00000000..ef157215 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js @@ -0,0 +1,24 @@ +var test = require("tap").test; +var nextTick = require('./'); + +test('should work', function (t) { + t.plan(5); + nextTick(function (a) { + t.ok(a); + nextTick(function (thing) { + t.equals(thing, 7); + }, 7); + }, true); + nextTick(function (a, b, c) { + t.equals(a, 'step'); + t.equals(b, 3); + t.equals(c, 'profit'); + }, 'step', 3, 'profit'); +}); + +test('correct number of arguments', function (t) { + t.plan(1); + nextTick(function () { + t.equals(2, arguments.length, 'correct number'); + }, 1, 2); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000..206320cc --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000..6de584a4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000..4d2aa001 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** + +The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 00000000..b00e54fb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -0,0 +1,221 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000..0364d54b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,54 @@ +{ + "name": "string_decoder", + "version": "0.10.31", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md new file mode 100644 index 00000000..acc86753 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE new file mode 100644 index 00000000..6a60e8c2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/README.md new file mode 100644 index 00000000..75622fa7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/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 + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js new file mode 100644 index 00000000..549ae2f0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @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.warn(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) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/node.js new file mode 100644 index 00000000..5e6fcff5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/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; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json new file mode 100644 index 00000000..ae0c70f6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -0,0 +1,54 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "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": "nathan@tootallnate.net", + "url": "http://n8.io/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate", + "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", + "_id": "util-deprecate@1.0.2", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "_from": "util-deprecate@>=1.0.1 <1.1.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], + "dist": { + "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json new file mode 100644 index 00000000..248dbac4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -0,0 +1,76 @@ +{ + "name": "readable-stream", + "version": "2.0.4", + "description": "Streams3, a user-land copy of the stream library from iojs v2.x", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "process-nextick-args": "~1.0.0", + "string_decoder": "~0.10.x", + "util-deprecate": "~1.0.1" + }, + "devDependencies": { + "tap": "~0.2.6", + "tape": "~4.0.0", + "zuul": "~3.0.0" + }, + "scripts": { + "test": "tap test/parallel/*.js", + "browser": "npm run write-zuul && zuul -- test/browser.js", + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + }, + "repository": { + "type": "git", + "url": "git://github.com/nodejs/readable-stream.git" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "license": "MIT", + "gitHead": "f2a4f4a659bacbe742a494b7d2aede64fab0d4f9", + "bugs": { + "url": "https://github.com/nodejs/readable-stream/issues" + }, + "homepage": "https://github.com/nodejs/readable-stream#readme", + "_id": "readable-stream@2.0.4", + "_shasum": "2523ef27ffa339d7ba9da8603f2d0599d06edbd8", + "_from": "readable-stream@>=2.0.0 <2.1.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.1", + "_npmUser": { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + }, + "dist": { + "shasum": "2523ef27ffa339d7ba9da8603f2d0599d06edbd8", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + }, + { + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js new file mode 100644 index 00000000..27e8d8a5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/passthrough.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_passthrough.js") diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js new file mode 100644 index 00000000..6222a579 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/readable.js @@ -0,0 +1,12 @@ +var Stream = (function (){ + try { + return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify + } catch(_){} +}()); +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = Stream || exports; +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js new file mode 100644 index 00000000..5d482f07 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/transform.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_transform.js") diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js new file mode 100644 index 00000000..e1e9efdf --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/node_modules/readable-stream/writable.js @@ -0,0 +1 @@ +module.exports = require("./lib/_stream_writable.js") diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/package.json new file mode 100644 index 00000000..15138470 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/package.json @@ -0,0 +1,62 @@ +{ + "name": "bl", + "version": "1.0.0", + "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", + "main": "bl.js", + "scripts": { + "test": "node test/test.js | faucet", + "test-local": "brtapsauce-local test/basic-test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/bl.git" + }, + "homepage": "https://github.com/rvagg/bl", + "authors": [ + "Rod Vagg (https://github.com/rvagg)", + "Matteo Collina (https://github.com/mcollina)", + "Jarett Cruger (https://github.com/jcrugzz)" + ], + "keywords": [ + "buffer", + "buffers", + "stream", + "awesomesauce" + ], + "license": "MIT", + "dependencies": { + "readable-stream": "~2.0.0" + }, + "devDependencies": { + "tape": "~2.12.3", + "hash_file": "~0.1.1", + "faucet": "~0.0.1", + "brtapsauce": "~0.3.0" + }, + "gitHead": "1794938be6697a6d1e02cd942a4eea59b353347a", + "bugs": { + "url": "https://github.com/rvagg/bl/issues" + }, + "_id": "bl@1.0.0", + "_shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5", + "_from": "bl@>=1.0.0 <1.1.0", + "_npmVersion": "2.9.0", + "_nodeVersion": "2.0.1-nightly20150618d2e4e03444", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5", + "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/basic-test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/basic-test.js new file mode 100644 index 00000000..75116a30 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/basic-test.js @@ -0,0 +1,541 @@ +var tape = require('tape') + , crypto = require('crypto') + , fs = require('fs') + , hash = require('hash_file') + , BufferList = require('../') + + , encodings = + ('hex utf8 utf-8 ascii binary base64' + + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') + +tape('single bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + + t.equal(bl.length, 4) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + + t.end() +}) + +tape('single bytes from multiple buffers', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.get(0), 97) + t.equal(bl.get(1), 98) + t.equal(bl.get(2), 99) + t.equal(bl.get(3), 100) + t.equal(bl.get(4), 101) + t.equal(bl.get(5), 102) + t.equal(bl.get(6), 103) + t.equal(bl.get(7), 104) + t.equal(bl.get(8), 105) + t.equal(bl.get(9), 106) + t.end() +}) + +tape('multi bytes from single buffer', function (t) { + var bl = new BufferList() + bl.append(new Buffer('abcd')) + + t.equal(bl.length, 4) + + t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') + t.equal(bl.slice(0, 3).toString('ascii'), 'abc') + t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') + + t.end() +}) + +tape('multiple bytes from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +tape('multiple bytes from multiple buffer lists', function (t) { + var bl = new BufferList() + + bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')])) + bl.append(new BufferList([new Buffer('hi'), new Buffer('j')])) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') + t.equal(bl.slice(3, 6).toString('ascii'), 'def') + t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') + t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') + + t.end() +}) + +tape('consuming from multiple buffers', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.length, 10) + + t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') + + bl.consume(3) + t.equal(bl.length, 7) + t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') + + bl.consume(2) + t.equal(bl.length, 5) + t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') + + bl.consume(1) + t.equal(bl.length, 4) + t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') + + bl.consume(1) + t.equal(bl.length, 3) + t.equal(bl.slice(0, 3).toString('ascii'), 'hij') + + bl.consume(2) + t.equal(bl.length, 1) + t.equal(bl.slice(0, 1).toString('ascii'), 'j') + + t.end() +}) + +tape('test readUInt8 / readInt8', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt8(2), 0x3) + t.equal(bl.readInt8(2), 0x3) + t.equal(bl.readUInt8(3), 0x4) + t.equal(bl.readInt8(3), 0x4) + t.equal(bl.readUInt8(4), 0x23) + t.equal(bl.readInt8(4), 0x23) + t.equal(bl.readUInt8(5), 0x42) + t.equal(bl.readInt8(5), 0x42) + t.end() +}) + +tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt16BE(2), 0x0304) + t.equal(bl.readUInt16LE(2), 0x0403) + t.equal(bl.readInt16BE(2), 0x0304) + t.equal(bl.readInt16LE(2), 0x0403) + t.equal(bl.readUInt16BE(3), 0x0423) + t.equal(bl.readUInt16LE(3), 0x2304) + t.equal(bl.readInt16BE(3), 0x0423) + t.equal(bl.readInt16LE(3), 0x2304) + t.equal(bl.readUInt16BE(4), 0x2342) + t.equal(bl.readUInt16LE(4), 0x4223) + t.equal(bl.readInt16BE(4), 0x2342) + t.equal(bl.readInt16LE(4), 0x4223) + t.end() +}) + +tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x3 + buf2[2] = 0x4 + buf3[0] = 0x23 + buf3[1] = 0x42 + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readUInt32BE(2), 0x03042342) + t.equal(bl.readUInt32LE(2), 0x42230403) + t.equal(bl.readInt32BE(2), 0x03042342) + t.equal(bl.readInt32LE(2), 0x42230403) + t.end() +}) + +tape('test readFloatLE / readFloatBE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(3) + , bl = new BufferList() + + buf2[1] = 0x00 + buf2[2] = 0x00 + buf3[0] = 0x80 + buf3[1] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readFloatLE(2), 0x01) + t.end() +}) + +tape('test readDoubleLE / readDoubleBE', function (t) { + var buf1 = new Buffer(1) + , buf2 = new Buffer(3) + , buf3 = new Buffer(10) + , bl = new BufferList() + + buf2[1] = 0x55 + buf2[2] = 0x55 + buf3[0] = 0x55 + buf3[1] = 0x55 + buf3[2] = 0x55 + buf3[3] = 0x55 + buf3[4] = 0xd5 + buf3[5] = 0x3f + + bl.append(buf1) + bl.append(buf2) + bl.append(buf3) + + t.equal(bl.readDoubleLE(2), 0.3333333333333333) + t.end() +}) + +tape('test toString', function (t) { + var bl = new BufferList() + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + + t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') + t.equal(bl.toString('ascii', 3, 10), 'defghij') + t.equal(bl.toString('ascii', 3, 6), 'def') + t.equal(bl.toString('ascii', 3, 8), 'defgh') + t.equal(bl.toString('ascii', 5, 10), 'fghij') + + t.end() +}) + +tape('test toString encoding', function (t) { + var bl = new BufferList() + , b = new Buffer('abcdefghij\xff\x00') + + bl.append(new Buffer('abcd')) + bl.append(new Buffer('efg')) + bl.append(new Buffer('hi')) + bl.append(new Buffer('j')) + bl.append(new Buffer('\xff\x00')) + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc), enc) + }) + + t.end() +}) + +!process.browser && tape('test stream', function (t) { + var random = crypto.randomBytes(65534) + , rndhash = hash(random, 'md5') + , md5sum = crypto.createHash('md5') + , bl = new BufferList(function (err, buf) { + t.ok(Buffer.isBuffer(buf)) + t.ok(err === null) + t.equal(rndhash, hash(bl.slice(), 'md5')) + t.equal(rndhash, hash(buf, 'md5')) + + bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) + .on('close', function () { + var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') + s.on('data', md5sum.update.bind(md5sum)) + s.on('end', function() { + t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') + t.end() + }) + }) + + }) + + fs.writeFileSync('/tmp/bl_test_rnd.dat', random) + fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) +}) + +tape('instantiation with Buffer', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = crypto.randomBytes(1024) + , b = BufferList(buf) + + t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') + b = BufferList([ buf, buf2 ]) + t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') + t.end() +}) + +tape('test String appendage', function (t) { + var bl = new BufferList() + , b = new Buffer('abcdefghij\xff\x00') + + bl.append('abcd') + bl.append('efg') + bl.append('hi') + bl.append('j') + bl.append('\xff\x00') + + encodings.forEach(function (enc) { + t.equal(bl.toString(enc), b.toString(enc)) + }) + + t.end() +}) + +tape('write nothing, should get empty buffer', function (t) { + t.plan(3) + BufferList(function (err, data) { + t.notOk(err, 'no error') + t.ok(Buffer.isBuffer(data), 'got a buffer') + t.equal(0, data.length, 'got a zero-length buffer') + t.end() + }).end() +}) + +tape('unicode string', function (t) { + t.plan(2) + var inp1 = '\u2600' + , inp2 = '\u2603' + , exp = inp1 + ' and ' + inp2 + , bl = BufferList() + bl.write(inp1) + bl.write(' and ') + bl.write(inp2) + t.equal(exp, bl.toString()) + t.equal(new Buffer(exp).toString('hex'), bl.toString('hex')) +}) + +tape('should emit finish', function (t) { + var source = BufferList() + , dest = BufferList() + + source.write('hello') + source.pipe(dest) + + dest.on('finish', function () { + t.equal(dest.toString('utf8'), 'hello') + t.end() + }) +}) + +tape('basic copy', function (t) { + var buf = crypto.randomBytes(1024) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy after many appends', function (t) { + var buf = crypto.randomBytes(512) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2) + t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy at a precise position', function (t) { + var buf = crypto.randomBytes(1004) + , buf2 = new Buffer(1024) + , b = BufferList(buf) + + b.copy(buf2, 20) + t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') + t.end() +}) + +tape('copy starting from a precise location', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = new Buffer(5) + , b = BufferList(buf) + + b.copy(buf2, 0, 5) + t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy in an interval', function (t) { + var rnd = crypto.randomBytes(10) + , b = BufferList(rnd) // put the random bytes there + , actual = new Buffer(3) + , expected = new Buffer(3) + + rnd.copy(expected, 0, 5, 8) + b.copy(actual, 0, 5, 8) + + t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') + t.end() +}) + +tape('copy an interval between two buffers', function (t) { + var buf = crypto.randomBytes(10) + , buf2 = new Buffer(10) + , b = BufferList(buf) + + b.append(buf) + b.copy(buf2, 0, 5, 15) + + t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') + t.end() +}) + +tape('duplicate', function (t) { + t.plan(2) + + var bl = new BufferList('abcdefghij\xff\x00') + , dup = bl.duplicate() + + t.equal(bl.prototype, dup.prototype) + t.equal(bl.toString('hex'), dup.toString('hex')) +}) + +tape('destroy no pipe', function (t) { + t.plan(2) + + var bl = new BufferList('alsdkfja;lsdkfja;lsdk') + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) +}) + +!process.browser && tape('destroy with pipe before read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/sauce.js') + .pipe(bl) + + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + +}) + +!process.browser && tape('destroy with pipe before read end with race', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/sauce.js') + .pipe(bl) + + setTimeout(function () { + bl.destroy() + setTimeout(function () { + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + }, 500) + }, 500) +}) + +!process.browser && tape('destroy with pipe after read end', function (t) { + t.plan(2) + + var bl = new BufferList() + fs.createReadStream(__dirname + '/sauce.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.destroy() + + t.equal(bl._bufs.length, 0) + t.equal(bl.length, 0) + } +}) + +!process.browser && tape('destroy with pipe while writing to a destination', function (t) { + t.plan(4) + + var bl = new BufferList() + , ds = new BufferList() + + fs.createReadStream(__dirname + '/sauce.js') + .on('end', onEnd) + .pipe(bl) + + function onEnd () { + bl.pipe(ds) + + setTimeout(function () { + bl.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + ds.destroy() + + t.equals(bl._bufs.length, 0) + t.equals(bl.length, 0) + + }, 100) + } +}) + +!process.browser && tape('handle error', function (t) { + t.plan(2) + fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { + t.ok(err instanceof Error, 'has error') + t.notOk(data, 'no data') + })) +}) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/sauce.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/sauce.js new file mode 100644 index 00000000..a6d28625 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/sauce.js @@ -0,0 +1,38 @@ +#!/usr/bin/env node + +const user = process.env.SAUCE_USER + , key = process.env.SAUCE_KEY + , path = require('path') + , brtapsauce = require('brtapsauce') + , testFile = path.join(__dirname, 'basic-test.js') + + , capabilities = [ + { browserName: 'chrome' , platform: 'Windows XP', version: '' } + , { browserName: 'firefox' , platform: 'Windows 8' , version: '' } + , { browserName: 'firefox' , platform: 'Windows XP', version: '4' } + , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' } + , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9' } + , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8' } + , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7' } + , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6' } + , { browserName: 'safari' , platform: 'Windows 7' , version: '5' } + , { browserName: 'safari' , platform: 'OS X 10.8' , version: '6' } + , { browserName: 'opera' , platform: 'Windows 7' , version: '' } + , { browserName: 'opera' , platform: 'Windows 7' , version: '11' } + , { browserName: 'ipad' , platform: 'OS X 10.8' , version: '6' } + , { browserName: 'android' , platform: 'Linux' , version: '4.0', 'device-type': 'tablet' } + ] + +if (!user) + throw new Error('Must set a SAUCE_USER env var') +if (!key) + throw new Error('Must set a SAUCE_KEY env var') + +brtapsauce({ + name : 'Traversty' + , user : user + , key : key + , brsrc : testFile + , capabilities : capabilities + , options : { timeout: 60 * 6 } +}) \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/test.js new file mode 100644 index 00000000..aa9b4877 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/bl/test/test.js @@ -0,0 +1,9 @@ +require('./basic-test') + +if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER) + return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests') + +if (!/v0\.10/.test(process.version)) + return console.log('Not Node v0.10.x, not running sauce tests') + +require('./sauce.js') \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/LICENSE new file mode 100644 index 00000000..61789f4a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/LICENSE @@ -0,0 +1,28 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION +1. Definitions. +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +You must give any other recipients of the Work or Derivative Works a copy of this License; and +You must cause any modified files to carry prominent notices stating that You changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/README.md new file mode 100644 index 00000000..e5077a21 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/README.md @@ -0,0 +1,45 @@ +## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing. + +This library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set. + +## Usage + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'asdf') +c.get('a-header') === 'asdf' +``` + +## has(key) + +Has takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with. + +```javascript +c.has('a-header') === 'a-Header' +``` + +## set(key, value[, clobber=true]) + +Set is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header. + +```javascript +c.set('a-Header', 'fdas') +c.set('a-HEADER', 'more', false) +c.get('a-header') === 'fdsa,more' +``` + +## swap(key) + +Swaps the casing of a header with the new one that is passed in. + +```javascript +var headers = {} + , c = caseless(headers) + ; +c.set('a-Header', 'fdas') +c.swap('a-HEADER') +c.has('a-header') === 'a-HEADER' +headers === {'a-HEADER': 'fdas'} +``` diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/index.js new file mode 100644 index 00000000..d86a70ec --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/index.js @@ -0,0 +1,66 @@ +function Caseless (dict) { + this.dict = dict || {} +} +Caseless.prototype.set = function (name, value, clobber) { + if (typeof name === 'object') { + for (var i in name) { + this.set(i, name[i], value) + } + } else { + if (typeof clobber === 'undefined') clobber = true + var has = this.has(name) + + if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value + else this.dict[has || name] = value + return has + } +} +Caseless.prototype.has = function (name) { + var keys = Object.keys(this.dict) + , name = name.toLowerCase() + ; + for (var i=0;i=0.11.0 <0.12.0", + "_npmVersion": "2.8.3", + "_nodeVersion": "1.8.1", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "dist": { + "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/test.js new file mode 100644 index 00000000..084bbaf5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/caseless/test.js @@ -0,0 +1,40 @@ +var tape = require('tape') + , caseless = require('./') + ; + +tape('set get has', function (t) { + var headers = {} + , c = caseless(headers) + ; + t.plan(17) + c.set('a-Header', 'asdf') + t.equal(c.get('a-header'), 'asdf') + t.equal(c.has('a-header'), 'a-Header') + t.ok(!c.has('nothing')) + // old bug where we used the wrong regex + t.ok(!c.has('a-hea')) + c.set('a-header', 'fdsa') + t.equal(c.get('a-header'), 'fdsa') + t.equal(c.get('a-Header'), 'fdsa') + c.set('a-HEADER', 'more', false) + t.equal(c.get('a-header'), 'fdsa,more') + + t.deepEqual(headers, {'a-Header': 'fdsa,more'}) + c.swap('a-HEADER') + t.deepEqual(headers, {'a-HEADER': 'fdsa,more'}) + + c.set('deleteme', 'foobar') + t.ok(c.has('deleteme')) + t.ok(c.del('deleteme')) + t.notOk(c.has('deleteme')) + t.notOk(c.has('idonotexist')) + t.ok(c.del('idonotexist')) + + c.set('tva', 'test1') + c.set('tva-header', 'test2') + t.equal(c.has('tva'), 'tva') + t.notOk(c.has('header')) + + t.equal(c.get('tva'), 'test1') + +}) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/License b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/License new file mode 100644 index 00000000..4804b7ab --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/Readme.md new file mode 100644 index 00000000..3a9e025f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/Readme.md @@ -0,0 +1,138 @@ +# combined-stream + +A stream that emits multiple other streams one after another. + +**NB** Currently `combined-stream` works with streams vesrion 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatability with `combined-stream`. + +- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module. + +- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another. + +## Installation + +``` bash +npm install combined-stream +``` + +## Usage + +Here is a simple example that shows how you can use combined-stream to combine +two files into one: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +While the example above works great, it will pause all source streams until +they are needed. If you don't want that to happen, you can set `pauseStreams` +to `false`: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create({pauseStreams: false}); +combinedStream.append(fs.createReadStream('file1.txt')); +combinedStream.append(fs.createReadStream('file2.txt')); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +However, what if you don't have all the source streams yet, or you don't want +to allocate the resources (file descriptors, memory, etc.) for them right away? +Well, in that case you can simply provide a callback that supplies the stream +by calling a `next()` function: + +``` javascript +var CombinedStream = require('combined-stream'); +var fs = require('fs'); + +var combinedStream = CombinedStream.create(); +combinedStream.append(function(next) { + next(fs.createReadStream('file1.txt')); +}); +combinedStream.append(function(next) { + next(fs.createReadStream('file2.txt')); +}); + +combinedStream.pipe(fs.createWriteStream('combined.txt')); +``` + +## API + +### CombinedStream.create([options]) + +Returns a new combined stream object. Available options are: + +* `maxDataSize` +* `pauseStreams` + +The effect of those options is described below. + +### combinedStream.pauseStreams = `true` + +Whether to apply back pressure to the underlaying streams. If set to `false`, +the underlaying streams will never be paused. If set to `true`, the +underlaying streams will be paused right after being appended, as well as when +`delayedStream.pipe()` wants to throttle. + +### combinedStream.maxDataSize = `2 * 1024 * 1024` + +The maximum amount of bytes (or characters) to buffer for all source streams. +If this value is exceeded, `combinedStream` emits an `'error'` event. + +### combinedStream.dataSize = `0` + +The amount of bytes (or characters) currently buffered by `combinedStream`. + +### combinedStream.append(stream) + +Appends the given `stream` to the combinedStream object. If `pauseStreams` is +set to `true, this stream will also be paused right away. + +`streams` can also be a function that takes one parameter called `next`. `next` +is a function that must be invoked in order to provide the `next` stream, see +example above. + +Regardless of how the `stream` is appended, combined-stream always attaches an +`'error'` listener to it, so you don't have to do that manually. + +Special case: `stream` can also be a String or Buffer. + +### combinedStream.write(data) + +You should not call this, `combinedStream` takes care of piping the appended +streams into itself for you. + +### combinedStream.resume() + +Causes `combinedStream` to start drain the streams it manages. The function is +idempotent, and also emits a `'resume'` event each time which usually goes to +the stream that is currently being drained. + +### combinedStream.pause(); + +If `combinedStream.pauseStreams` is set to `false`, this does nothing. +Otherwise a `'pause'` event is emitted, this goes to the stream that is +currently being drained, so you can use it to apply back pressure. + +### combinedStream.end(); + +Sets `combinedStream.writable` to false, emits an `'end'` event, and removes +all streams from the queue. + +### combinedStream.destroy(); + +Same as `combinedStream.end()`, except it emits a `'close'` event instead of +`'end'`. + +## License + +combined-stream is licensed under the MIT license. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/lib/combined_stream.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/lib/combined_stream.js new file mode 100644 index 00000000..6b5c21b6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/lib/combined_stream.js @@ -0,0 +1,188 @@ +var util = require('util'); +var Stream = require('stream').Stream; +var DelayedStream = require('delayed-stream'); + +module.exports = CombinedStream; +function CombinedStream() { + this.writable = false; + this.readable = true; + this.dataSize = 0; + this.maxDataSize = 2 * 1024 * 1024; + this.pauseStreams = true; + + this._released = false; + this._streams = []; + this._currentStream = null; +} +util.inherits(CombinedStream, Stream); + +CombinedStream.create = function(options) { + var combinedStream = new this(); + + options = options || {}; + for (var option in options) { + combinedStream[option] = options[option]; + } + + return combinedStream; +}; + +CombinedStream.isStreamLike = function(stream) { + return (typeof stream !== 'function') + && (typeof stream !== 'string') + && (typeof stream !== 'boolean') + && (typeof stream !== 'number') + && (!Buffer.isBuffer(stream)); +}; + +CombinedStream.prototype.append = function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + + if (isStreamLike) { + if (!(stream instanceof DelayedStream)) { + var newStream = DelayedStream.create(stream, { + maxDataSize: Infinity, + pauseStream: this.pauseStreams, + }); + stream.on('data', this._checkDataSize.bind(this)); + stream = newStream; + } + + this._handleErrors(stream); + + if (this.pauseStreams) { + stream.pause(); + } + } + + this._streams.push(stream); + return this; +}; + +CombinedStream.prototype.pipe = function(dest, options) { + Stream.prototype.pipe.call(this, dest, options); + this.resume(); + return dest; +}; + +CombinedStream.prototype._getNext = function() { + this._currentStream = null; + var stream = this._streams.shift(); + + + if (typeof stream == 'undefined') { + this.end(); + return; + } + + if (typeof stream !== 'function') { + this._pipeNext(stream); + return; + } + + var getStream = stream; + getStream(function(stream) { + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('data', this._checkDataSize.bind(this)); + this._handleErrors(stream); + } + + this._pipeNext(stream); + }.bind(this)); +}; + +CombinedStream.prototype._pipeNext = function(stream) { + this._currentStream = stream; + + var isStreamLike = CombinedStream.isStreamLike(stream); + if (isStreamLike) { + stream.on('end', this._getNext.bind(this)); + stream.pipe(this, {end: false}); + return; + } + + var value = stream; + this.write(value); + this._getNext(); +}; + +CombinedStream.prototype._handleErrors = function(stream) { + var self = this; + stream.on('error', function(err) { + self._emitError(err); + }); +}; + +CombinedStream.prototype.write = function(data) { + this.emit('data', data); +}; + +CombinedStream.prototype.pause = function() { + if (!this.pauseStreams) { + return; + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause(); + this.emit('pause'); +}; + +CombinedStream.prototype.resume = function() { + if (!this._released) { + this._released = true; + this.writable = true; + this._getNext(); + } + + if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume(); + this.emit('resume'); +}; + +CombinedStream.prototype.end = function() { + this._reset(); + this.emit('end'); +}; + +CombinedStream.prototype.destroy = function() { + this._reset(); + this.emit('close'); +}; + +CombinedStream.prototype._reset = function() { + this.writable = false; + this._streams = []; + this._currentStream = null; +}; + +CombinedStream.prototype._checkDataSize = function() { + this._updateDataSize(); + if (this.dataSize <= this.maxDataSize) { + return; + } + + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'; + this._emitError(new Error(message)); +}; + +CombinedStream.prototype._updateDataSize = function() { + this.dataSize = 0; + + var self = this; + this._streams.forEach(function(stream) { + if (!stream.dataSize) { + return; + } + + self.dataSize += stream.dataSize; + }); + + if (this._currentStream && this._currentStream.dataSize) { + this.dataSize += this._currentStream.dataSize; + } +}; + +CombinedStream.prototype._emitError = function(err) { + this._reset(); + this.emit('error', err); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore new file mode 100644 index 00000000..9daeafb9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/.npmignore @@ -0,0 +1 @@ +test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License new file mode 100644 index 00000000..4804b7ab --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/License @@ -0,0 +1,19 @@ +Copyright (c) 2011 Debuggable Limited + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile new file mode 100644 index 00000000..b4ff85a3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile @@ -0,0 +1,7 @@ +SHELL := /bin/bash + +test: + @./test/run.js + +.PHONY: test + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md new file mode 100644 index 00000000..aca36f9f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Readme.md @@ -0,0 +1,141 @@ +# delayed-stream + +Buffers events from a stream until you are ready to handle them. + +## Installation + +``` bash +npm install delayed-stream +``` + +## Usage + +The following example shows how to write a http echo server that delays its +response by 1000 ms. + +``` javascript +var DelayedStream = require('delayed-stream'); +var http = require('http'); + +http.createServer(function(req, res) { + var delayed = DelayedStream.create(req); + + setTimeout(function() { + res.writeHead(200); + delayed.pipe(res); + }, 1000); +}); +``` + +If you are not using `Stream#pipe`, you can also manually release the buffered +events by calling `delayedStream.resume()`: + +``` javascript +var delayed = DelayedStream.create(req); + +setTimeout(function() { + // Emit all buffered events and resume underlaying source + delayed.resume(); +}, 1000); +``` + +## Implementation + +In order to use this meta stream properly, here are a few things you should +know about the implementation. + +### Event Buffering / Proxying + +All events of the `source` stream are hijacked by overwriting the `source.emit` +method. Until node implements a catch-all event listener, this is the only way. + +However, delayed-stream still continues to emit all events it captures on the +`source`, regardless of whether you have released the delayed stream yet or +not. + +Upon creation, delayed-stream captures all `source` events and stores them in +an internal event buffer. Once `delayedStream.release()` is called, all +buffered events are emitted on the `delayedStream`, and the event buffer is +cleared. After that, delayed-stream merely acts as a proxy for the underlaying +source. + +### Error handling + +Error events on `source` are buffered / proxied just like any other events. +However, `delayedStream.create` attaches a no-op `'error'` listener to the +`source`. This way you only have to handle errors on the `delayedStream` +object, rather than in two places. + +### Buffer limits + +delayed-stream provides a `maxDataSize` property that can be used to limit +the amount of data being buffered. In order to protect you from bad `source` +streams that don't react to `source.pause()`, this feature is enabled by +default. + +## API + +### DelayedStream.create(source, [options]) + +Returns a new `delayedStream`. Available options are: + +* `pauseStream` +* `maxDataSize` + +The description for those properties can be found below. + +### delayedStream.source + +The `source` stream managed by this object. This is useful if you are +passing your `delayedStream` around, and you still want to access properties +on the `source` object. + +### delayedStream.pauseStream = true + +Whether to pause the underlaying `source` when calling +`DelayedStream.create()`. Modifying this property afterwards has no effect. + +### delayedStream.maxDataSize = 1024 * 1024 + +The amount of data to buffer before emitting an `error`. + +If the underlaying source is emitting `Buffer` objects, the `maxDataSize` +refers to bytes. + +If the underlaying source is emitting JavaScript strings, the size refers to +characters. + +If you know what you are doing, you can set this property to `Infinity` to +disable this feature. You can also modify this property during runtime. + +### delayedStream.dataSize = 0 + +The amount of data buffered so far. + +### delayedStream.readable + +An ECMA5 getter that returns the value of `source.readable`. + +### delayedStream.resume() + +If the `delayedStream` has not been released so far, `delayedStream.release()` +is called. + +In either case, `source.resume()` is called. + +### delayedStream.pause() + +Calls `source.pause()`. + +### delayedStream.pipe(dest) + +Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`. + +### delayedStream.release() + +Emits and clears all events that have been buffered up so far. This does not +resume the underlaying source, use `delayedStream.resume()` instead. + +## License + +delayed-stream is licensed under the MIT license. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js new file mode 100644 index 00000000..b38fc85f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js @@ -0,0 +1,107 @@ +var Stream = require('stream').Stream; +var util = require('util'); + +module.exports = DelayedStream; +function DelayedStream() { + this.source = null; + this.dataSize = 0; + this.maxDataSize = 1024 * 1024; + this.pauseStream = true; + + this._maxDataSizeExceeded = false; + this._released = false; + this._bufferedEvents = []; +} +util.inherits(DelayedStream, Stream); + +DelayedStream.create = function(source, options) { + var delayedStream = new this(); + + options = options || {}; + for (var option in options) { + delayedStream[option] = options[option]; + } + + delayedStream.source = source; + + var realEmit = source.emit; + source.emit = function() { + delayedStream._handleEmit(arguments); + return realEmit.apply(source, arguments); + }; + + source.on('error', function() {}); + if (delayedStream.pauseStream) { + source.pause(); + } + + return delayedStream; +}; + +Object.defineProperty(DelayedStream.prototype, 'readable', { + configurable: true, + enumerable: true, + get: function() { + return this.source.readable; + } +}); + +DelayedStream.prototype.setEncoding = function() { + return this.source.setEncoding.apply(this.source, arguments); +}; + +DelayedStream.prototype.resume = function() { + if (!this._released) { + this.release(); + } + + this.source.resume(); +}; + +DelayedStream.prototype.pause = function() { + this.source.pause(); +}; + +DelayedStream.prototype.release = function() { + this._released = true; + + this._bufferedEvents.forEach(function(args) { + this.emit.apply(this, args); + }.bind(this)); + this._bufferedEvents = []; +}; + +DelayedStream.prototype.pipe = function() { + var r = Stream.prototype.pipe.apply(this, arguments); + this.resume(); + return r; +}; + +DelayedStream.prototype._handleEmit = function(args) { + if (this._released) { + this.emit.apply(this, args); + return; + } + + if (args[0] === 'data') { + this.dataSize += args[1].length; + this._checkIfMaxDataSizeExceeded(); + } + + this._bufferedEvents.push(args); +}; + +DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() { + if (this._maxDataSizeExceeded) { + return; + } + + if (this.dataSize <= this.maxDataSize) { + return; + } + + this._maxDataSizeExceeded = true; + var message = + 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.' + this.emit('error', new Error(message)); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json new file mode 100644 index 00000000..8ac66b81 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json @@ -0,0 +1,64 @@ +{ + "author": { + "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", + "url": "http://debuggable.com/" + }, + "contributors": [ + { + "name": "Mike Atkins", + "email": "apeherder@gmail.com" + } + ], + "name": "delayed-stream", + "description": "Buffers events from a stream until you are ready to handle them.", + "license": "MIT", + "version": "1.0.0", + "homepage": "https://github.com/felixge/node-delayed-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-delayed-stream.git" + }, + "main": "./lib/delayed_stream", + "engines": { + "node": ">=0.4.0" + }, + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "fake": "0.2.0", + "far": "0.0.1" + }, + "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84", + "bugs": { + "url": "https://github.com/felixge/node-delayed-stream/issues" + }, + "_id": "delayed-stream@1.0.0", + "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", + "_from": "delayed-stream@>=1.0.0 <1.1.0", + "_npmVersion": "2.8.3", + "_nodeVersion": "1.6.4", + "_npmUser": { + "name": "apechimp", + "email": "apeherder@gmail.com" + }, + "dist": { + "shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", + "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + }, + { + "name": "apechimp", + "email": "apeherder@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/package.json new file mode 100644 index 00000000..e0cd160f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/combined-stream/package.json @@ -0,0 +1,67 @@ +{ + "author": { + "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", + "url": "http://debuggable.com/" + }, + "name": "combined-stream", + "description": "A stream that emits multiple other streams one after another.", + "version": "1.0.5", + "homepage": "https://github.com/felixge/node-combined-stream", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "main": "./lib/combined_stream", + "scripts": { + "test": "node test/run.js" + }, + "engines": { + "node": ">= 0.8" + }, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "devDependencies": { + "far": "~0.0.7" + }, + "license": "MIT", + "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7", + "bugs": { + "url": "https://github.com/felixge/node-combined-stream/issues" + }, + "_id": "combined-stream@1.0.5", + "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "_from": "combined-stream@>=1.0.5 <1.1.0", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + "dist": { + "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, + "maintainers": [ + { + "name": "felixge", + "email": "felix@debuggable.com" + }, + { + "name": "celer", + "email": "dtyree77@gmail.com" + }, + { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + { + "name": "apechimp", + "email": "apeherder@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.eslintrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.eslintrc new file mode 100644 index 00000000..d49f1735 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.eslintrc @@ -0,0 +1,192 @@ +{ + "env": { + "browser": false, + "node": true, + "amd": false, + "mocha": false, + "jasmine": false + }, + + "rules": { + "accessor-pairs": [2, { getWithoutSet: false, setWithoutGet: true }], + "array-bracket-spacing": [2, "never", { + "singleValue": false, + "objectsInArrays": false, + "arraysInArrays": false + }], + "block-scoped-var": [0], + "brace-style": [2, "1tbs", { "allowSingleLine": true }], + "camelcase": [2], + "comma-dangle": [2, "never"], + "comma-spacing": [2], + "comma-style": [2, "last"], + "complexity": [2, 15], + "computed-property-spacing": [2, "never"], + "consistent-return": [2], + "consistent-this": [0, "that"], + "constructor-super": [2], + "curly": [2, "all"], + "default-case": [2], + "dot-notation": [2, { "allowKeywords": true }], + "eol-last": [2], + "eqeqeq": [2], + "func-names": [0], + "func-style": [2, "expression"], + "generator-star-spacing": [2, { "before": false, "after": true }], + "global-strict": [0, "never"], + "guard-for-in": [0], + "handle-callback-err": [0], + "key-spacing": [2, { "beforeColon": false, "afterColon": true }], + "linebreak-style": [2, "unix"], + "lines-around-comment": [2, { + "beforeBlockComment": false, + "afterBlockComment": false, + "beforeLineComment": false, + "beforeLineComment": false, + "allowBlockStart": true, + "allowBlockEnd": true + }], + "quotes": [2, "single", "avoid-escape"], + "max-depth": [1, 4], + "max-len": [0, 80, 4], + "max-nested-callbacks": [2, 2], + "max-params": [2, 2], + "max-statements": [2, 21], + "new-parens": [2], + "new-cap": [2], + "newline-after-var": [0], + "no-alert": [2], + "no-array-constructor": [2], + "no-bitwise": [0], + "no-caller": [2], + "no-catch-shadow": [2], + "no-cond-assign": [2], + "no-console": [2], + "no-constant-condition": [2], + "no-continue": [2], + "no-control-regex": [2], + "no-debugger": [2], + "no-delete-var": [2], + "no-div-regex": [0], + "no-dupe-args": [2], + "no-dupe-keys": [2], + "no-duplicate-case": [2], + "no-else-return": [0], + "no-empty": [2], + "no-empty-character-class": [2], + "no-empty-label": [2], + "no-eq-null": [0], + "no-eval": [2], + "no-ex-assign": [2], + "no-extend-native": [2], + "no-extra-bind": [2], + "no-extra-boolean-cast": [2], + "no-extra-parens": [0], + "no-extra-semi": [2], + "no-fallthrough": [2], + "no-floating-decimal": [2], + "no-func-assign": [2], + "no-implied-eval": [2], + "no-inline-comments": [0], + "no-inner-declarations": [2, "functions"], + "no-invalid-regexp": [2], + "no-irregular-whitespace": [2], + "no-iterator": [2], + "no-label-var": [2], + "no-labels": [2], + "no-lone-blocks": [2], + "no-lonely-if": [2], + "no-loop-func": [2], + "no-mixed-requires": [0, false], + "no-mixed-spaces-and-tabs": [2, false], + "no-multi-spaces": [2], + "no-multi-str": [2], + "no-multiple-empty-lines": [2, {"max": 1}], + "no-native-reassign": [2], + "no-negated-in-lhs": [2], + "no-nested-ternary": [0], + "no-new": [2], + "no-new-func": [2], + "no-new-object": [2], + "no-new-require": [0], + "no-new-wrappers": [2], + "no-obj-calls": [2], + "no-octal": [2], + "no-octal-escape": [2], + "no-param-reassign": [2], + "no-path-concat": [0], + "no-plusplus": [0], + "no-process-env": [0], + "no-process-exit": [2], + "no-proto": [2], + "no-redeclare": [2], + "no-regex-spaces": [2], + "no-reserved-keys": [2], + "no-restricted-modules": [0], + "no-return-assign": [2, "always"], + "no-script-url": [2], + "no-self-compare": [0], + "no-sequences": [2], + "no-shadow": [2], + "no-shadow-restricted-names": [2], + "no-space-before-semi": [2], + "no-spaced-func": [2], + "no-sparse-arrays": [2], + "no-sync": [0], + "no-ternary": [0], + "no-this-before-super": [2], + "no-throw-literal": [2], + "no-trailing-spaces": [2, { "skipBlankLines": false }], + "no-undef": [2], + "no-undef-init": [2], + "no-undefined": [0], + "no-underscore-dangle": [2], + "no-unexpected-multiline": [2], + "no-unneeded-ternary": [2], + "no-unreachable": [2], + "no-unused-expressions": [2], + "no-unused-vars": [2, { "vars": "all", "args": "after-used" }], + "no-use-before-define": [2], + "no-void": [0], + "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }], + "no-with": [2], + "no-wrap-func": [2], + "object-curly-spacing": [2, "always"], + "object-shorthand": [2, "never"], + "one-var": [0], + "operator-assignment": [0, "always"], + "operator-linebreak": [2, "none"], + "padded-blocks": [0], + "prefer-const": [0], + "quote-props": [0], + "radix": [0], + "semi": [2], + "semi-spacing": [2, { "before": false, "after": true }], + "sort-vars": [0], + "space-after-keywords": [2, "always"], + "space-before-function-paren": [2, { "anonymous": "always", "named": "never" }], + "space-before-blocks": [0, "always"], + "space-in-brackets": [0, "never", { + "singleValue": true, + "arraysInArrays": false, + "arraysInObjects": false, + "objectsInArrays": true, + "objectsInObjects": true, + "propertyName": false + }], + "space-in-parens": [2, "never"], + "space-infix-ops": [2], + "space-return-throw-case": [2], + "space-unary-ops": [2, { "words": true, "nonwords": false }], + "spaced-comment": [2, "always"], + "spaced-line-comment": [0, "always"], + "strict": [2, "global"], + "use-isnan": [2], + "valid-jsdoc": [0], + "valid-typeof": [2], + "vars-on-top": [0], + "wrap-iife": [2], + "wrap-regex": [2], + "yoda": [2, "never", { "exceptRange": true, "onlyEquality": false }] + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.jscs.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.jscs.json new file mode 100644 index 00000000..7e84b282 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.jscs.json @@ -0,0 +1,104 @@ +{ + "additionalRules": [], + + "requireSemicolons": true, + + "disallowMultipleSpaces": true, + + "disallowIdentifierNames": [], + + "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"], + + "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"], + + "disallowSpaceAfterKeywords": [], + + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true }, + "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, + "disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true }, + + "requireSpaceBetweenArguments": true, + + "disallowSpacesInsideParentheses": true, + + "disallowSpacesInsideArrayBrackets": true, + + "disallowQuotedKeysInObjects": "allButReserved", + + "disallowSpaceAfterObjectKeys": true, + + "requireCommaBeforeLineBreak": true, + + "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], + "requireSpaceAfterPrefixUnaryOperators": [], + + "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "requireSpaceBeforePostfixUnaryOperators": [], + + "disallowSpaceBeforeBinaryOperators": [], + "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + + "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterBinaryOperators": [], + + "disallowImplicitTypeConversion": ["binary", "string"], + + "disallowKeywords": ["with", "eval"], + + "requireKeywordsOnNewLine": [], + "disallowKeywordsOnNewLine": ["else"], + + "requireLineFeedAtFileEnd": true, + + "disallowTrailingWhitespace": true, + + "disallowTrailingComma": true, + + "excludeFiles": ["node_modules/**", "vendor/**"], + + "disallowMultipleLineStrings": true, + + "requireDotNotation": true, + + "requireParenthesesAroundIIFE": true, + + "validateLineBreaks": "LF", + + "validateQuoteMarks": { + "escape": true, + "mark": "'" + }, + + "disallowOperatorBeforeLineBreak": [], + + "requireSpaceBeforeKeywords": [ + "do", + "for", + "if", + "else", + "switch", + "case", + "try", + "catch", + "finally", + "while", + "with", + "return" + ], + + "validateAlignedFunctionParameters": { + "lineBreakAfterOpeningBraces": true, + "lineBreakBeforeClosingBraces": true + }, + + "requirePaddingNewLinesBeforeExport": true, + + "validateNewlineAfterArrayElements": { + "maximum": 6 + }, + + "requirePaddingNewLinesAfterUseStrict": true +} + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.npmignore new file mode 100644 index 00000000..30d74d25 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.npmignore @@ -0,0 +1 @@ +test \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.travis.yml new file mode 100644 index 00000000..ebef6449 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/.travis.yml @@ -0,0 +1,44 @@ +language: node_js +node_js: + - "iojs-v2.3" + - "iojs-v2.2" + - "iojs-v2.1" + - "iojs-v2.0" + - "iojs-v1.8" + - "iojs-v1.7" + - "iojs-v1.6" + - "iojs-v1.5" + - "iojs-v1.4" + - "iojs-v1.3" + - "iojs-v1.2" + - "iojs-v1.1" + - "iojs-v1.0" + - "0.12" + - "0.11" + - "0.10" + - "0.9" + - "0.8" + - "0.6" + - "0.4" +before_install: + - '[ "${TRAVIS_NODE_VERSION}" = "0.6" ] || npm install -g npm@1.4.28 && npm install -g npm' +sudo: false +matrix: + fast_finish: true + allow_failures: + - node_js: "iojs-v2.2" + - node_js: "iojs-v2.1" + - node_js: "iojs-v2.0" + - node_js: "iojs-v1.7" + - node_js: "iojs-v1.6" + - node_js: "iojs-v1.5" + - node_js: "iojs-v1.4" + - node_js: "iojs-v1.3" + - node_js: "iojs-v1.2" + - node_js: "iojs-v1.1" + - node_js: "iojs-v1.0" + - node_js: "0.11" + - node_js: "0.9" + - node_js: "0.8" + - node_js: "0.6" + - node_js: "0.4" diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/CHANGELOG.md new file mode 100644 index 00000000..ee0cfd6a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/CHANGELOG.md @@ -0,0 +1,69 @@ +3.0.0 / 2015-07-01 +================== + * [Possible breaking change] Use global "strict" directive (#32) + * [Tests] `int` is an ES3 reserved word + * [Tests] Test up to `io.js` `v2.3` + * [Tests] Add `npm run eslint` + * [Dev Deps] Update `covert`, `jscs` + +2.0.1 / 2015-04-25 +================== + * Use an inline `isArray` check, for ES3 browsers. (#27) + * Some old browsers fail when an identifier is `toString` + * Test latest `node` and `io.js` versions on `travis-ci`; speed up builds + * Add license info to package.json (#25) + * Update `tape`, `jscs` + * Adding a CHANGELOG + +2.0.0 / 2014-10-01 +================== + * Increase code coverage to 100%; run code coverage as part of tests + * Add `npm run lint`; Run linter as part of tests + * Remove nodeType and setInterval checks in isPlainObject + * Updating `tape`, `jscs`, `covert` + * General style and README cleanup + +1.3.0 / 2014-06-20 +================== + * Add component.json for browser support (#18) + * Use SVG for badges in README (#16) + * Updating `tape`, `covert` + * Updating travis-ci to work with multiple node versions + * Fix `deep === false` bug (returning target as {}) (#14) + * Fixing constructor checks in isPlainObject + * Adding additional test coverage + * Adding `npm run coverage` + * Add LICENSE (#13) + * Adding a warning about `false`, per #11 + * General style and whitespace cleanup + +1.2.1 / 2013-09-14 +================== + * Fixing hasOwnProperty bugs that would only have shown up in specific browsers. Fixes #8 + * Updating `tape` + +1.2.0 / 2013-09-02 +================== + * Updating the README: add badges + * Adding a missing variable reference. + * Using `tape` instead of `buster` for tests; add more tests (#7) + * Adding node 0.10 to Travis CI (#6) + * Enabling "npm test" and cleaning up package.json (#5) + * Add Travis CI. + +1.1.3 / 2012-12-06 +================== + * Added unit tests. + * Ensure extend function is named. (Looks nicer in a stack trace.) + * README cleanup. + +1.1.1 / 2012-11-07 +================== + * README cleanup. + * Added installation instructions. + * Added a missing semicolon + +1.0.0 / 2012-04-08 +================== + * Initial commit + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/LICENSE new file mode 100644 index 00000000..e16d6a56 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/LICENSE @@ -0,0 +1,23 @@ +The MIT License (MIT) + +Copyright (c) 2014 Stefan Thomas + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/README.md new file mode 100644 index 00000000..632fb0f9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/README.md @@ -0,0 +1,62 @@ +[![Build Status][travis-svg]][travis-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] + +# extend() for Node.js [![Version Badge][npm-version-png]][npm-url] + +`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true. + +## Installation + +This package is available on [npm][npm-url] as: `extend` + +``` sh +npm install extend +``` + +## Usage + +**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)** + +*Extend one object with one or more others, returning the modified object.* + +Keep in mind that the target object will be modified, and will be returned from extend(). + +If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). +Undefined properties are not copied. However, properties inherited from the object's prototype will be copied over. +Warning: passing `false` as the first argument is not supported. + +### Arguments + +* `deep` *Boolean* (optional) +If set, the merge becomes recursive (i.e. deep copy). +* `target` *Object* +The object to extend. +* `object1` *Object* +The object that will be merged into the first. +* `objectN` *Object* (Optional) +More objects to merge into the first. + +## License + +`node-extend` is licensed under the [MIT License][mit-license-url]. + +## Acknowledgements + +All credit to the jQuery authors for perfecting this amazing utility. + +Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb]. + +[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg +[travis-url]: https://travis-ci.org/justmoon/node-extend +[npm-url]: https://npmjs.org/package/extend +[mit-license-url]: http://opensource.org/licenses/MIT +[github-justmoon]: https://github.com/justmoon +[github-insin]: https://github.com/insin +[github-ljharb]: https://github.com/ljharb +[npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg +[deps-svg]: https://david-dm.org/justmoon/node-extend.svg +[deps-url]: https://david-dm.org/justmoon/node-extend +[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg +[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/component.json new file mode 100644 index 00000000..1500a2f3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/component.json @@ -0,0 +1,32 @@ +{ + "name": "extend", + "author": "Stefan Thomas (http://www.justmoon.net)", + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser.", + "scripts": [ + "index.js" + ], + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository" : { + "type": "git", + "url": "https://github.com/justmoon/node-extend.git" + }, + "dependencies": { + }, + "devDependencies": { + "tape" : "~3.0.0", + "covert": "~0.4.0", + "jscs": "~1.6.2" + } +} + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/index.js new file mode 100644 index 00000000..f5ec75d5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/index.js @@ -0,0 +1,86 @@ +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) {/**/} + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0], + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } else if ((typeof target !== 'object' && typeof target !== 'function') || target == null) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/package.json new file mode 100644 index 00000000..c8c7cac9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/extend/package.json @@ -0,0 +1,73 @@ +{ + "name": "extend", + "author": { + "name": "Stefan Thomas", + "email": "justmoon@members.fsf.org", + "url": "http://www.justmoon.net" + }, + "version": "3.0.0", + "description": "Port of jQuery.extend for node.js and the browser", + "main": "index", + "scripts": { + "test": "npm run lint && node test/index.js && npm run coverage-quiet", + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "lint": "npm run jscs && npm run eslint", + "jscs": "jscs *.js */*.js", + "eslint": "eslint *.js */*.js" + }, + "contributors": [ + { + "name": "Jordan Harband", + "url": "https://github.com/ljharb" + } + ], + "keywords": [ + "extend", + "clone", + "merge" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "dependencies": {}, + "devDependencies": { + "tape": "^4.0.0", + "covert": "^1.1.0", + "jscs": "^1.13.1", + "eslint": "^0.24.0" + }, + "license": "MIT", + "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d", + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" + }, + "homepage": "https://github.com/justmoon/node-extend#readme", + "_id": "extend@3.0.0", + "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", + "_from": "extend@>=3.0.0 <3.1.0", + "_npmVersion": "2.11.3", + "_nodeVersion": "2.3.1", + "_npmUser": { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + "dist": { + "shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", + "tarball": "http://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + }, + "maintainers": [ + { + "name": "justmoon", + "email": "justmoon@members.fsf.org" + }, + { + "name": "ljharb", + "email": "ljharb@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/README.md new file mode 100644 index 00000000..9d5b6634 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/README.md @@ -0,0 +1,4 @@ +forever-agent +============= + +HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/index.js new file mode 100644 index 00000000..416c7abd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/index.js @@ -0,0 +1,138 @@ +module.exports = ForeverAgent +ForeverAgent.SSL = ForeverAgentSSL + +var util = require('util') + , Agent = require('http').Agent + , net = require('net') + , tls = require('tls') + , AgentSSL = require('https').Agent + +function getConnectionName(host, port) { + var name = '' + if (typeof host === 'string') { + name = host + ':' + port + } else { + // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name. + name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') + } + return name +} + +function ForeverAgent(options) { + var self = this + self.options = options || {} + self.requests = {} + self.sockets = {} + self.freeSockets = {} + self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets + self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets + self.on('free', function(socket, host, port) { + var name = getConnectionName(host, port) + + if (self.requests[name] && self.requests[name].length) { + self.requests[name].shift().onSocket(socket) + } else if (self.sockets[name].length < self.minSockets) { + if (!self.freeSockets[name]) self.freeSockets[name] = [] + self.freeSockets[name].push(socket) + + // if an error happens while we don't use the socket anyway, meh, throw the socket away + var onIdleError = function() { + socket.destroy() + } + socket._onIdleError = onIdleError + socket.on('error', onIdleError) + } else { + // If there are no pending requests just destroy the + // socket and it will get removed from the pool. This + // gets us out of timeout issues and allows us to + // default to Connection:keep-alive. + socket.destroy() + } + }) + +} +util.inherits(ForeverAgent, Agent) + +ForeverAgent.defaultMinSockets = 5 + + +ForeverAgent.prototype.createConnection = net.createConnection +ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest +ForeverAgent.prototype.addRequest = function(req, host, port) { + var name = getConnectionName(host, port) + + if (typeof host !== 'string') { + var options = host + port = options.port + host = options.host + } + + if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) { + var idleSocket = this.freeSockets[name].pop() + idleSocket.removeListener('error', idleSocket._onIdleError) + delete idleSocket._onIdleError + req._reusedSocket = true + req.onSocket(idleSocket) + } else { + this.addRequestNoreuse(req, host, port) + } +} + +ForeverAgent.prototype.removeSocket = function(s, name, host, port) { + if (this.sockets[name]) { + var index = this.sockets[name].indexOf(s) + if (index !== -1) { + this.sockets[name].splice(index, 1) + } + } else if (this.sockets[name] && this.sockets[name].length === 0) { + // don't leak + delete this.sockets[name] + delete this.requests[name] + } + + if (this.freeSockets[name]) { + var index = this.freeSockets[name].indexOf(s) + if (index !== -1) { + this.freeSockets[name].splice(index, 1) + if (this.freeSockets[name].length === 0) { + delete this.freeSockets[name] + } + } + } + + if (this.requests[name] && this.requests[name].length) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createSocket(name, host, port).emit('free') + } +} + +function ForeverAgentSSL (options) { + ForeverAgent.call(this, options) +} +util.inherits(ForeverAgentSSL, ForeverAgent) + +ForeverAgentSSL.prototype.createConnection = createConnectionSSL +ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest + +function createConnectionSSL (port, host, options) { + if (typeof port === 'object') { + options = port; + } else if (typeof host === 'object') { + options = host; + } else if (typeof options === 'object') { + options = options; + } else { + options = {}; + } + + if (typeof port === 'number') { + options.port = port; + } + + if (typeof host === 'string') { + options.host = host; + } + + return tls.connect(options); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/package.json new file mode 100644 index 00000000..f57036b5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/forever-agent/package.json @@ -0,0 +1,56 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "forever-agent", + "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", + "version": "0.6.1", + "license": "Apache-2.0", + "repository": { + "url": "git+https://github.com/mikeal/forever-agent.git" + }, + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d", + "bugs": { + "url": "https://github.com/mikeal/forever-agent/issues" + }, + "homepage": "https://github.com/mikeal/forever-agent", + "_id": "forever-agent@0.6.1", + "scripts": {}, + "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "_from": "forever-agent@>=0.6.1 <0.7.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "dist": { + "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/License b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/License new file mode 100644 index 00000000..c7ff12a2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/License @@ -0,0 +1,19 @@ +Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors + + 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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/Readme.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/Readme.md new file mode 100644 index 00000000..49277323 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/Readme.md @@ -0,0 +1,210 @@ +# Form-Data [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) [![Build Status](https://img.shields.io/travis/form-data/form-data/master.svg)](https://travis-ci.org/form-data/form-data) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) + +A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. + +The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. + +[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface +[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions + +## Install + +``` +npm install form-data +``` + +## Usage + +In this example we are constructing a form with 3 fields that contain a string, +a buffer and a file stream. + +``` javascript +var FormData = require('form-data'); +var fs = require('fs'); + +var form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +``` + +Also you can use http-response stream: + +``` javascript +var FormData = require('form-data'); +var http = require('http'); + +var form = new FormData(); + +http.request('http://nodejs.org/images/logo.png', function(response) { + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', response); +}); +``` + +Or @mikeal's [request](https://github.com/request/request) stream: + +``` javascript +var FormData = require('form-data'); +var request = require('request'); + +var form = new FormData(); + +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_logo', request('http://nodejs.org/images/logo.png')); +``` + +In order to submit this form to a web application, call ```submit(url, [callback])``` method: + +``` javascript +form.submit('http://example.org/', function(err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +}); + +``` + +For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. + +### Alternative submission methods + +You can use node's http client interface: + +``` javascript +var http = require('http'); + +var request = http.request({ + method: 'post', + host: 'example.org', + path: '/upload', + headers: form.getHeaders() +}); + +form.pipe(request); + +request.on('response', function(res) { + console.log(res.statusCode); +}); +``` + +Or if you would prefer the `'Content-Length'` header to be set for you: + +``` javascript +form.submit('example.org/upload', function(err, res) { + console.log(res.statusCode); +}); +``` + +To use custom headers and pre-known length in parts: + +``` javascript +var CRLF = '\r\n'; +var form = new FormData(); + +var options = { + header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, + knownLength: 1 +}; + +form.append('my_buffer', buffer, options); + +form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); +}); +``` + +Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: + +``` javascript +someModule.stream(function(err, stdout, stderr) { + if (err) throw err; + + var form = new FormData(); + + form.append('file', stdout, { + filename: 'unicycle.jpg', + contentType: 'image/jpg', + knownLength: 19806 + }); + + form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); + }); +}); +``` + +For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: + +``` javascript +form.submit({ + host: 'example.com', + path: '/probably.php?extra=params', + auth: 'username:password' +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: + +``` javascript +form.submit({ + host: 'example.com', + path: '/surelynot.php', + headers: {'x-test-header': 'test-header-value'} +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +### Integration with other libraries + +#### Request + +Form submission using [request](https://github.com/request/request): + +```javascript +var formData = { + my_field: 'my_value', + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), +}; + +request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads). + +#### node-fetch + +You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch): + +```javascript +var form = new FormData(); + +form.append('a', 1); + +fetch('http://example.com', { method: 'POST', body: form }) + .then(function(res) { + return res.json(); + }).then(function(json) { + console.log(json); + }); +``` + +## Notes + +- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. +- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing] + +## License + +Form-Data is licensed under the MIT license. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/lib/browser.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/lib/browser.js new file mode 100644 index 00000000..1e7717d5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/lib/browser.js @@ -0,0 +1 @@ +module.exports = FormData; \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/lib/form_data.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/lib/form_data.js new file mode 100644 index 00000000..524f392b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/lib/form_data.js @@ -0,0 +1,374 @@ +var CombinedStream = require('combined-stream'); +var util = require('util'); +var path = require('path'); +var http = require('http'); +var https = require('https'); +var parseUrl = require('url').parse; +var fs = require('fs'); +var mime = require('mime-types'); +var async = require('async'); + +module.exports = FormData; +function FormData() { + this._overheadLength = 0; + this._valueLength = 0; + this._lengthRetrievers = []; + + CombinedStream.call(this); +} +util.inherits(FormData, CombinedStream); + +FormData.LINE_BREAK = '\r\n'; +FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + +FormData.prototype.append = function(field, value, options) { + options = (typeof options === 'string') + ? { filename: options } + : options || {}; + + var append = CombinedStream.prototype.append.bind(this); + + // all that streamy business can't handle numbers + if (typeof value == 'number') value = ''+value; + + // https://github.com/felixge/node-form-data/issues/38 + if (util.isArray(value)) { + // Please convert your array into string + // the way web server expects it + this._error(new Error('Arrays are not supported.')); + return; + } + + var header = this._multiPartHeader(field, value, options); + var footer = this._multiPartFooter(field, value, options); + + append(header); + append(value); + append(footer); + + // pass along options.knownLength + this._trackLength(header, value, options); +}; + +FormData.prototype._trackLength = function(header, value, options) { + var valueLength = 0; + + // used w/ getLengthSync(), when length is known. + // e.g. for streaming directly from a remote server, + // w/ a known file a size, and not wanting to wait for + // incoming file to finish to get its size. + if (options.knownLength != null) { + valueLength += +options.knownLength; + } else if (Buffer.isBuffer(value)) { + valueLength = value.length; + } else if (typeof value === 'string') { + valueLength = Buffer.byteLength(value); + } + + this._valueLength += valueLength; + + // @check why add CRLF? does this account for custom/multiple CRLFs? + this._overheadLength += + Buffer.byteLength(header) + + FormData.LINE_BREAK.length; + + // empty or either doesn't have path or not an http response + if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) { + return; + } + + // no need to bother with the length + if (!options.knownLength) + this._lengthRetrievers.push(function(next) { + + if (value.hasOwnProperty('fd')) { + + // take read range into a account + // `end` = Infinity –> read file till the end + // + // TODO: Looks like there is bug in Node fs.createReadStream + // it doesn't respect `end` options without `start` options + // Fix it when node fixes it. + // https://github.com/joyent/node/issues/7819 + if (value.end != undefined && value.end != Infinity && value.start != undefined) { + + // when end specified + // no need to calculate range + // inclusive, starts with 0 + next(null, value.end+1 - (value.start ? value.start : 0)); + + // not that fast snoopy + } else { + // still need to fetch file size from fs + fs.stat(value.path, function(err, stat) { + + var fileSize; + + if (err) { + next(err); + return; + } + + // update final size based on the range options + fileSize = stat.size - (value.start ? value.start : 0); + next(null, fileSize); + }); + } + + // or http response + } else if (value.hasOwnProperty('httpVersion')) { + next(null, +value.headers['content-length']); + + // or request stream http://github.com/mikeal/request + } else if (value.hasOwnProperty('httpModule')) { + // wait till response come back + value.on('response', function(response) { + value.pause(); + next(null, +response.headers['content-length']); + }); + value.resume(); + + // something else + } else { + next('Unknown stream'); + } + }); +}; + +FormData.prototype._multiPartHeader = function(field, value, options) { + // custom header specified (as string)? + // it becomes responsible for boundary + // (e.g. to handle extra CRLFs on .NET servers) + if (options.header != null) { + return options.header; + } + + var contents = ''; + var headers = { + 'Content-Disposition': ['form-data', 'name="' + field + '"'], + 'Content-Type': [] + }; + + // fs- and request- streams have path property + // or use custom filename and/or contentType + // TODO: Use request's response mime-type + if (options.filename || value.path) { + headers['Content-Disposition'].push( + 'filename="' + path.basename(options.filename || value.path) + '"' + ); + headers['Content-Type'].push( + options.contentType || + mime.lookup(options.filename || value.path) || + FormData.DEFAULT_CONTENT_TYPE + ); + // http response has not + } else if (value.readable && value.hasOwnProperty('httpVersion')) { + headers['Content-Disposition'].push( + 'filename="' + path.basename(value.client._httpMessage.path) + '"' + ); + headers['Content-Type'].push( + options.contentType || + value.headers['content-type'] || + FormData.DEFAULT_CONTENT_TYPE + ); + } else if (Buffer.isBuffer(value)) { + headers['Content-Type'].push( + options.contentType || + FormData.DEFAULT_CONTENT_TYPE + ); + } else if (options.contentType) { + headers['Content-Type'].push(options.contentType); + } + + for (var prop in headers) { + if (headers[prop].length) { + contents += prop + ': ' + headers[prop].join('; ') + FormData.LINE_BREAK; + } + } + + return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK; +}; + +FormData.prototype._multiPartFooter = function(field, value, options) { + return function(next) { + var footer = FormData.LINE_BREAK; + + var lastPart = (this._streams.length === 0); + if (lastPart) { + footer += this._lastBoundary(); + } + + next(footer); + }.bind(this); +}; + +FormData.prototype._lastBoundary = function() { + return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK; +}; + +FormData.prototype.getHeaders = function(userHeaders) { + var formHeaders = { + 'content-type': 'multipart/form-data; boundary=' + this.getBoundary() + }; + + for (var header in userHeaders) { + formHeaders[header.toLowerCase()] = userHeaders[header]; + } + + return formHeaders; +} + +FormData.prototype.getCustomHeaders = function(contentType) { + contentType = contentType ? contentType : 'multipart/form-data'; + + var formHeaders = { + 'content-type': contentType + '; boundary=' + this.getBoundary(), + 'content-length': this.getLengthSync() + }; + + return formHeaders; +} + +FormData.prototype.getBoundary = function() { + if (!this._boundary) { + this._generateBoundary(); + } + + return this._boundary; +}; + +FormData.prototype._generateBoundary = function() { + // This generates a 50 character boundary similar to those used by Firefox. + // They are optimized for boyer-moore parsing. + var boundary = '--------------------------'; + for (var i = 0; i < 24; i++) { + boundary += Math.floor(Math.random() * 10).toString(16); + } + + this._boundary = boundary; +}; + +// Note: getLengthSync DOESN'T calculate streams length +// As workaround one can calculate file size manually +// and add it as knownLength option +FormData.prototype.getLengthSync = function(debug) { + var knownLength = this._overheadLength + this._valueLength; + + // Don't get confused, there are 3 "internal" streams for each keyval pair + // so it basically checks if there is any value added to the form + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + // https://github.com/felixge/node-form-data/issues/40 + if (this._lengthRetrievers.length) { + // Some async length retrivers are present + // therefore synchronous length calculation is false. + // Please use getLength(callback) to get proper length + this._error(new Error('Cannot calculate proper length in synchronous way.')); + } + + return knownLength; +}; + +FormData.prototype.getLength = function(cb) { + var knownLength = this._overheadLength + this._valueLength; + + if (this._streams.length) { + knownLength += this._lastBoundary().length; + } + + if (!this._lengthRetrievers.length) { + process.nextTick(cb.bind(this, null, knownLength)); + return; + } + + async.parallel(this._lengthRetrievers, function(err, values) { + if (err) { + cb(err); + return; + } + + values.forEach(function(length) { + knownLength += length; + }); + + cb(null, knownLength); + }); +}; + +FormData.prototype.submit = function(params, cb) { + + var request + , options + , defaults = { + method : 'post' + }; + + // parse provided url if it's string + // or treat it as options object + if (typeof params == 'string') { + params = parseUrl(params); + + options = populate({ + port: params.port, + path: params.pathname, + host: params.hostname + }, defaults); + } + else // use custom params + { + options = populate(params, defaults); + // if no port provided use default one + if (!options.port) { + options.port = options.protocol == 'https:' ? 443 : 80; + } + } + + // put that good code in getHeaders to some use + options.headers = this.getHeaders(params.headers); + + // https if specified, fallback to http in any other case + if (options.protocol == 'https:') { + request = https.request(options); + } else { + request = http.request(options); + } + + // get content length and fire away + this.getLength(function(err, length) { + + // TODO: Add chunked encoding when no length (if err) + + // add content length + request.setHeader('Content-Length', length); + + this.pipe(request); + if (cb) { + request.on('error', cb); + request.on('response', cb.bind(this, null)); + } + }.bind(this)); + + return request; +}; + +FormData.prototype._error = function(err) { + if (this.error) return; + + this.error = err; + this.pause(); + this.emit('error', err); +}; + +/* + * Santa's little helpers + */ + +// populates missing values +function populate(dst, src) { + for (var prop in src) { + if (!dst[prop]) dst[prop] = src[prop]; + } + return dst; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md new file mode 100644 index 00000000..8b4d8c22 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md @@ -0,0 +1,113 @@ +# v1.5.0 + +- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892) +- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873) +- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637) +- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891) +- Various code simplifications (#896, #904) +- Various doc fixes :scroll: (#890, #894, #903, #905, #912) + +# v1.4.2 + +- Ensure coverage files don't get published on npm (#879) + +# v1.4.1 + +- Add in overlooked `detectLimit` method (#866) +- Removed unnecessary files from npm releases (#861) +- Removed usage of a reserved word to prevent :boom: in older environments (#870) + +# v1.4.0 + +- `asyncify` now supports promises (#840) +- Added `Limit` versions of `filter` and `reject` (#836) +- Add `Limit` versions of `detect`, `some` and `every` (#828, #829) +- `some`, `every` and `detect` now short circuit early (#828, #829) +- Improve detection of the global object (#804), enabling use in WebWorkers +- `whilst` now called with arguments from iterator (#823) +- `during` now gets called with arguments from iterator (#824) +- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0)) + + +# v1.3.0 + +New Features: +- Added `constant` +- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806) +- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800) +- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793) +- `async` should work better in Web Workers due to better `root` detection (#804) +- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642) +- Various internal updates (#786, #801, #802, #803) +- Various doc fixes (#790, #794) + +Bug Fixes: +- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783) + + +# v1.2.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) + + +# v1.2.0 + +New Features: + +- Added `timesLimit` (#743) +- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772) + +Bug Fixes: + +- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777) + + +# v1.1.1 + +Bug Fix: + +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) + + +# v1.1.0 + +New Features: + +- `cargo` now supports all of the same methods and event callbacks as `queue`. +- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769) +- Optimized `map`, `eachOf`, and `waterfall` families of functions +- Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667). +- The callback is now optional for the composed results of `compose` and `seq`. (#618) +- Reduced file size by 4kb, (minified version by 1kb) +- Added code coverage through `nyc` and `coveralls` (#768) + +Bug Fixes: + +- `forever` will no longer stack overflow with a synchronous iterator (#622) +- `eachLimit` and other limit functions will stop iterating once an error occurs (#754) +- Always pass `null` in callbacks when there is no error (#439) +- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668) +- `each` and family will properly handle an empty array (#578) +- `eachSeries` and family will finish if the underlying array is modified during execution (#557) +- `queue` will throw if a non-function is passed to `q.push()` (#593) +- Doc fixes (#629, #766) + + +# v1.0.0 + +No known breaking changes, we are simply complying with semver from here on out. + +Changes: + +- Start using a changelog! +- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321) +- Detect deadlocks in `auto` (#663) +- Better support for require.js (#527) +- Throw if queue created with concurrency `0` (#714) +- Fix unneeded iteration in `queue.resume()` (#758) +- Guard against timer mocking overriding `setImmediate` (#609 #611) +- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729) +- Use single noop function internally (#546) +- Optimize internal `_each`, `_map` and `_keys` functions. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/LICENSE new file mode 100644 index 00000000..8f296985 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010-2014 Caolan McMahon + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/README.md new file mode 100644 index 00000000..071d069b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/README.md @@ -0,0 +1,1791 @@ +# Async.js + +[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async) +[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async) +[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master) +[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + + +Async is a utility module which provides straight-forward, powerful functions +for working with asynchronous JavaScript. Although originally designed for +use with [Node.js](http://nodejs.org) and installable via `npm install async`, +it can also be used directly in the browser. + +Async is also installable via: + +- [bower](http://bower.io/): `bower install async` +- [component](https://github.com/component/component): `component install + caolan/async` +- [jam](http://jamjs.org/): `jam install async` +- [spm](http://spmjs.io/): `spm install async` + +Async provides around 20 functions that include the usual 'functional' +suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns +for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these +functions assume you follow the Node.js convention of providing a single +callback as the last argument of your `async` function. + + +## Quick Examples + +```javascript +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); + +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); + +async.parallel([ + function(){ ... }, + function(){ ... } +], callback); + +async.series([ + function(){ ... }, + function(){ ... } +]); +``` + +There are many more functions available so take a look at the docs below for a +full list. This module aims to be comprehensive, so if you feel anything is +missing please create a GitHub issue for it. + +## Common Pitfalls [(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js) +### Synchronous iteration functions + +If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop. + +This can also arise by accident if you callback early in certain cases: + +```js +async.eachSeries(hugeArray, function iterator(item, callback) { + if (inCache(item)) { + callback(null, cache[item]); // if many items are cached, you'll overflow + } else { + doSomeIO(item, callback); + } +}, function done() { + //... +}); +``` + +Just change it to: + +```js +async.eachSeries(hugeArray, function iterator(item, callback) { + if (inCache(item)) { + async.setImmediate(function () { + callback(null, cache[item]); + }); + } else { + doSomeIO(item, callback); + //... +``` + +Async guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral. + +If JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works. + + +### Multiple callbacks + +Make sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases. + +```js +async.waterfall([ + function (callback) { + getSomething(options, function (err, result) { + if (err) { + callback(new Error("failed getting something:" + err.message)); + // we should return here + } + // since we did not return, this callback still will be called and + // `processData` will be called twice + callback(null, result); + }); + }, + processData +], done) +``` + +It is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function. + + +### Binding a context to an iterator + +This section is really about `bind`, not about `async`. If you are wondering how to +make `async` execute your iterators in a given context, or are confused as to why +a method of another library isn't working as an iterator, study this example: + +```js +// Here is a simple object with an (unnecessarily roundabout) squaring method +var AsyncSquaringLibrary = { + squareExponent: 2, + square: function(number, callback){ + var result = Math.pow(number, this.squareExponent); + setTimeout(function(){ + callback(null, result); + }, 200); + } +}; + +async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){ + // result is [NaN, NaN, NaN] + // This fails because the `this.squareExponent` expression in the square + // function is not evaluated in the context of AsyncSquaringLibrary, and is + // therefore undefined. +}); + +async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){ + // result is [1, 4, 9] + // With the help of bind we can attach a context to the iterator before + // passing it to async. Now the square function will be executed in its + // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent` + // will be as expected. +}); +``` + +## Download + +The source is available for download from +[GitHub](https://github.com/caolan/async/blob/master/lib/async.js). +Alternatively, you can install using Node Package Manager (`npm`): + + npm install async + +As well as using Bower: + + bower install async + +__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed + +## In the Browser + +So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. + +Usage: + +```html + + +``` + +## Documentation + +Some functions are also available in the following forms: +* `Series` - the same as `` but runs only a single async operation at a time +* `Limit` - the same as `` but runs a maximum of `limit` async operations at a time + +### Collections + +* [`each`](#each), `eachSeries`, `eachLimit` +* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit` +* [`map`](#map), `mapSeries`, `mapLimit` +* [`filter`](#filter), `filterSeries`, `filterLimit` +* [`reject`](#reject), `rejectSeries`, `rejectLimit` +* [`reduce`](#reduce), [`reduceRight`](#reduceRight) +* [`detect`](#detect), `detectSeries`, `detectLimit` +* [`sortBy`](#sortBy) +* [`some`](#some), `someLimit` +* [`every`](#every), `everyLimit` +* [`concat`](#concat), `concatSeries` + +### Control Flow + +* [`series`](#seriestasks-callback) +* [`parallel`](#parallel), `parallelLimit` +* [`whilst`](#whilst), [`doWhilst`](#doWhilst) +* [`until`](#until), [`doUntil`](#doUntil) +* [`during`](#during), [`doDuring`](#doDuring) +* [`forever`](#forever) +* [`waterfall`](#waterfall) +* [`compose`](#compose) +* [`seq`](#seq) +* [`applyEach`](#applyEach), `applyEachSeries` +* [`queue`](#queue), [`priorityQueue`](#priorityQueue) +* [`cargo`](#cargo) +* [`auto`](#auto) +* [`retry`](#retry) +* [`iterator`](#iterator) +* [`times`](#times), `timesSeries`, `timesLimit` + +### Utils + +* [`apply`](#apply) +* [`nextTick`](#nextTick) +* [`memoize`](#memoize) +* [`unmemoize`](#unmemoize) +* [`ensureAsync`](#ensureAsync) +* [`constant`](#constant) +* [`asyncify`](#asyncify) +* [`wrapSync`](#wrapSync) +* [`log`](#log) +* [`dir`](#dir) +* [`noConflict`](#noConflict) + +## Collections + + + +### each(arr, iterator, [callback]) + +Applies the function `iterator` to each item in `arr`, in parallel. +The `iterator` is called with an item from the list, and a callback for when it +has finished. If the `iterator` passes an error to its `callback`, the main +`callback` (for the `each` function) is immediately called with the error. + +Note, that since this function applies `iterator` to each item in parallel, +there is no guarantee that the iterator functions will complete in order. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err)` which must be called once it has + completed. If no error has occurred, the `callback` should be run without + arguments or with an explicit `null` argument. The array index is not passed + to the iterator. If you need the index, use [`forEachOf`](#forEachOf). +* `callback(err)` - *Optional* A callback which is called when all `iterator` functions + have finished, or an error occurs. + +__Examples__ + + +```js +// assuming openFiles is an array of file names and saveFile is a function +// to save the modified contents of that file: + +async.each(openFiles, saveFile, function(err){ + // if any of the saves produced an error, err would equal that error +}); +``` + +```js +// assuming openFiles is an array of file names + +async.each(openFiles, function(file, callback) { + + // Perform operation on file here. + console.log('Processing file ' + file); + + if( file.length > 32 ) { + console.log('This file name is too long'); + callback('File name too long'); + } else { + // Do work to process file here + console.log('File processed'); + callback(); + } +}, function(err){ + // if any of the file processing produced an error, err would equal that error + if( err ) { + // One of the iterations produced an error. + // All processing will now stop. + console.log('A file failed to process'); + } else { + console.log('All files have been processed successfully'); + } +}); +``` + +__Related__ + +* eachSeries(arr, iterator, [callback]) +* eachLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + + + +### forEachOf(obj, iterator, [callback]) + +Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator. + +__Arguments__ + +* `obj` - An object or array to iterate over. +* `iterator(item, key, callback)` - A function to apply to each item in `obj`. +The `key` is the item's key, or index in the case of an array. The iterator is +passed a `callback(err)` which must be called once it has completed. If no +error has occurred, the callback should be run without arguments or with an +explicit `null` argument. +* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs. + +__Example__ + +```js +var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"}; +var configs = {}; + +async.forEachOf(obj, function (value, key, callback) { + fs.readFile(__dirname + value, "utf8", function (err, data) { + if (err) return callback(err); + try { + configs[key] = JSON.parse(data); + } catch (e) { + return callback(e); + } + callback(); + }) +}, function (err) { + if (err) console.error(err.message); + // configs is now a map of JSON data + doSomethingWith(configs); +}) +``` + +__Related__ + +* forEachOfSeries(obj, iterator, [callback]) +* forEachOfLimit(obj, limit, iterator, [callback]) + +--------------------------------------- + + +### map(arr, iterator, [callback]) + +Produces a new array of values by mapping each value in `arr` through +the `iterator` function. The `iterator` is called with an item from `arr` and a +callback for when it has finished processing. Each of these callback takes 2 arguments: +an `error`, and the transformed item from `arr`. If `iterator` passes an error to its +callback, the main `callback` (for the `map` function) is immediately called with the error. + +Note, that since this function applies the `iterator` to each item in parallel, +there is no guarantee that the `iterator` functions will complete in order. +However, the results array will be in the same order as the original `arr`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, transformed)` which must be called once + it has completed with an error (which can be `null`) and a transformed item. +* `callback(err, results)` - *Optional* A callback which is called when all `iterator` + functions have finished, or an error occurs. Results is an array of the + transformed items from the `arr`. + +__Example__ + +```js +async.map(['file1','file2','file3'], fs.stat, function(err, results){ + // results is now an array of stats for each file +}); +``` + +__Related__ +* mapSeries(arr, iterator, [callback]) +* mapLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + + +### filter(arr, iterator, [callback]) + +__Alias:__ `select` + +Returns a new array of all the values in `arr` which pass an async truth test. +_The callback for each `iterator` call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. This operation is +performed in parallel, but the results array will be in the same order as the +original. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in `arr`. + The `iterator` is passed a `callback(truthValue)`, which must be called with a + boolean argument once it has completed. +* `callback(results)` - *Optional* A callback which is called after all the `iterator` + functions have finished. + +__Example__ + +```js +async.filter(['file1','file2','file3'], fs.exists, function(results){ + // results now equals an array of the existing files +}); +``` + +__Related__ + +* filterSeries(arr, iterator, [callback]) +* filterLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### reject(arr, iterator, [callback]) + +The opposite of [`filter`](#filter). Removes values that pass an `async` truth test. + +__Related__ + +* rejectSeries(arr, iterator, [callback]) +* rejectLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### reduce(arr, memo, iterator, [callback]) + +__Aliases:__ `inject`, `foldl` + +Reduces `arr` into a single value using an async `iterator` to return +each successive step. `memo` is the initial state of the reduction. +This function only operates in series. + +For performance reasons, it may make sense to split a call to this function into +a parallel map, and then use the normal `Array.prototype.reduce` on the results. +This function is for situations where each step in the reduction needs to be async; +if you can get the data before reducing it, then it's probably a good idea to do so. + +__Arguments__ + +* `arr` - An array to iterate over. +* `memo` - The initial state of the reduction. +* `iterator(memo, item, callback)` - A function applied to each item in the + array to produce the next step in the reduction. The `iterator` is passed a + `callback(err, reduction)` which accepts an optional error as its first + argument, and the state of the reduction as the second. If an error is + passed to the callback, the reduction is stopped and the main `callback` is + immediately called with the error. +* `callback(err, result)` - *Optional* A callback which is called after all the `iterator` + functions have finished. Result is the reduced value. + +__Example__ + +```js +async.reduce([1,2,3], 0, function(memo, item, callback){ + // pointless async: + process.nextTick(function(){ + callback(null, memo + item) + }); +}, function(err, result){ + // result is now equal to the last value of memo, which is 6 +}); +``` + +--------------------------------------- + + +### reduceRight(arr, memo, iterator, [callback]) + +__Alias:__ `foldr` + +Same as [`reduce`](#reduce), only operates on `arr` in reverse order. + + +--------------------------------------- + + +### detect(arr, iterator, [callback]) + +Returns the first value in `arr` that passes an async truth test. The +`iterator` is applied in parallel, meaning the first iterator to return `true` will +fire the detect `callback` with that result. That means the result might not be +the first item in the original `arr` (in terms of order) that passes the test. + +If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries). + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in `arr`. + The iterator is passed a `callback(truthValue)` which must be called with a + boolean argument once it has completed. **Note: this callback does not take an error as its first argument.** +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `true`, or after all the `iterator` functions have finished. Result will be + the first item in the array that passes the truth test (iterator) or the + value `undefined` if none passed. **Note: this callback does not take an error as its first argument.** + +__Example__ + +```js +async.detect(['file1','file2','file3'], fs.exists, function(result){ + // result now equals the first file in the list that exists +}); +``` + +__Related__ + +* detectSeries(arr, iterator, [callback]) +* detectLimit(arr, limit, iterator, [callback]) + +--------------------------------------- + + +### sortBy(arr, iterator, [callback]) + +Sorts a list by the results of running each `arr` value through an async `iterator`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, sortValue)` which must be called once it + has completed with an error (which can be `null`) and a value to use as the sort + criteria. +* `callback(err, results)` - *Optional* A callback which is called after all the `iterator` + functions have finished, or an error occurs. Results is the items from + the original `arr` sorted by the values returned by the `iterator` calls. + +__Example__ + +```js +async.sortBy(['file1','file2','file3'], function(file, callback){ + fs.stat(file, function(err, stats){ + callback(err, stats.mtime); + }); +}, function(err, results){ + // results is now the original array of files sorted by + // modified date +}); +``` + +__Sort Order__ + +By modifying the callback parameter the sorting order can be influenced: + +```js +//ascending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(null, x); +}, function(err,result){ + //result callback +} ); + +//descending order +async.sortBy([1,9,3,5], function(x, callback){ + callback(null, x*-1); //<- x*-1 instead of x, turns the order around +}, function(err,result){ + //result callback +} ); +``` + +--------------------------------------- + + +### some(arr, iterator, [callback]) + +__Alias:__ `any` + +Returns `true` if at least one element in the `arr` satisfies an async test. +_The callback for each iterator call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. Once any iterator +call returns `true`, the main `callback` is immediately called. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in the array + in parallel. The iterator is passed a `callback(truthValue)`` which must be + called with a boolean argument once it has completed. +* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns + `true`, or after all the iterator functions have finished. Result will be + either `true` or `false` depending on the values of the async tests. + + **Note: the callbacks do not take an error as their first argument.** +__Example__ + +```js +async.some(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then at least one of the files exists +}); +``` + +__Related__ + +* someLimit(arr, limit, iterator, callback) + +--------------------------------------- + + +### every(arr, iterator, [callback]) + +__Alias:__ `all` + +Returns `true` if every element in `arr` satisfies an async test. +_The callback for each `iterator` call only accepts a single argument of `true` or +`false`; it does not accept an error argument first!_ This is in-line with the +way node libraries work with truth tests like `fs.exists`. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A truth test to apply to each item in the array + in parallel. The iterator is passed a `callback(truthValue)` which must be + called with a boolean argument once it has completed. +* `callback(result)` - *Optional* A callback which is called after all the `iterator` + functions have finished. Result will be either `true` or `false` depending on + the values of the async tests. + + **Note: the callbacks do not take an error as their first argument.** + +__Example__ + +```js +async.every(['file1','file2','file3'], fs.exists, function(result){ + // if result is true then every file exists +}); +``` + +__Related__ + +* everyLimit(arr, limit, iterator, callback) + +--------------------------------------- + + +### concat(arr, iterator, [callback]) + +Applies `iterator` to each item in `arr`, concatenating the results. Returns the +concatenated list. The `iterator`s are called in parallel, and the results are +concatenated as they return. There is no guarantee that the results array will +be returned in the original order of `arr` passed to the `iterator` function. + +__Arguments__ + +* `arr` - An array to iterate over. +* `iterator(item, callback)` - A function to apply to each item in `arr`. + The iterator is passed a `callback(err, results)` which must be called once it + has completed with an error (which can be `null`) and an array of results. +* `callback(err, results)` - *Optional* A callback which is called after all the `iterator` + functions have finished, or an error occurs. Results is an array containing + the concatenated results of the `iterator` function. + +__Example__ + +```js +async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){ + // files is now a list of filenames that exist in the 3 directories +}); +``` + +__Related__ + +* concatSeries(arr, iterator, [callback]) + + +## Control Flow + + +### series(tasks, [callback]) + +Run the functions in the `tasks` array in series, each one running once the previous +function has completed. If any functions in the series pass an error to its +callback, no more functions are run, and `callback` is immediately called with the value of the error. +Otherwise, `callback` receives an array of results when `tasks` have completed. + +It is also possible to use an object instead of an array. Each property will be +run as a function, and the results will be passed to the final `callback` as an object +instead of an array. This can be a more readable way of handling results from +[`series`](#series). + +**Note** that while many implementations preserve the order of object properties, the +[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6) +explicitly states that + +> The mechanics and order of enumerating the properties is not specified. + +So if you rely on the order in which your series of functions are executed, and want +this to work on all platforms, consider using an array. + +__Arguments__ + +* `tasks` - An array or object containing functions to run, each function is passed + a `callback(err, result)` it must call on completion with an error `err` (which can + be `null`) and an optional `result` value. +* `callback(err, results)` - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the `task` callbacks. + +__Example__ + +```js +async.series([ + function(callback){ + // do some stuff ... + callback(null, 'one'); + }, + function(callback){ + // do some more stuff ... + callback(null, 'two'); + } +], +// optional callback +function(err, results){ + // results is now equal to ['one', 'two'] +}); + + +// an example using an object instead of an array +async.series({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equal to: {one: 1, two: 2} +}); +``` + +--------------------------------------- + + +### parallel(tasks, [callback]) + +Run the `tasks` array of functions in parallel, without waiting until the previous +function has completed. If any of the functions pass an error to its +callback, the main `callback` is immediately called with the value of the error. +Once the `tasks` have completed, the results are passed to the final `callback` as an +array. + +**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded. + +It is also possible to use an object instead of an array. Each property will be +run as a function and the results will be passed to the final `callback` as an object +instead of an array. This can be a more readable way of handling results from +[`parallel`](#parallel). + + +__Arguments__ + +* `tasks` - An array or object containing functions to run. Each function is passed + a `callback(err, result)` which it must call on completion with an error `err` + (which can be `null`) and an optional `result` value. +* `callback(err, results)` - An optional callback to run once all the functions + have completed. This function gets a results array (or object) containing all + the result arguments passed to the task callbacks. + +__Example__ + +```js +async.parallel([ + function(callback){ + setTimeout(function(){ + callback(null, 'one'); + }, 200); + }, + function(callback){ + setTimeout(function(){ + callback(null, 'two'); + }, 100); + } +], +// optional callback +function(err, results){ + // the results array will equal ['one','two'] even though + // the second function had a shorter timeout. +}); + + +// an example using an object instead of an array +async.parallel({ + one: function(callback){ + setTimeout(function(){ + callback(null, 1); + }, 200); + }, + two: function(callback){ + setTimeout(function(){ + callback(null, 2); + }, 100); + } +}, +function(err, results) { + // results is now equals to: {one: 1, two: 2} +}); +``` + +__Related__ + +* parallelLimit(tasks, limit, [callback]) + +--------------------------------------- + + +### whilst(test, fn, callback) + +Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped, +or an error occurs. + +__Arguments__ + +* `test()` - synchronous truth test to perform before each execution of `fn`. +* `fn(callback)` - A function which is called each time `test` passes. The function is + passed a `callback(err)`, which must be called once it has completed with an + optional `err` argument. +* `callback(err)` - A callback which is called after the test fails and repeated + execution of `fn` has stopped. + +__Example__ + +```js +var count = 0; + +async.whilst( + function () { return count < 5; }, + function (callback) { + count++; + setTimeout(callback, 1000); + }, + function (err) { + // 5 seconds have passed + } +); +``` + +--------------------------------------- + + +### doWhilst(fn, test, callback) + +The post-check version of [`whilst`](#whilst). To reflect the difference in +the order of operations, the arguments `test` and `fn` are switched. + +`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript. + +--------------------------------------- + + +### until(test, fn, callback) + +Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped, +or an error occurs. + +The inverse of [`whilst`](#whilst). + +--------------------------------------- + + +### doUntil(fn, test, callback) + +Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`. + +--------------------------------------- + + +### during(test, fn, callback) + +Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error. + +__Example__ + +```js +var count = 0; + +async.during( + function (callback) { + return callback(null, count < 5); + }, + function (callback) { + count++; + setTimeout(callback, 1000); + }, + function (err) { + // 5 seconds have passed + } +); +``` + +--------------------------------------- + + +### doDuring(fn, test, callback) + +The post-check version of [`during`](#during). To reflect the difference in +the order of operations, the arguments `test` and `fn` are switched. + +Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function. + +--------------------------------------- + + +### forever(fn, [errback]) + +Calls the asynchronous function `fn` with a callback parameter that allows it to +call itself again, in series, indefinitely. + +If an error is passed to the callback then `errback` is called with the +error, and execution stops, otherwise it will never be called. + +```js +async.forever( + function(next) { + // next is suitable for passing to things that need a callback(err [, whatever]); + // it will result in this function being called again. + }, + function(err) { + // if next is called with a value in its first parameter, it will appear + // in here as 'err', and execution will stop. + } +); +``` + +--------------------------------------- + + +### waterfall(tasks, [callback]) + +Runs the `tasks` array of functions in series, each passing their results to the next in +the array. However, if any of the `tasks` pass an error to their own callback, the +next function is not executed, and the main `callback` is immediately called with +the error. + +__Arguments__ + +* `tasks` - An array of functions to run, each function is passed a + `callback(err, result1, result2, ...)` it must call on completion. The first + argument is an error (which can be `null`) and any further arguments will be + passed as arguments in order to the next task. +* `callback(err, [results])` - An optional callback to run once all the functions + have completed. This will be passed the results of the last task's callback. + + + +__Example__ + +```js +async.waterfall([ + function(callback) { + callback(null, 'one', 'two'); + }, + function(arg1, arg2, callback) { + // arg1 now equals 'one' and arg2 now equals 'two' + callback(null, 'three'); + }, + function(arg1, callback) { + // arg1 now equals 'three' + callback(null, 'done'); + } +], function (err, result) { + // result now equals 'done' +}); +``` + +--------------------------------------- + +### compose(fn1, fn2...) + +Creates a function which is a composition of the passed asynchronous +functions. Each function consumes the return value of the function that +follows. Composing functions `f()`, `g()`, and `h()` would produce the result of +`f(g(h()))`, only this version uses callbacks to obtain the return values. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* `functions...` - the asynchronous functions to compose + + +__Example__ + +```js +function add1(n, callback) { + setTimeout(function () { + callback(null, n + 1); + }, 10); +} + +function mul3(n, callback) { + setTimeout(function () { + callback(null, n * 3); + }, 10); +} + +var add1mul3 = async.compose(mul3, add1); + +add1mul3(4, function (err, result) { + // result now equals 15 +}); +``` + +--------------------------------------- + +### seq(fn1, fn2...) + +Version of the compose function that is more natural to read. +Each function consumes the return value of the previous function. +It is the equivalent of [`compose`](#compose) with the arguments reversed. + +Each function is executed with the `this` binding of the composed function. + +__Arguments__ + +* `functions...` - the asynchronous functions to compose + + +__Example__ + +```js +// Requires lodash (or underscore), express3 and dresende's orm2. +// Part of an app, that fetches cats of the logged user. +// This example uses `seq` function to avoid overnesting and error +// handling clutter. +app.get('/cats', function(request, response) { + var User = request.models.User; + async.seq( + _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data)) + function(user, fn) { + user.getCats(fn); // 'getCats' has signature (callback(err, data)) + } + )(req.session.user_id, function (err, cats) { + if (err) { + console.error(err); + response.json({ status: 'error', message: err.message }); + } else { + response.json({ status: 'ok', message: 'Cats found', data: cats }); + } + }); +}); +``` + +--------------------------------------- + +### applyEach(fns, args..., callback) + +Applies the provided arguments to each function in the array, calling +`callback` after all functions have completed. If you only provide the first +argument, then it will return a function which lets you pass in the +arguments as if it were a single function call. + +__Arguments__ + +* `fns` - the asynchronous functions to all call with the same arguments +* `args...` - any number of separate arguments to pass to the function +* `callback` - the final argument should be the callback, called when all + functions have completed processing + + +__Example__ + +```js +async.applyEach([enableSearch, updateSchema], 'bucket', callback); + +// partial application example: +async.each( + buckets, + async.applyEach([enableSearch, updateSchema]), + callback +); +``` + +__Related__ + +* applyEachSeries(tasks, args..., [callback]) + +--------------------------------------- + + +### queue(worker, [concurrency]) + +Creates a `queue` object with the specified `concurrency`. Tasks added to the +`queue` are processed in parallel (up to the `concurrency` limit). If all +`worker`s are in progress, the task is queued until one becomes available. +Once a `worker` completes a `task`, that `task`'s callback is called. + +__Arguments__ + +* `worker(task, callback)` - An asynchronous function for processing a queued + task, which must call its `callback(err)` argument when finished, with an + optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`. +* `concurrency` - An `integer` for determining how many `worker` functions should be + run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown. + +__Queue objects__ + +The `queue` object returned by this function has the following properties and +methods: + +* `length()` - a function returning the number of items waiting to be processed. +* `started` - a function returning whether or not any items have been pushed and processed by the queue +* `running()` - a function returning the number of items currently being processed. +* `workersList()` - a function returning the array of items currently being processed. +* `idle()` - a function returning false if there are items waiting or being processed, or true if not. +* `concurrency` - an integer for determining how many `worker` functions should be + run in parallel. This property can be changed after a `queue` is created to + alter the concurrency on-the-fly. +* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once + the `worker` has finished processing the task. Instead of a single task, a `tasks` array + can be submitted. The respective callback is used for every task in the list. +* `unshift(task, [callback])` - add a new task to the front of the `queue`. +* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit, + and further tasks will be queued. +* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`. +* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`. +* `paused` - a boolean for determining whether the queue is in a paused state +* `pause()` - a function that pauses the processing of tasks until `resume()` is called. +* `resume()` - a function that resumes the processing of queued tasks when the queue is paused. +* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle. + +__Example__ + +```js +// create a queue object with concurrency 2 + +var q = async.queue(function (task, callback) { + console.log('hello ' + task.name); + callback(); +}, 2); + + +// assign a callback +q.drain = function() { + console.log('all items have been processed'); +} + +// add some items to the queue + +q.push({name: 'foo'}, function (err) { + console.log('finished processing foo'); +}); +q.push({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); + +// add some items to the queue (batch-wise) + +q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) { + console.log('finished processing item'); +}); + +// add some items to the front of the queue + +q.unshift({name: 'bar'}, function (err) { + console.log('finished processing bar'); +}); +``` + + +--------------------------------------- + + +### priorityQueue(worker, concurrency) + +The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects: + +* `push(task, priority, [callback])` - `priority` should be a number. If an array of + `tasks` is given, all tasks will be assigned the same priority. +* The `unshift` method was removed. + +--------------------------------------- + + +### cargo(worker, [payload]) + +Creates a `cargo` object with the specified payload. Tasks added to the +cargo will be processed altogether (up to the `payload` limit). If the +`worker` is in progress, the task is queued until it becomes available. Once +the `worker` has completed some tasks, each callback of those tasks is called. +Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work. + +While [queue](#queue) passes only one task to one of a group of workers +at a time, cargo passes an array of tasks to a single worker, repeating +when the worker is finished. + +__Arguments__ + +* `worker(tasks, callback)` - An asynchronous function for processing an array of + queued tasks, which must call its `callback(err)` argument when finished, with + an optional `err` argument. +* `payload` - An optional `integer` for determining how many tasks should be + processed per round; if omitted, the default is unlimited. + +__Cargo objects__ + +The `cargo` object returned by this function has the following properties and +methods: + +* `length()` - A function returning the number of items waiting to be processed. +* `payload` - An `integer` for determining how many tasks should be + process per round. This property can be changed after a `cargo` is created to + alter the payload on-the-fly. +* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called + once the `worker` has finished processing the task. Instead of a single task, an array of `tasks` + can be submitted. The respective callback is used for every task in the list. +* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued. +* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`. +* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`. +* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue) + +__Example__ + +```js +// create a cargo object with payload 2 + +var cargo = async.cargo(function (tasks, callback) { + for(var i=0; i +### auto(tasks, [concurrency], [callback]) + +Determines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied. + +If any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far. + +Note, all functions are called with a `results` object as a second argument, +so it is unsafe to pass functions in the `tasks` object which cannot handle the +extra argument. + +For example, this snippet of code: + +```js +async.auto({ + readData: async.apply(fs.readFile, 'data.txt', 'utf-8') +}, callback); +``` + +will have the effect of calling `readFile` with the results object as the last +argument, which will fail: + +```js +fs.readFile('data.txt', 'utf-8', cb, {}); +``` + +Instead, wrap the call to `readFile` in a function which does not forward the +`results` object: + +```js +async.auto({ + readData: function(cb, results){ + fs.readFile('data.txt', 'utf-8', cb); + } +}, callback); +``` + +__Arguments__ + +* `tasks` - An object. Each of its properties is either a function or an array of + requirements, with the function itself the last item in the array. The object's key + of a property serves as the name of the task defined by that property, + i.e. can be used when specifying requirements for other tasks. + The function receives two arguments: (1) a `callback(err, result)` which must be + called when finished, passing an `error` (which can be `null`) and the result of + the function's execution, and (2) a `results` object, containing the results of + the previously executed functions. +* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible. +* `callback(err, results)` - An optional callback which is called when all the + tasks have been completed. It receives the `err` argument if any `tasks` + pass an error to their callback. Results are always returned; however, if + an error occurs, no further `tasks` will be performed, and the results + object will only contain partial results. + + +__Example__ + +```js +async.auto({ + get_data: function(callback){ + console.log('in get_data'); + // async code to get some data + callback(null, 'data', 'converted to array'); + }, + make_folder: function(callback){ + console.log('in make_folder'); + // async code to create a directory to store a file in + // this is run at the same time as getting the data + callback(null, 'folder'); + }, + write_file: ['get_data', 'make_folder', function(callback, results){ + console.log('in write_file', JSON.stringify(results)); + // once there is some data and the directory exists, + // write the data to a file in the directory + callback(null, 'filename'); + }], + email_link: ['write_file', function(callback, results){ + console.log('in email_link', JSON.stringify(results)); + // once the file is written let's email a link to it... + // results.write_file contains the filename returned by write_file. + callback(null, {'file':results.write_file, 'email':'user@example.com'}); + }] +}, function(err, results) { + console.log('err = ', err); + console.log('results = ', results); +}); +``` + +This is a fairly trivial example, but to do this using the basic parallel and +series functions would look like this: + +```js +async.parallel([ + function(callback){ + console.log('in get_data'); + // async code to get some data + callback(null, 'data', 'converted to array'); + }, + function(callback){ + console.log('in make_folder'); + // async code to create a directory to store a file in + // this is run at the same time as getting the data + callback(null, 'folder'); + } +], +function(err, results){ + async.series([ + function(callback){ + console.log('in write_file', JSON.stringify(results)); + // once there is some data and the directory exists, + // write the data to a file in the directory + results.push('filename'); + callback(null); + }, + function(callback){ + console.log('in email_link', JSON.stringify(results)); + // once the file is written let's email a link to it... + callback(null, {'file':results.pop(), 'email':'user@example.com'}); + } + ]); +}); +``` + +For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding +new tasks much easier (and the code more readable). + + +--------------------------------------- + + +### retry([opts = {times: 5, interval: 0}| 5], task, [callback]) + +Attempts to get a successful response from `task` no more than `times` times before +returning an error. If the task is successful, the `callback` will be passed the result +of the successful task. If all attempts fail, the callback will be passed the error and +result (if any) of the final attempt. + +__Arguments__ + +* `opts` - Can be either an object with `times` and `interval` or a number. `times` is how many attempts should be made before giving up. `interval` is how long to wait inbetween attempts. Defaults to {times: 5, interval: 0} + * if a number is passed in it sets `times` only (with `interval` defaulting to 0). +* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` + which must be called when finished, passing `err` (which can be `null`) and the `result` of + the function's execution, and (2) a `results` object, containing the results of + the previously executed functions (if nested inside another control flow). +* `callback(err, results)` - An optional callback which is called when the + task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`. + +The [`retry`](#retry) function can be used as a stand-alone control flow by passing a +callback, as shown below: + +```js +async.retry(3, apiMethod, function(err, result) { + // do something with the result +}); +``` + +```js +async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { + // do something with the result +}); +``` + +It can also be embedded within other control flow functions to retry individual methods +that are not as reliable, like this: + +```js +async.auto({ + users: api.getUsers.bind(api), + payments: async.retry(3, api.getPayments.bind(api)) +}, function(err, results) { + // do something with the results +}); +``` + + +--------------------------------------- + + +### iterator(tasks) + +Creates an iterator function which calls the next function in the `tasks` array, +returning a continuation to call the next one after that. It's also possible to +“peek” at the next iterator with `iterator.next()`. + +This function is used internally by the `async` module, but can be useful when +you want to manually control the flow of functions in series. + +__Arguments__ + +* `tasks` - An array of functions to run. + +__Example__ + +```js +var iterator = async.iterator([ + function(){ sys.p('one'); }, + function(){ sys.p('two'); }, + function(){ sys.p('three'); } +]); + +node> var iterator2 = iterator(); +'one' +node> var iterator3 = iterator2(); +'two' +node> iterator3(); +'three' +node> var nextfn = iterator2.next(); +node> nextfn(); +'three' +``` + +--------------------------------------- + + +### apply(function, arguments..) + +Creates a continuation function with some arguments already applied. + +Useful as a shorthand when combined with other control flow functions. Any arguments +passed to the returned function are added to the arguments originally passed +to apply. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to automatically apply when the + continuation is called. + +__Example__ + +```js +// using apply + +async.parallel([ + async.apply(fs.writeFile, 'testfile1', 'test1'), + async.apply(fs.writeFile, 'testfile2', 'test2'), +]); + + +// the same process without using apply + +async.parallel([ + function(callback){ + fs.writeFile('testfile1', 'test1', callback); + }, + function(callback){ + fs.writeFile('testfile2', 'test2', callback); + } +]); +``` + +It's possible to pass any number of additional arguments when calling the +continuation: + +```js +node> var fn = async.apply(sys.puts, 'one'); +node> fn('two', 'three'); +one +two +three +``` + +--------------------------------------- + + +### nextTick(callback), setImmediate(callback) + +Calls `callback` on a later loop around the event loop. In Node.js this just +calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)` +if available, otherwise `setTimeout(callback, 0)`, which means other higher priority +events may precede the execution of `callback`. + +This is used internally for browser-compatibility purposes. + +__Arguments__ + +* `callback` - The function to call on a later loop around the event loop. + +__Example__ + +```js +var call_order = []; +async.nextTick(function(){ + call_order.push('two'); + // call_order now equals ['one','two'] +}); +call_order.push('one') +``` + + +### times(n, iterator, [callback]) + +Calls the `iterator` function `n` times, and accumulates results in the same manner +you would use with [`map`](#map). + +__Arguments__ + +* `n` - The number of times to run the function. +* `iterator` - The function to call `n` times. +* `callback` - see [`map`](#map) + +__Example__ + +```js +// Pretend this is some complicated async factory +var createUser = function(id, callback) { + callback(null, { + id: 'user' + id + }) +} +// generate 5 users +async.times(5, function(n, next){ + createUser(n, function(err, user) { + next(err, user) + }) +}, function(err, users) { + // we should now have 5 users +}); +``` + +__Related__ + +* timesSeries(n, iterator, [callback]) +* timesLimit(n, limit, iterator, [callback]) + + +## Utils + + +### memoize(fn, [hasher]) + +Caches the results of an `async` function. When creating a hash to store function +results against, the callback is omitted from the hash and an optional hash +function can be used. + +If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function. + +The cache of results is exposed as the `memo` property of the function returned +by `memoize`. + +__Arguments__ + +* `fn` - The function to proxy and cache results from. +* `hasher` - An optional function for generating a custom hash for storing + results. It has all the arguments applied to it apart from the callback, and + must be synchronous. + +__Example__ + +```js +var slow_fn = function (name, callback) { + // do something + callback(null, result); +}; +var fn = async.memoize(slow_fn); + +// fn can now be used as if it were slow_fn +fn('some name', function () { + // callback +}); +``` + + +### unmemoize(fn) + +Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized +form. Handy for testing. + +__Arguments__ + +* `fn` - the memoized function + +--------------------------------------- + + +### ensureAsync(fn) + +Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained. + +__Arguments__ + +* `fn` - an async function, one that expects a node-style callback as its last argument + +Returns a wrapped function with the exact same call signature as the function passed in. + +__Example__ + +```js +function sometimesAsync(arg, callback) { + if (cache[arg]) { + return callback(null, cache[arg]); // this would be synchronous!! + } else { + doSomeIO(arg, callback); // this IO would be asynchronous + } +} + +// this has a risk of stack overflows if many results are cached in a row +async.mapSeries(args, sometimesAsync, done); + +// this will defer sometimesAsync's callback if necessary, +// preventing stack overflows +async.mapSeries(args, async.ensureAsync(sometimesAsync), done); + +``` + +--------------------------------------- + + +### constant(values...) + +Returns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`. + +__Example__ + +```js +async.waterfall([ + async.constant(42), + function (value, next) { + // value === 42 + }, + //... +], callback); + +async.waterfall([ + async.constant(filename, "utf8"), + fs.readFile, + function (fileData, next) { + //... + } + //... +], callback); + +async.auto({ + hostname: async.constant("https://server.net/"), + port: findFreePort, + launchServer: ["hostname", "port", function (cb, options) { + startServer(options, cb); + }], + //... +}, callback); + +``` + +--------------------------------------- + + + +### asyncify(func) + +__Alias:__ `wrapSync` + +Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback. + +__Example__ + +```js +async.waterfall([ + async.apply(fs.readFile, filename, "utf8"), + async.asyncify(JSON.parse), + function (data, next) { + // data is the result of parsing the text. + // If there was a parsing error, it would have been caught. + } +], callback) +``` + +--------------------------------------- + + +### log(function, arguments) + +Logs the result of an `async` function to the `console`. Only works in Node.js or +in browsers that support `console.log` and `console.error` (such as FF and Chrome). +If multiple arguments are returned from the async function, `console.log` is +called on each argument in order. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, 'hello ' + name); + }, 1000); +}; +``` +```js +node> async.log(hello, 'world'); +'hello world' +``` + +--------------------------------------- + + +### dir(function, arguments) + +Logs the result of an `async` function to the `console` using `console.dir` to +display the properties of the resulting object. Only works in Node.js or +in browsers that support `console.dir` and `console.error` (such as FF and Chrome). +If multiple arguments are returned from the async function, `console.dir` is +called on each argument in order. + +__Arguments__ + +* `function` - The function you want to eventually apply all arguments to. +* `arguments...` - Any number of arguments to apply to the function. + +__Example__ + +```js +var hello = function(name, callback){ + setTimeout(function(){ + callback(null, {hello: name}); + }, 1000); +}; +``` +```js +node> async.dir(hello, 'world'); +{hello: 'world'} +``` + +--------------------------------------- + + +### noConflict() + +Changes the value of `async` back to its original value, returning a reference to the +`async` object. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js new file mode 100644 index 00000000..88893440 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js @@ -0,0 +1,1260 @@ +/*! + * async + * https://github.com/caolan/async + * + * Copyright 2010-2014 Caolan McMahon + * Released under the MIT license + */ +(function () { + + var async = {}; + function noop() {} + function identity(v) { + return v; + } + function toBool(v) { + return !!v; + } + function notId(v) { + return !v; + } + + // global on the server, window in the browser + var previous_async; + + // Establish the root object, `window` (`self`) in the browser, `global` + // on the server, or `this` in some virtual machines. We use `self` + // instead of `window` for `WebWorker` support. + var root = typeof self === 'object' && self.self === self && self || + typeof global === 'object' && global.global === global && global || + this; + + if (root != null) { + previous_async = root.async; + } + + async.noConflict = function () { + root.async = previous_async; + return async; + }; + + function only_once(fn) { + return function() { + if (fn === null) throw new Error("Callback was already called."); + fn.apply(this, arguments); + fn = null; + }; + } + + function _once(fn) { + return function() { + if (fn === null) return; + fn.apply(this, arguments); + fn = null; + }; + } + + //// cross-browser compatiblity functions //// + + var _toString = Object.prototype.toString; + + var _isArray = Array.isArray || function (obj) { + return _toString.call(obj) === '[object Array]'; + }; + + // Ported from underscore.js isObject + var _isObject = function(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + }; + + function _isArrayLike(arr) { + return _isArray(arr) || ( + // has a positive integer length property + typeof arr.length === "number" && + arr.length >= 0 && + arr.length % 1 === 0 + ); + } + + function _arrayEach(arr, iterator) { + var index = -1, + length = arr.length; + + while (++index < length) { + iterator(arr[index], index, arr); + } + } + + function _map(arr, iterator) { + var index = -1, + length = arr.length, + result = Array(length); + + while (++index < length) { + result[index] = iterator(arr[index], index, arr); + } + return result; + } + + function _range(count) { + return _map(Array(count), function (v, i) { return i; }); + } + + function _reduce(arr, iterator, memo) { + _arrayEach(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + } + + function _forEachOf(object, iterator) { + _arrayEach(_keys(object), function (key) { + iterator(object[key], key); + }); + } + + function _indexOf(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === item) return i; + } + return -1; + } + + var _keys = Object.keys || function (obj) { + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + function _keyIterator(coll) { + var i = -1; + var len; + var keys; + if (_isArrayLike(coll)) { + len = coll.length; + return function next() { + i++; + return i < len ? i : null; + }; + } else { + keys = _keys(coll); + len = keys.length; + return function next() { + i++; + return i < len ? keys[i] : null; + }; + } + } + + // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html) + // This accumulates the arguments passed into an array, after a given index. + // From underscore.js (https://github.com/jashkenas/underscore/pull/2140). + function _restParam(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0); + var rest = Array(length); + for (var index = 0; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + } + // Currently unused but handle cases outside of the switch statement: + // var args = Array(startIndex + 1); + // for (index = 0; index < startIndex; index++) { + // args[index] = arguments[index]; + // } + // args[startIndex] = rest; + // return func.apply(this, args); + }; + } + + function _withoutIndex(iterator) { + return function (value, index, callback) { + return iterator(value, callback); + }; + } + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + + // capture the global reference to guard against fakeTimer mocks + var _setImmediate = typeof setImmediate === 'function' && setImmediate; + + var _delay = _setImmediate ? function(fn) { + // not a direct alias for IE10 compatibility + _setImmediate(fn); + } : function(fn) { + setTimeout(fn, 0); + }; + + if (typeof process === 'object' && typeof process.nextTick === 'function') { + async.nextTick = process.nextTick; + } else { + async.nextTick = _delay; + } + async.setImmediate = _setImmediate ? _delay : async.nextTick; + + + async.forEach = + async.each = function (arr, iterator, callback) { + return async.eachOf(arr, _withoutIndex(iterator), callback); + }; + + async.forEachSeries = + async.eachSeries = function (arr, iterator, callback) { + return async.eachOfSeries(arr, _withoutIndex(iterator), callback); + }; + + + async.forEachLimit = + async.eachLimit = function (arr, limit, iterator, callback) { + return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback); + }; + + async.forEachOf = + async.eachOf = function (object, iterator, callback) { + callback = _once(callback || noop); + object = object || []; + + var iter = _keyIterator(object); + var key, completed = 0; + + while ((key = iter()) != null) { + completed += 1; + iterator(object[key], key, only_once(done)); + } + + if (completed === 0) callback(null); + + function done(err) { + completed--; + if (err) { + callback(err); + } + // Check key is null in case iterator isn't exhausted + // and done resolved synchronously. + else if (key === null && completed <= 0) { + callback(null); + } + } + }; + + async.forEachOfSeries = + async.eachOfSeries = function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + var key = nextKey(); + function iterate() { + var sync = true; + if (key === null) { + return callback(null); + } + iterator(obj[key], key, only_once(function (err) { + if (err) { + callback(err); + } + else { + key = nextKey(); + if (key === null) { + return callback(null); + } else { + if (sync) { + async.setImmediate(iterate); + } else { + iterate(); + } + } + } + })); + sync = false; + } + iterate(); + }; + + + + async.forEachOfLimit = + async.eachOfLimit = function (obj, limit, iterator, callback) { + _eachOfLimit(limit)(obj, iterator, callback); + }; + + function _eachOfLimit(limit) { + + return function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + if (limit <= 0) { + return callback(null); + } + var done = false; + var running = 0; + var errored = false; + + (function replenish () { + if (done && running <= 0) { + return callback(null); + } + + while (running < limit && !errored) { + var key = nextKey(); + if (key === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iterator(obj[key], key, only_once(function (err) { + running -= 1; + if (err) { + callback(err); + errored = true; + } + else { + replenish(); + } + })); + } + })(); + }; + } + + + function doParallel(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOf, obj, iterator, callback); + }; + } + function doParallelLimit(fn) { + return function (obj, limit, iterator, callback) { + return fn(_eachOfLimit(limit), obj, iterator, callback); + }; + } + function doSeries(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOfSeries, obj, iterator, callback); + }; + } + + function _asyncMap(eachfn, arr, iterator, callback) { + callback = _once(callback || noop); + arr = arr || []; + var results = _isArrayLike(arr) ? [] : {}; + eachfn(arr, function (value, index, callback) { + iterator(value, function (err, v) { + results[index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = doParallelLimit(_asyncMap); + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.inject = + async.foldl = + async.reduce = function (arr, memo, iterator, callback) { + async.eachOfSeries(arr, function (x, i, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + + async.foldr = + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, identity).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + + async.transform = function (arr, memo, iterator, callback) { + if (arguments.length === 3) { + callback = iterator; + iterator = memo; + memo = _isArray(arr) ? [] : {}; + } + + async.eachOf(arr, function(v, k, cb) { + iterator(memo, v, k, cb); + }, function(err) { + callback(err, memo); + }); + }; + + function _filter(eachfn, arr, iterator, callback) { + var results = []; + eachfn(arr, function (x, index, callback) { + iterator(x, function (v) { + if (v) { + results.push({index: index, value: x}); + } + callback(); + }); + }, function () { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + } + + async.select = + async.filter = doParallel(_filter); + + async.selectLimit = + async.filterLimit = doParallelLimit(_filter); + + async.selectSeries = + async.filterSeries = doSeries(_filter); + + function _reject(eachfn, arr, iterator, callback) { + _filter(eachfn, arr, function(value, cb) { + iterator(value, function(v) { + cb(!v); + }); + }, callback); + } + async.reject = doParallel(_reject); + async.rejectLimit = doParallelLimit(_reject); + async.rejectSeries = doSeries(_reject); + + function _createTester(eachfn, check, getResult) { + return function(arr, limit, iterator, cb) { + function done() { + if (cb) cb(getResult(false, void 0)); + } + function iteratee(x, _, callback) { + if (!cb) return callback(); + iterator(x, function (v) { + if (cb && check(v)) { + cb(getResult(true, x)); + cb = iterator = false; + } + callback(); + }); + } + if (arguments.length > 3) { + eachfn(arr, limit, iteratee, done); + } else { + cb = iterator; + iterator = limit; + eachfn(arr, iteratee, done); + } + }; + } + + async.any = + async.some = _createTester(async.eachOf, toBool, identity); + + async.someLimit = _createTester(async.eachOfLimit, toBool, identity); + + async.all = + async.every = _createTester(async.eachOf, notId, notId); + + async.everyLimit = _createTester(async.eachOfLimit, notId, notId); + + function _findGetResult(v, x) { + return x; + } + async.detect = _createTester(async.eachOf, identity, _findGetResult); + async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult); + async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult); + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + callback(null, _map(results.sort(comparator), function (x) { + return x.value; + })); + } + + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } + }; + + async.auto = function (tasks, concurrency, callback) { + if (!callback) { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = _once(callback || noop); + var keys = _keys(tasks); + var remainingTasks = keys.length; + if (!remainingTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = remainingTasks; + } + + var results = {}; + var runningTasks = 0; + + var listeners = []; + function addListener(fn) { + listeners.unshift(fn); + } + function removeListener(fn) { + var idx = _indexOf(listeners, fn); + if (idx >= 0) listeners.splice(idx, 1); + } + function taskComplete() { + remainingTasks--; + _arrayEach(listeners.slice(0), function (fn) { + fn(); + }); + } + + addListener(function () { + if (!remainingTasks) { + callback(null, results); + } + }); + + _arrayEach(keys, function (k) { + var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; + var taskCallback = _restParam(function(err, args) { + runningTasks--; + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _forEachOf(results, function(val, rkey) { + safeResults[rkey] = val; + }); + safeResults[k] = args; + callback(err, safeResults); + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }); + var requires = task.slice(0, task.length - 1); + // prevent dead-locks + var len = requires.length; + var dep; + while (len--) { + if (!(dep = tasks[requires[len]])) { + throw new Error('Has inexistant dependency'); + } + if (_isArray(dep) && _indexOf(dep, k) >= 0) { + throw new Error('Has cyclic dependencies'); + } + } + function ready() { + return runningTasks < concurrency && _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + } + if (ready()) { + runningTasks++; + task[task.length - 1](taskCallback, results); + } + else { + addListener(listener); + } + function listener() { + if (ready()) { + runningTasks++; + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + } + }); + }; + + + + async.retry = function(times, task, callback) { + var DEFAULT_TIMES = 5; + var DEFAULT_INTERVAL = 0; + + var attempts = []; + + var opts = { + times: DEFAULT_TIMES, + interval: DEFAULT_INTERVAL + }; + + function parseTimes(acc, t){ + if(typeof t === 'number'){ + acc.times = parseInt(t, 10) || DEFAULT_TIMES; + } else if(typeof t === 'object'){ + acc.times = parseInt(t.times, 10) || DEFAULT_TIMES; + acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL; + } else { + throw new Error('Unsupported argument type for \'times\': ' + typeof t); + } + } + + var length = arguments.length; + if (length < 1 || length > 3) { + throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)'); + } else if (length <= 2 && typeof times === 'function') { + callback = task; + task = times; + } + if (typeof times !== 'function') { + parseTimes(opts, times); + } + opts.callback = callback; + opts.task = task; + + function wrappedTask(wrappedCallback, wrappedResults) { + function retryAttempt(task, finalAttempt) { + return function(seriesCallback) { + task(function(err, result){ + seriesCallback(!err || finalAttempt, {err: err, result: result}); + }, wrappedResults); + }; + } + + function retryInterval(interval){ + return function(seriesCallback){ + setTimeout(function(){ + seriesCallback(null); + }, interval); + }; + } + + while (opts.times) { + + var finalAttempt = !(opts.times-=1); + attempts.push(retryAttempt(opts.task, finalAttempt)); + if(!finalAttempt && opts.interval > 0){ + attempts.push(retryInterval(opts.interval)); + } + } + + async.series(attempts, function(done, data){ + data = data[data.length - 1]; + (wrappedCallback || opts.callback)(data.err, data.result); + }); + } + + // If a callback is passed, run this as a controll flow + return opts.callback ? wrappedTask() : wrappedTask; + }; + + async.waterfall = function (tasks, callback) { + callback = _once(callback || noop); + if (!_isArray(tasks)) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + function wrapIterator(iterator) { + return _restParam(function (err, args) { + if (err) { + callback.apply(null, [err].concat(args)); + } + else { + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + ensureAsync(iterator).apply(null, args); + } + }); + } + wrapIterator(async.iterator(tasks))(); + }; + + function _parallel(eachfn, tasks, callback) { + callback = callback || noop; + var results = _isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, function (task, key, callback) { + task(_restParam(function (err, args) { + if (args.length <= 1) { + args = args[0]; + } + results[key] = args; + callback(err); + })); + }, function (err) { + callback(err, results); + }); + } + + async.parallel = function (tasks, callback) { + _parallel(async.eachOf, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel(_eachOfLimit(limit), tasks, callback); + }; + + async.series = function(tasks, callback) { + _parallel(async.eachOfSeries, tasks, callback); + }; + + async.iterator = function (tasks) { + function makeCallback(index) { + function fn() { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + } + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + } + return makeCallback(0); + }; + + async.apply = _restParam(function (fn, args) { + return _restParam(function (callArgs) { + return fn.apply( + null, args.concat(callArgs) + ); + }); + }); + + function _concat(eachfn, arr, fn, callback) { + var result = []; + eachfn(arr, function (x, index, cb) { + fn(x, function (err, y) { + result = result.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, result); + }); + } + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + callback = callback || noop; + if (test()) { + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else if (test.apply(this, args)) { + iterator(next); + } else { + callback(null); + } + }); + iterator(next); + } else { + callback(null); + } + }; + + async.doWhilst = function (iterator, test, callback) { + var calls = 0; + return async.whilst(function() { + return ++calls <= 1 || test.apply(this, arguments); + }, iterator, callback); + }; + + async.until = function (test, iterator, callback) { + return async.whilst(function() { + return !test.apply(this, arguments); + }, iterator, callback); + }; + + async.doUntil = function (iterator, test, callback) { + return async.doWhilst(iterator, function() { + return !test.apply(this, arguments); + }, callback); + }; + + async.during = function (test, iterator, callback) { + callback = callback || noop; + + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else { + args.push(check); + test.apply(this, args); + } + }); + + var check = function(err, truth) { + if (err) { + callback(err); + } else if (truth) { + iterator(next); + } else { + callback(null); + } + }; + + test(check); + }; + + async.doDuring = function (iterator, test, callback) { + var calls = 0; + async.during(function(next) { + if (calls++ < 1) { + next(null, true); + } else { + test.apply(this, arguments); + } + }, iterator, callback); + }; + + function _queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new Error('Concurrency must not be zero'); + } + function _insert(q, data, pos, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + callback: callback || noop + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + }); + async.setImmediate(q.process); + } + function _next(q, tasks) { + return function(){ + workers -= 1; + + var removed = false; + var args = arguments; + _arrayEach(tasks, function (task) { + _arrayEach(workersList, function (worker, index) { + if (worker === task && !removed) { + workersList.splice(index, 1); + removed = true; + } + }); + + task.callback.apply(task, args); + }); + if (q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + } + + var workers = 0; + var workersList = []; + var q = { + tasks: [], + concurrency: concurrency, + payload: payload, + saturated: noop, + empty: noop, + drain: noop, + started: false, + paused: false, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + kill: function () { + q.drain = noop; + q.tasks = []; + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + if (!q.paused && workers < q.concurrency && q.tasks.length) { + while(workers < q.concurrency && q.tasks.length){ + var tasks = q.payload ? + q.tasks.splice(0, q.payload) : + q.tasks.splice(0, q.tasks.length); + + var data = _map(tasks, function (task) { + return task.data; + }); + + if (q.tasks.length === 0) { + q.empty(); + } + workers += 1; + workersList.push(tasks[0]); + var cb = only_once(_next(q, tasks)); + worker(data, cb); + } + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + }, + workersList: function () { + return workersList; + }, + idle: function() { + return q.tasks.length + workers === 0; + }, + pause: function () { + q.paused = true; + }, + resume: function () { + if (q.paused === false) { return; } + q.paused = false; + var resumeCount = Math.min(q.concurrency, q.tasks.length); + // Need to call q.process once per concurrent + // worker to preserve full concurrency after pause + for (var w = 1; w <= resumeCount; w++) { + async.setImmediate(q.process); + } + } + }; + return q; + } + + async.queue = function (worker, concurrency) { + var q = _queue(function (items, cb) { + worker(items[0], cb); + }, concurrency, 1); + + return q; + }; + + async.priorityQueue = function (worker, concurrency) { + + function _compareTasks(a, b){ + return a.priority - b.priority; + } + + function _binarySearch(sequence, item, compare) { + var beg = -1, + end = sequence.length - 1; + while (beg < end) { + var mid = beg + ((end - beg + 1) >>> 1); + if (compare(item, sequence[mid]) >= 0) { + beg = mid; + } else { + end = mid - 1; + } + } + return beg; + } + + function _insert(q, data, priority, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + priority: priority, + callback: typeof callback === 'function' ? callback : noop + }; + + q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + // Start with a normal queue + var q = async.queue(worker, concurrency); + + // Override push to accept second parameter representing priority + q.push = function (data, priority, callback) { + _insert(q, data, priority, callback); + }; + + // Remove unshift function + delete q.unshift; + + return q; + }; + + async.cargo = function (worker, payload) { + return _queue(worker, 1, payload); + }; + + function _console_fn(name) { + return _restParam(function (fn, args) { + fn.apply(null, args.concat([_restParam(function (err, args) { + if (typeof console === 'object') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _arrayEach(args, function (x) { + console[name](x); + }); + } + } + })])); + }); + } + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + hasher = hasher || identity; + var memoized = _restParam(function memoized(args) { + var callback = args.pop(); + var key = hasher.apply(null, args); + if (key in memo) { + async.setImmediate(function () { + callback.apply(null, memo[key]); + }); + } + else if (key in queues) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([_restParam(function (args) { + memo[key] = args; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, args); + } + })])); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + function _times(mapper) { + return function (count, iterator, callback) { + mapper(_range(count), iterator, callback); + }; + } + + async.times = _times(async.map); + async.timesSeries = _times(async.mapSeries); + async.timesLimit = function (count, limit, iterator, callback) { + return async.mapLimit(_range(count), limit, iterator, callback); + }; + + async.seq = function (/* functions... */) { + var fns = arguments; + return _restParam(function (args) { + var that = this; + + var callback = args[args.length - 1]; + if (typeof callback == 'function') { + args.pop(); + } else { + callback = noop; + } + + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([_restParam(function (err, nextargs) { + cb(err, nextargs); + })])); + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }); + }; + + async.compose = function (/* functions... */) { + return async.seq.apply(null, Array.prototype.reverse.call(arguments)); + }; + + + function _applyEach(eachfn) { + return _restParam(function(fns, args) { + var go = _restParam(function(args) { + var that = this; + var callback = args.pop(); + return eachfn(fns, function (fn, _, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }); + if (args.length) { + return go.apply(this, args); + } + else { + return go; + } + }); + } + + async.applyEach = _applyEach(async.eachOf); + async.applyEachSeries = _applyEach(async.eachOfSeries); + + + async.forever = function (fn, callback) { + var done = only_once(callback || noop); + var task = ensureAsync(fn); + function next(err) { + if (err) { + return done(err); + } + task(next); + } + next(); + }; + + function ensureAsync(fn) { + return _restParam(function (args) { + var callback = args.pop(); + args.push(function () { + var innerArgs = arguments; + if (sync) { + async.setImmediate(function () { + callback.apply(null, innerArgs); + }); + } else { + callback.apply(null, innerArgs); + } + }); + var sync = true; + fn.apply(this, args); + sync = false; + }); + } + + async.ensureAsync = ensureAsync; + + async.constant = _restParam(function(values) { + var args = [null].concat(values); + return function (callback) { + return callback.apply(this, args); + }; + }); + + async.wrapSync = + async.asyncify = function asyncify(func) { + return _restParam(function (args) { + var callback = args.pop(); + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (_isObject(result) && typeof result.then === "function") { + result.then(function(value) { + callback(null, value); + })["catch"](function(err) { + callback(err.message ? err : new Error(err)); + }); + } else { + callback(null, result); + } + }); + }; + + // Node.js + if (typeof module === 'object' && module.exports) { + module.exports = async; + } + // AMD / RequireJS + else if (typeof define === 'function' && define.amd) { + define([], function () { + return async; + }); + } + // included directly via '); + expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e'); + done(); + }); + + it('encodes \' characters', function (done) { + + var encoded = Hoek.escapeJavaScript('something(\'param\')'); + expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29'); + done(); + }); + + it('encodes large unicode characters with the correct padding', function (done) { + + var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000)); + expect(encoded).to.equal('\\u0500\\u1000'); + done(); + }); + + it('doesn\'t throw an exception when passed null', function (done) { + + var encoded = Hoek.escapeJavaScript(null); + expect(encoded).to.equal(''); + done(); + }); +}); + +describe('escapeHtml()', function () { + + it('encodes / characters', function (done) { + + var encoded = Hoek.escapeHtml(''); + expect(encoded).to.equal('<script>alert(1)</script>'); + done(); + }); + + it('encodes < and > as named characters', function (done) { + + var encoded = Hoek.escapeHtml(' + + \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.js new file mode 100644 index 00000000..664c1b45 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.js @@ -0,0 +1,3 @@ +var BigInteger = require('./'); +var a = new BigInteger('91823918239182398123'); +console.log(a.bitLength()); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/index.js new file mode 100644 index 00000000..e32fe13d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/index.js @@ -0,0 +1,1358 @@ +(function(){ + + // Copyright (c) 2005 Tom Wu + // All Rights Reserved. + // See "LICENSE" for details. + + // Basic JavaScript BN library - subset useful for RSA encryption. + + // Bits per digit + var dbits; + + // JavaScript engine analysis + var canary = 0xdeadbeefcafe; + var j_lm = ((canary&0xffffff)==0xefcafe); + + // (public) Constructor + function BigInteger(a,b,c) { + if(a != null) + if("number" == typeof a) this.fromNumber(a,b,c); + else if(b == null && "string" != typeof a) this.fromString(a,256); + else this.fromString(a,b); + } + + // return new, unset BigInteger + function nbi() { return new BigInteger(null); } + + // am: Compute w_j += (x*this_i), propagate carries, + // c is initial carry, returns final carry. + // c < 3*dvalue, x < 2*dvalue, this_i < dvalue + // We need to select the fastest one that works in this environment. + + // am1: use a single mult and divide to get the high bits, + // max digit bits should be 26 because + // max internal value = 2*dvalue^2-2*dvalue (< 2^53) + function am1(i,x,w,j,c,n) { + while(--n >= 0) { + var v = x*this[i++]+w[j]+c; + c = Math.floor(v/0x4000000); + w[j++] = v&0x3ffffff; + } + return c; + } + // am2 avoids a big mult-and-extract completely. + // Max digit bits should be <= 30 because we do bitwise ops + // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31) + function am2(i,x,w,j,c,n) { + var xl = x&0x7fff, xh = x>>15; + while(--n >= 0) { + var l = this[i]&0x7fff; + var h = this[i++]>>15; + var m = xh*l+h*xl; + l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff); + c = (l>>>30)+(m>>>15)+xh*h+(c>>>30); + w[j++] = l&0x3fffffff; + } + return c; + } + // Alternately, set max digit bits to 28 since some + // browsers slow down when dealing with 32-bit numbers. + function am3(i,x,w,j,c,n) { + var xl = x&0x3fff, xh = x>>14; + while(--n >= 0) { + var l = this[i]&0x3fff; + var h = this[i++]>>14; + var m = xh*l+h*xl; + l = xl*l+((m&0x3fff)<<14)+w[j]+c; + c = (l>>28)+(m>>14)+xh*h; + w[j++] = l&0xfffffff; + } + return c; + } + var inBrowser = typeof navigator !== "undefined"; + if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) { + BigInteger.prototype.am = am2; + dbits = 30; + } + else if(inBrowser && j_lm && (navigator.appName != "Netscape")) { + BigInteger.prototype.am = am1; + dbits = 26; + } + else { // Mozilla/Netscape seems to prefer am3 + BigInteger.prototype.am = am3; + dbits = 28; + } + + BigInteger.prototype.DB = dbits; + BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i]; + r.t = this.t; + r.s = this.s; + } + + // (protected) set from integer value x, -DV <= x < DV + function bnpFromInt(x) { + this.t = 1; + this.s = (x<0)?-1:0; + if(x > 0) this[0] = x; + else if(x < -1) this[0] = x+this.DV; + else this.t = 0; + } + + // return bigint initialized to value + function nbv(i) { var r = nbi(); r.fromInt(i); return r; } + + // (protected) set from string and radix + function bnpFromString(s,b) { + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 256) k = 8; // byte array + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else { this.fromRadix(s,b); return; } + this.t = 0; + this.s = 0; + var i = s.length, mi = false, sh = 0; + while(--i >= 0) { + var x = (k==8)?s[i]&0xff:intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-") mi = true; + continue; + } + mi = false; + if(sh == 0) + this[this.t++] = x; + else if(sh+k > this.DB) { + this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh)); + } + else + this[this.t-1] |= x<= this.DB) sh -= this.DB; + } + if(k == 8 && (s[0]&0x80) != 0) { + this.s = -1; + if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t; + } + + // (public) return string representation in given radix + function bnToString(b) { + if(this.s < 0) return "-"+this.negate().toString(b); + var k; + if(b == 16) k = 4; + else if(b == 8) k = 3; + else if(b == 2) k = 1; + else if(b == 32) k = 5; + else if(b == 4) k = 2; + else return this.toRadix(b); + var km = (1< 0) { + if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); } + while(i >= 0) { + if(p < k) { + d = (this[i]&((1<>(p+=this.DB-k); + } + else { + d = (this[i]>>(p-=k))&km; + if(p <= 0) { p += this.DB; --i; } + } + if(d > 0) m = true; + if(m) r += int2char(d); + } + } + return m?r:"0"; + } + + // (public) -this + function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; } + + // (public) |this| + function bnAbs() { return (this.s<0)?this.negate():this; } + + // (public) return + if this > a, - if this < a, 0 if equal + function bnCompareTo(a) { + var r = this.s-a.s; + if(r != 0) return r; + var i = this.t; + r = i-a.t; + if(r != 0) return (this.s<0)?-r:r; + while(--i >= 0) if((r=this[i]-a[i]) != 0) return r; + return 0; + } + + // returns bit length of the integer x + function nbits(x) { + var r = 1, t; + if((t=x>>>16) != 0) { x = t; r += 16; } + if((t=x>>8) != 0) { x = t; r += 8; } + if((t=x>>4) != 0) { x = t; r += 4; } + if((t=x>>2) != 0) { x = t; r += 2; } + if((t=x>>1) != 0) { x = t; r += 1; } + return r; + } + + // (public) return the number of bits in "this" + function bnBitLength() { + if(this.t <= 0) return 0; + return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM)); + } + + // (protected) r = this << n*DB + function bnpDLShiftTo(n,r) { + var i; + for(i = this.t-1; i >= 0; --i) r[i+n] = this[i]; + for(i = n-1; i >= 0; --i) r[i] = 0; + r.t = this.t+n; + r.s = this.s; + } + + // (protected) r = this >> n*DB + function bnpDRShiftTo(n,r) { + for(var i = n; i < this.t; ++i) r[i-n] = this[i]; + r.t = Math.max(this.t-n,0); + r.s = this.s; + } + + // (protected) r = this << n + function bnpLShiftTo(n,r) { + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<= 0; --i) { + r[i+ds+1] = (this[i]>>cbs)|c; + c = (this[i]&bm)<= 0; --i) r[i] = 0; + r[ds] = c; + r.t = this.t+ds+1; + r.s = this.s; + r.clamp(); + } + + // (protected) r = this >> n + function bnpRShiftTo(n,r) { + r.s = this.s; + var ds = Math.floor(n/this.DB); + if(ds >= this.t) { r.t = 0; return; } + var bs = n%this.DB; + var cbs = this.DB-bs; + var bm = (1<>bs; + for(var i = ds+1; i < this.t; ++i) { + r[i-ds-1] |= (this[i]&bm)<>bs; + } + if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB; + } + if(a.t < this.t) { + c -= a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c -= a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c -= a.s; + } + r.s = (c<0)?-1:0; + if(c < -1) r[i++] = this.DV+c; + else if(c > 0) r[i++] = c; + r.t = i; + r.clamp(); + } + + // (protected) r = this * a, r != this,a (HAC 14.12) + // "this" should be the larger one if appropriate. + function bnpMultiplyTo(a,r) { + var x = this.abs(), y = a.abs(); + var i = x.t; + r.t = i+y.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t); + r.s = 0; + r.clamp(); + if(this.s != a.s) BigInteger.ZERO.subTo(r,r); + } + + // (protected) r = this^2, r != this (HAC 14.16) + function bnpSquareTo(r) { + var x = this.abs(); + var i = r.t = 2*x.t; + while(--i >= 0) r[i] = 0; + for(i = 0; i < x.t-1; ++i) { + var c = x.am(i,x[i],r,2*i,0,1); + if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) { + r[i+x.t] -= x.DV; + r[i+x.t+1] = 1; + } + } + if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1); + r.s = 0; + r.clamp(); + } + + // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20) + // r != q, this != m. q or r may be null. + function bnpDivRemTo(m,q,r) { + var pm = m.abs(); + if(pm.t <= 0) return; + var pt = this.abs(); + if(pt.t < pm.t) { + if(q != null) q.fromInt(0); + if(r != null) this.copyTo(r); + return; + } + if(r == null) r = nbi(); + var y = nbi(), ts = this.s, ms = m.s; + var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus + if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); } + else { pm.copyTo(y); pt.copyTo(r); } + var ys = y.t; + var y0 = y[ys-1]; + if(y0 == 0) return; + var yt = y0*(1<1)?y[ys-2]>>this.F2:0); + var d1 = this.FV/yt, d2 = (1<= 0) { + r[r.t++] = 1; + r.subTo(t,r); + } + BigInteger.ONE.dlShiftTo(ys,t); + t.subTo(y,y); // "negative" y so we can replace sub with am later + while(y.t < ys) y[y.t++] = 0; + while(--j >= 0) { + // Estimate quotient digit + var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2); + if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out + y.dlShiftTo(j,t); + r.subTo(t,r); + while(r[i] < --qd) r.subTo(t,r); + } + } + if(q != null) { + r.drShiftTo(ys,q); + if(ts != ms) BigInteger.ZERO.subTo(q,q); + } + r.t = ys; + r.clamp(); + if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder + if(ts < 0) BigInteger.ZERO.subTo(r,r); + } + + // (public) this mod a + function bnMod(a) { + var r = nbi(); + this.abs().divRemTo(a,null,r); + if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r); + return r; + } + + // Modular reduction using "classic" algorithm + function Classic(m) { this.m = m; } + function cConvert(x) { + if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; + } + function cRevert(x) { return x; } + function cReduce(x) { x.divRemTo(this.m,null,x); } + function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + Classic.prototype.convert = cConvert; + Classic.prototype.revert = cRevert; + Classic.prototype.reduce = cReduce; + Classic.prototype.mulTo = cMulTo; + Classic.prototype.sqrTo = cSqrTo; + + // (protected) return "-1/this % 2^DB"; useful for Mont. reduction + // justification: + // xy == 1 (mod m) + // xy = 1+km + // xy(2-xy) = (1+km)(1-km) + // x[y(2-xy)] = 1-k^2m^2 + // x[y(2-xy)] == 1 (mod m^2) + // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2 + // should reduce x and y(2-xy) by m^2 at each step to keep size bounded. + // JS multiply "overflows" differently from C/C++, so care is needed here. + function bnpInvDigit() { + if(this.t < 1) return 0; + var x = this[0]; + if((x&1) == 0) return 0; + var y = x&3; // y == 1/x mod 2^2 + y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4 + y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8 + y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16 + // last step - calculate inverse mod DV directly; + // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints + y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits + // we really want the negative inverse, and -DV < y < DV + return (y>0)?this.DV-y:-y; + } + + // Montgomery reduction + function Montgomery(m) { + this.m = m; + this.mp = m.invDigit(); + this.mpl = this.mp&0x7fff; + this.mph = this.mp>>15; + this.um = (1<<(m.DB-15))-1; + this.mt2 = 2*m.t; + } + + // xR mod m + function montConvert(x) { + var r = nbi(); + x.abs().dlShiftTo(this.m.t,r); + r.divRemTo(this.m,null,r); + if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r); + return r; + } + + // x/R mod m + function montRevert(x) { + var r = nbi(); + x.copyTo(r); + this.reduce(r); + return r; + } + + // x = x/R mod m (HAC 14.32) + function montReduce(x) { + while(x.t <= this.mt2) // pad x so am has enough room later + x[x.t++] = 0; + for(var i = 0; i < this.m.t; ++i) { + // faster way of calculating u0 = x[i]*mp mod DV + var j = x[i]&0x7fff; + var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM; + // use am to combine the multiply-shift-add into one call + j = i+this.m.t; + x[j] += this.m.am(0,u0,x,i,0,this.m.t); + // propagate carry + while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; } + } + x.clamp(); + x.drShiftTo(this.m.t,x); + if(x.compareTo(this.m) >= 0) x.subTo(this.m,x); + } + + // r = "x^2/R mod m"; x != r + function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + // r = "xy/R mod m"; x,y != r + function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + + Montgomery.prototype.convert = montConvert; + Montgomery.prototype.revert = montRevert; + Montgomery.prototype.reduce = montReduce; + Montgomery.prototype.mulTo = montMulTo; + Montgomery.prototype.sqrTo = montSqrTo; + + // (protected) true iff this is even + function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; } + + // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79) + function bnpExp(e,z) { + if(e > 0xffffffff || e < 1) return BigInteger.ONE; + var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1; + g.copyTo(r); + while(--i >= 0) { + z.sqrTo(r,r2); + if((e&(1< 0) z.mulTo(r2,g,r); + else { var t = r; r = r2; r2 = t; } + } + return z.revert(r); + } + + // (public) this^e % m, 0 <= e < 2^32 + function bnModPowInt(e,m) { + var z; + if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m); + return this.exp(e,z); + } + + // protected + BigInteger.prototype.copyTo = bnpCopyTo; + BigInteger.prototype.fromInt = bnpFromInt; + BigInteger.prototype.fromString = bnpFromString; + BigInteger.prototype.clamp = bnpClamp; + BigInteger.prototype.dlShiftTo = bnpDLShiftTo; + BigInteger.prototype.drShiftTo = bnpDRShiftTo; + BigInteger.prototype.lShiftTo = bnpLShiftTo; + BigInteger.prototype.rShiftTo = bnpRShiftTo; + BigInteger.prototype.subTo = bnpSubTo; + BigInteger.prototype.multiplyTo = bnpMultiplyTo; + BigInteger.prototype.squareTo = bnpSquareTo; + BigInteger.prototype.divRemTo = bnpDivRemTo; + BigInteger.prototype.invDigit = bnpInvDigit; + BigInteger.prototype.isEven = bnpIsEven; + BigInteger.prototype.exp = bnpExp; + + // public + BigInteger.prototype.toString = bnToString; + BigInteger.prototype.negate = bnNegate; + BigInteger.prototype.abs = bnAbs; + BigInteger.prototype.compareTo = bnCompareTo; + BigInteger.prototype.bitLength = bnBitLength; + BigInteger.prototype.mod = bnMod; + BigInteger.prototype.modPowInt = bnModPowInt; + + // "constants" + BigInteger.ZERO = nbv(0); + BigInteger.ONE = nbv(1); + + // Copyright (c) 2005-2009 Tom Wu + // All Rights Reserved. + // See "LICENSE" for details. + + // Extended JavaScript BN functions, required for RSA private ops. + + // Version 1.1: new BigInteger("0", 10) returns "proper" zero + // Version 1.2: square() API, isProbablePrime fix + + // (public) + function bnClone() { var r = nbi(); this.copyTo(r); return r; } + + // (public) return value as integer + function bnIntValue() { + if(this.s < 0) { + if(this.t == 1) return this[0]-this.DV; + else if(this.t == 0) return -1; + } + else if(this.t == 1) return this[0]; + else if(this.t == 0) return 0; + // assumes 16 < DB < 32 + return ((this[1]&((1<<(32-this.DB))-1))<>24; } + + // (public) return value as short (assumes DB>=16) + function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; } + + // (protected) return x s.t. r^x < DV + function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); } + + // (public) 0 if this == 0, 1 if this > 0 + function bnSigNum() { + if(this.s < 0) return -1; + else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0; + else return 1; + } + + // (protected) convert to radix string + function bnpToRadix(b) { + if(b == null) b = 10; + if(this.signum() == 0 || b < 2 || b > 36) return "0"; + var cs = this.chunkSize(b); + var a = Math.pow(b,cs); + var d = nbv(a), y = nbi(), z = nbi(), r = ""; + this.divRemTo(d,y,z); + while(y.signum() > 0) { + r = (a+z.intValue()).toString(b).substr(1) + r; + y.divRemTo(d,y,z); + } + return z.intValue().toString(b) + r; + } + + // (protected) convert from radix string + function bnpFromRadix(s,b) { + this.fromInt(0); + if(b == null) b = 10; + var cs = this.chunkSize(b); + var d = Math.pow(b,cs), mi = false, j = 0, w = 0; + for(var i = 0; i < s.length; ++i) { + var x = intAt(s,i); + if(x < 0) { + if(s.charAt(i) == "-" && this.signum() == 0) mi = true; + continue; + } + w = b*w+x; + if(++j >= cs) { + this.dMultiply(d); + this.dAddOffset(w,0); + j = 0; + w = 0; + } + } + if(j > 0) { + this.dMultiply(Math.pow(b,j)); + this.dAddOffset(w,0); + } + if(mi) BigInteger.ZERO.subTo(this,this); + } + + // (protected) alternate constructor + function bnpFromNumber(a,b,c) { + if("number" == typeof b) { + // new BigInteger(int,int,RNG) + if(a < 2) this.fromInt(1); + else { + this.fromNumber(a,c); + if(!this.testBit(a-1)) // force MSB set + this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this); + if(this.isEven()) this.dAddOffset(1,0); // force odd + while(!this.isProbablePrime(b)) { + this.dAddOffset(2,0); + if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this); + } + } + } + else { + // new BigInteger(int,RNG) + var x = new Array(), t = a&7; + x.length = (a>>3)+1; + b.nextBytes(x); + if(t > 0) x[0] &= ((1< 0) { + if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p) + r[k++] = d|(this.s<<(this.DB-p)); + while(i >= 0) { + if(p < 8) { + d = (this[i]&((1<>(p+=this.DB-8); + } + else { + d = (this[i]>>(p-=8))&0xff; + if(p <= 0) { p += this.DB; --i; } + } + if((d&0x80) != 0) d |= -256; + if(k == 0 && (this.s&0x80) != (d&0x80)) ++k; + if(k > 0 || d != this.s) r[k++] = d; + } + } + return r; + } + + function bnEquals(a) { return(this.compareTo(a)==0); } + function bnMin(a) { return(this.compareTo(a)<0)?this:a; } + function bnMax(a) { return(this.compareTo(a)>0)?this:a; } + + // (protected) r = this op a (bitwise) + function bnpBitwiseTo(a,op,r) { + var i, f, m = Math.min(a.t,this.t); + for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]); + if(a.t < this.t) { + f = a.s&this.DM; + for(i = m; i < this.t; ++i) r[i] = op(this[i],f); + r.t = this.t; + } + else { + f = this.s&this.DM; + for(i = m; i < a.t; ++i) r[i] = op(f,a[i]); + r.t = a.t; + } + r.s = op(this.s,a.s); + r.clamp(); + } + + // (public) this & a + function op_and(x,y) { return x&y; } + function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; } + + // (public) this | a + function op_or(x,y) { return x|y; } + function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; } + + // (public) this ^ a + function op_xor(x,y) { return x^y; } + function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; } + + // (public) this & ~a + function op_andnot(x,y) { return x&~y; } + function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; } + + // (public) ~this + function bnNot() { + var r = nbi(); + for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i]; + r.t = this.t; + r.s = ~this.s; + return r; + } + + // (public) this << n + function bnShiftLeft(n) { + var r = nbi(); + if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r); + return r; + } + + // (public) this >> n + function bnShiftRight(n) { + var r = nbi(); + if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r); + return r; + } + + // return index of lowest 1-bit in x, x < 2^31 + function lbit(x) { + if(x == 0) return -1; + var r = 0; + if((x&0xffff) == 0) { x >>= 16; r += 16; } + if((x&0xff) == 0) { x >>= 8; r += 8; } + if((x&0xf) == 0) { x >>= 4; r += 4; } + if((x&3) == 0) { x >>= 2; r += 2; } + if((x&1) == 0) ++r; + return r; + } + + // (public) returns index of lowest 1-bit (or -1 if none) + function bnGetLowestSetBit() { + for(var i = 0; i < this.t; ++i) + if(this[i] != 0) return i*this.DB+lbit(this[i]); + if(this.s < 0) return this.t*this.DB; + return -1; + } + + // return number of 1 bits in x + function cbit(x) { + var r = 0; + while(x != 0) { x &= x-1; ++r; } + return r; + } + + // (public) return number of set bits + function bnBitCount() { + var r = 0, x = this.s&this.DM; + for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x); + return r; + } + + // (public) true iff nth bit is set + function bnTestBit(n) { + var j = Math.floor(n/this.DB); + if(j >= this.t) return(this.s!=0); + return((this[j]&(1<<(n%this.DB)))!=0); + } + + // (protected) this op (1<>= this.DB; + } + if(a.t < this.t) { + c += a.s; + while(i < this.t) { + c += this[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += this.s; + } + else { + c += this.s; + while(i < a.t) { + c += a[i]; + r[i++] = c&this.DM; + c >>= this.DB; + } + c += a.s; + } + r.s = (c<0)?-1:0; + if(c > 0) r[i++] = c; + else if(c < -1) r[i++] = this.DV+c; + r.t = i; + r.clamp(); + } + + // (public) this + a + function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; } + + // (public) this - a + function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; } + + // (public) this * a + function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; } + + // (public) this^2 + function bnSquare() { var r = nbi(); this.squareTo(r); return r; } + + // (public) this / a + function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; } + + // (public) this % a + function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; } + + // (public) [this/a,this%a] + function bnDivideAndRemainder(a) { + var q = nbi(), r = nbi(); + this.divRemTo(a,q,r); + return new Array(q,r); + } + + // (protected) this *= n, this >= 0, 1 < n < DV + function bnpDMultiply(n) { + this[this.t] = this.am(0,n-1,this,0,0,this.t); + ++this.t; + this.clamp(); + } + + // (protected) this += n << w words, this >= 0 + function bnpDAddOffset(n,w) { + if(n == 0) return; + while(this.t <= w) this[this.t++] = 0; + this[w] += n; + while(this[w] >= this.DV) { + this[w] -= this.DV; + if(++w >= this.t) this[this.t++] = 0; + ++this[w]; + } + } + + // A "null" reducer + function NullExp() {} + function nNop(x) { return x; } + function nMulTo(x,y,r) { x.multiplyTo(y,r); } + function nSqrTo(x,r) { x.squareTo(r); } + + NullExp.prototype.convert = nNop; + NullExp.prototype.revert = nNop; + NullExp.prototype.mulTo = nMulTo; + NullExp.prototype.sqrTo = nSqrTo; + + // (public) this^e + function bnPow(e) { return this.exp(e,new NullExp()); } + + // (protected) r = lower n words of "this * a", a.t <= n + // "this" should be the larger one if appropriate. + function bnpMultiplyLowerTo(a,n,r) { + var i = Math.min(this.t+a.t,n); + r.s = 0; // assumes a,this >= 0 + r.t = i; + while(i > 0) r[--i] = 0; + var j; + for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t); + for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i); + r.clamp(); + } + + // (protected) r = "this * a" without lower n words, n > 0 + // "this" should be the larger one if appropriate. + function bnpMultiplyUpperTo(a,n,r) { + --n; + var i = r.t = this.t+a.t-n; + r.s = 0; // assumes a,this >= 0 + while(--i >= 0) r[i] = 0; + for(i = Math.max(n-this.t,0); i < a.t; ++i) + r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n); + r.clamp(); + r.drShiftTo(1,r); + } + + // Barrett modular reduction + function Barrett(m) { + // setup Barrett + this.r2 = nbi(); + this.q3 = nbi(); + BigInteger.ONE.dlShiftTo(2*m.t,this.r2); + this.mu = this.r2.divide(m); + this.m = m; + } + + function barrettConvert(x) { + if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m); + else if(x.compareTo(this.m) < 0) return x; + else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; } + } + + function barrettRevert(x) { return x; } + + // x = x mod m (HAC 14.42) + function barrettReduce(x) { + x.drShiftTo(this.m.t-1,this.r2); + if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); } + this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3); + this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2); + while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1); + x.subTo(this.r2,x); + while(x.compareTo(this.m) >= 0) x.subTo(this.m,x); + } + + // r = x^2 mod m; x != r + function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); } + + // r = x*y mod m; x,y != r + function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); } + + Barrett.prototype.convert = barrettConvert; + Barrett.prototype.revert = barrettRevert; + Barrett.prototype.reduce = barrettReduce; + Barrett.prototype.mulTo = barrettMulTo; + Barrett.prototype.sqrTo = barrettSqrTo; + + // (public) this^e % m (HAC 14.85) + function bnModPow(e,m) { + var i = e.bitLength(), k, r = nbv(1), z; + if(i <= 0) return r; + else if(i < 18) k = 1; + else if(i < 48) k = 3; + else if(i < 144) k = 4; + else if(i < 768) k = 5; + else k = 6; + if(i < 8) + z = new Classic(m); + else if(m.isEven()) + z = new Barrett(m); + else + z = new Montgomery(m); + + // precomputation + var g = new Array(), n = 3, k1 = k-1, km = (1< 1) { + var g2 = nbi(); + z.sqrTo(g[1],g2); + while(n <= km) { + g[n] = nbi(); + z.mulTo(g2,g[n-2],g[n]); + n += 2; + } + } + + var j = e.t-1, w, is1 = true, r2 = nbi(), t; + i = nbits(e[j])-1; + while(j >= 0) { + if(i >= k1) w = (e[j]>>(i-k1))&km; + else { + w = (e[j]&((1<<(i+1))-1))<<(k1-i); + if(j > 0) w |= e[j-1]>>(this.DB+i-k1); + } + + n = k; + while((w&1) == 0) { w >>= 1; --n; } + if((i -= n) < 0) { i += this.DB; --j; } + if(is1) { // ret == 1, don't bother squaring or multiplying it + g[w].copyTo(r); + is1 = false; + } + else { + while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; } + if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; } + z.mulTo(r2,g[w],r); + } + + while(j >= 0 && (e[j]&(1< 0) { + x.rShiftTo(g,x); + y.rShiftTo(g,y); + } + while(x.signum() > 0) { + if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x); + if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y); + if(x.compareTo(y) >= 0) { + x.subTo(y,x); + x.rShiftTo(1,x); + } + else { + y.subTo(x,y); + y.rShiftTo(1,y); + } + } + if(g > 0) y.lShiftTo(g,y); + return y; + } + + // (protected) this % n, n < 2^26 + function bnpModInt(n) { + if(n <= 0) return 0; + var d = this.DV%n, r = (this.s<0)?n-1:0; + if(this.t > 0) + if(d == 0) r = this[0]%n; + else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n; + return r; + } + + // (public) 1/this % m (HAC 14.61) + function bnModInverse(m) { + var ac = m.isEven(); + if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO; + var u = m.clone(), v = this.clone(); + var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); + while(u.signum() != 0) { + while(u.isEven()) { + u.rShiftTo(1,u); + if(ac) { + if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); } + a.rShiftTo(1,a); + } + else if(!b.isEven()) b.subTo(m,b); + b.rShiftTo(1,b); + } + while(v.isEven()) { + v.rShiftTo(1,v); + if(ac) { + if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); } + c.rShiftTo(1,c); + } + else if(!d.isEven()) d.subTo(m,d); + d.rShiftTo(1,d); + } + if(u.compareTo(v) >= 0) { + u.subTo(v,u); + if(ac) a.subTo(c,a); + b.subTo(d,b); + } + else { + v.subTo(u,v); + if(ac) c.subTo(a,c); + d.subTo(b,d); + } + } + if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO; + if(d.compareTo(m) >= 0) return d.subtract(m); + if(d.signum() < 0) d.addTo(m,d); else return d; + if(d.signum() < 0) return d.add(m); else return d; + } + + var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997]; + var lplim = (1<<26)/lowprimes[lowprimes.length-1]; + + // (public) test primality with certainty >= 1-.5^t + function bnIsProbablePrime(t) { + var i, x = this.abs(); + if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) { + for(i = 0; i < lowprimes.length; ++i) + if(x[0] == lowprimes[i]) return true; + return false; + } + if(x.isEven()) return false; + i = 1; + while(i < lowprimes.length) { + var m = lowprimes[i], j = i+1; + while(j < lowprimes.length && m < lplim) m *= lowprimes[j++]; + m = x.modInt(m); + while(i < j) if(m%lowprimes[i++] == 0) return false; + } + return x.millerRabin(t); + } + + // (protected) true if probably prime (HAC 4.24, Miller-Rabin) + function bnpMillerRabin(t) { + var n1 = this.subtract(BigInteger.ONE); + var k = n1.getLowestSetBit(); + if(k <= 0) return false; + var r = n1.shiftRight(k); + t = (t+1)>>1; + if(t > lowprimes.length) t = lowprimes.length; + var a = nbi(); + for(var i = 0; i < t; ++i) { + //Pick bases at random, instead of starting at 2 + a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]); + var y = a.modPow(r,this); + if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) { + var j = 1; + while(j++ < k && y.compareTo(n1) != 0) { + y = y.modPowInt(2,this); + if(y.compareTo(BigInteger.ONE) == 0) return false; + } + if(y.compareTo(n1) != 0) return false; + } + } + return true; + } + + // protected + BigInteger.prototype.chunkSize = bnpChunkSize; + BigInteger.prototype.toRadix = bnpToRadix; + BigInteger.prototype.fromRadix = bnpFromRadix; + BigInteger.prototype.fromNumber = bnpFromNumber; + BigInteger.prototype.bitwiseTo = bnpBitwiseTo; + BigInteger.prototype.changeBit = bnpChangeBit; + BigInteger.prototype.addTo = bnpAddTo; + BigInteger.prototype.dMultiply = bnpDMultiply; + BigInteger.prototype.dAddOffset = bnpDAddOffset; + BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo; + BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo; + BigInteger.prototype.modInt = bnpModInt; + BigInteger.prototype.millerRabin = bnpMillerRabin; + + // public + BigInteger.prototype.clone = bnClone; + BigInteger.prototype.intValue = bnIntValue; + BigInteger.prototype.byteValue = bnByteValue; + BigInteger.prototype.shortValue = bnShortValue; + BigInteger.prototype.signum = bnSigNum; + BigInteger.prototype.toByteArray = bnToByteArray; + BigInteger.prototype.equals = bnEquals; + BigInteger.prototype.min = bnMin; + BigInteger.prototype.max = bnMax; + BigInteger.prototype.and = bnAnd; + BigInteger.prototype.or = bnOr; + BigInteger.prototype.xor = bnXor; + BigInteger.prototype.andNot = bnAndNot; + BigInteger.prototype.not = bnNot; + BigInteger.prototype.shiftLeft = bnShiftLeft; + BigInteger.prototype.shiftRight = bnShiftRight; + BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit; + BigInteger.prototype.bitCount = bnBitCount; + BigInteger.prototype.testBit = bnTestBit; + BigInteger.prototype.setBit = bnSetBit; + BigInteger.prototype.clearBit = bnClearBit; + BigInteger.prototype.flipBit = bnFlipBit; + BigInteger.prototype.add = bnAdd; + BigInteger.prototype.subtract = bnSubtract; + BigInteger.prototype.multiply = bnMultiply; + BigInteger.prototype.divide = bnDivide; + BigInteger.prototype.remainder = bnRemainder; + BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder; + BigInteger.prototype.modPow = bnModPow; + BigInteger.prototype.modInverse = bnModInverse; + BigInteger.prototype.pow = bnPow; + BigInteger.prototype.gcd = bnGCD; + BigInteger.prototype.isProbablePrime = bnIsProbablePrime; + + // JSBN-specific extension + BigInteger.prototype.square = bnSquare; + + // Expose the Barrett function + BigInteger.prototype.Barrett = Barrett + + // BigInteger interfaces not implemented in jsbn: + + // BigInteger(int signum, byte[] magnitude) + // double doubleValue() + // float floatValue() + // int hashCode() + // long longValue() + // static BigInteger valueOf(long val) + + // Random number generator - requires a PRNG backend, e.g. prng4.js + + // For best results, put code like + // + // in your main HTML document. + + var rng_state; + var rng_pool; + var rng_pptr; + + // Mix in a 32-bit integer into the pool + function rng_seed_int(x) { + rng_pool[rng_pptr++] ^= x & 255; + rng_pool[rng_pptr++] ^= (x >> 8) & 255; + rng_pool[rng_pptr++] ^= (x >> 16) & 255; + rng_pool[rng_pptr++] ^= (x >> 24) & 255; + if(rng_pptr >= rng_psize) rng_pptr -= rng_psize; + } + + // Mix in the current time (w/milliseconds) into the pool + function rng_seed_time() { + rng_seed_int(new Date().getTime()); + } + + // Initialize the pool with junk if needed. + if(rng_pool == null) { + rng_pool = new Array(); + rng_pptr = 0; + var t; + if(typeof window !== "undefined" && window.crypto) { + if (window.crypto.getRandomValues) { + // Use webcrypto if available + var ua = new Uint8Array(32); + window.crypto.getRandomValues(ua); + for(t = 0; t < 32; ++t) + rng_pool[rng_pptr++] = ua[t]; + } + else if(navigator.appName == "Netscape" && navigator.appVersion < "5") { + // Extract entropy (256 bits) from NS4 RNG if available + var z = window.crypto.random(32); + for(t = 0; t < z.length; ++t) + rng_pool[rng_pptr++] = z.charCodeAt(t) & 255; + } + } + while(rng_pptr < rng_psize) { // extract some randomness from Math.random() + t = Math.floor(65536 * Math.random()); + rng_pool[rng_pptr++] = t >>> 8; + rng_pool[rng_pptr++] = t & 255; + } + rng_pptr = 0; + rng_seed_time(); + //rng_seed_int(window.screenX); + //rng_seed_int(window.screenY); + } + + function rng_get_byte() { + if(rng_state == null) { + rng_seed_time(); + rng_state = prng_newstate(); + rng_state.init(rng_pool); + for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) + rng_pool[rng_pptr] = 0; + rng_pptr = 0; + //rng_pool = null; + } + // TODO: allow reseeding after first request + return rng_state.next(); + } + + function rng_get_bytes(ba) { + var i; + for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); + } + + function SecureRandom() {} + + SecureRandom.prototype.nextBytes = rng_get_bytes; + + // prng4.js - uses Arcfour as a PRNG + + function Arcfour() { + this.i = 0; + this.j = 0; + this.S = new Array(); + } + + // Initialize arcfour context from key, an array of ints, each from [0..255] + function ARC4init(key) { + var i, j, t; + for(i = 0; i < 256; ++i) + this.S[i] = i; + j = 0; + for(i = 0; i < 256; ++i) { + j = (j + this.S[i] + key[i % key.length]) & 255; + t = this.S[i]; + this.S[i] = this.S[j]; + this.S[j] = t; + } + this.i = 0; + this.j = 0; + } + + function ARC4next() { + var t; + this.i = (this.i + 1) & 255; + this.j = (this.j + this.S[this.i]) & 255; + t = this.S[this.i]; + this.S[this.i] = this.S[this.j]; + this.S[this.j] = t; + return this.S[(t + this.S[this.i]) & 255]; + } + + Arcfour.prototype.init = ARC4init; + Arcfour.prototype.next = ARC4next; + + // Plug in your RNG constructor here + function prng_newstate() { + return new Arcfour(); + } + + // Pool size must be a multiple of 4 and greater than 32. + // An array of bytes the size of the pool will be passed to init() + var rng_psize = 256; + + if (typeof exports !== 'undefined') { + exports = module.exports = { + BigInteger: BigInteger, + SecureRandom: SecureRandom, + }; + } else { + this.BigInteger = BigInteger; + this.SecureRandom = SecureRandom; + } + +}).call(this); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json new file mode 100644 index 00000000..ffac6c28 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json @@ -0,0 +1,50 @@ +{ + "name": "jsbn", + "version": "0.1.0", + "description": "The jsbn library is a fast, portable implementation of large-number math in pure JavaScript, enabling public-key crypto and other applications on desktop and mobile browsers.", + "main": "index.js", + "scripts": { + "test": "mocha test.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/andyperlitch/jsbn.git" + }, + "keywords": [ + "biginteger", + "bignumber", + "big", + "integer" + ], + "author": { + "name": "Tom Wu" + }, + "license": "BSD", + "gitHead": "148a967b112806e63ddeeed78ee7938eef74c84a", + "bugs": { + "url": "https://github.com/andyperlitch/jsbn/issues" + }, + "homepage": "https://github.com/andyperlitch/jsbn", + "_id": "jsbn@0.1.0", + "_shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", + "_from": "jsbn@>=0.1.0 <0.2.0", + "_npmVersion": "2.7.4", + "_nodeVersion": "0.12.2", + "_npmUser": { + "name": "andyperlitch", + "email": "andyperlitch@gmail.com" + }, + "dist": { + "shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", + "tarball": "http://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + }, + "maintainers": [ + { + "name": "andyperlitch", + "email": "andyperlitch@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/.npmignore new file mode 100644 index 00000000..7d98dcbd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/.npmignore @@ -0,0 +1,4 @@ +.eslintrc +.travis.yml +bower.json +test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md new file mode 100644 index 00000000..77c69bd5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md @@ -0,0 +1,128 @@ +TweetNaCl.js Changelog +====================== + + +v0.13.2 +------- + +* Fixed undefined variable bug in fast version of Poly1305. No worries, this + bug was *never* triggered. + +* Specified CC0 public domain dedication. + +* Updated development dependencies. + + +v0.13.1 +------- + +* Exclude `crypto` and `buffer` modules from browserify builds. + + +v0.13.0 +------- + +* Made `nacl-fast` the default version in NPM package. Now + `require("tweetnacl")` will use fast version; to get the original version, + use `require("tweetnacl/nacl.js")`. + +* Cleanup temporary array after generating random bytes. + + +v0.12.2 +------- + +* Improved performance of curve operations, making `nacl.scalarMult`, `nacl.box`, + `nacl.sign` and related functions up to 3x faster in `nacl-fast` version. + + +v0.12.1 +------- + +* Significantly improved performance of Salsa20 (~1.5x faster) and + Poly1305 (~3.5x faster) in `nacl-fast` version. + + +v0.12.0 +------- + +* Instead of using the given secret key directly, TweetNaCl.js now copies it to + a new array in `nacl.box.keyPair.fromSecretKey` and + `nacl.sign.keyPair.fromSecretKey`. + + +v0.11.2 +------- + +* Added new constant: `nacl.sign.seedLength`. + + +v0.11.1 +------- + +* Even faster hash for both short and long inputs (in `nacl-fast`). + + +v0.11.0 +------- + +* Implement `nacl.sign.keyPair.fromSeed` to enable creation of sign key pairs + deterministically from a 32-byte seed. (It behaves like + [libsodium's](http://doc.libsodium.org/public-key_cryptography/public-key_signatures.html) + `crypto_sign_seed_keypair`: the seed becomes a secret part of the secret key.) + +* Fast version now has an improved hash implementation that is 2x-5x faster. + +* Fixed benchmarks, which may have produced incorrect measurements. + + +v0.10.1 +------- + +* Exported undocumented `nacl.lowlevel.crypto_core_hsalsa20`. + + +v0.10.0 +------- + +* **Signature API breaking change!** `nacl.sign` and `nacl.sign.open` now deal + with signed messages, and new `nacl.sign.detached` and + `nacl.sign.detached.verify` are available. + + Previously, `nacl.sign` returned a signature, and `nacl.sign.open` accepted a + message and "detached" signature. This was unlike NaCl's API, which dealt with + signed messages (concatenation of signature and message). + + The new API is: + + nacl.sign(message, secretKey) -> signedMessage + nacl.sign.open(signedMessage, publicKey) -> message | null + + Since detached signatures are common, two new API functions were introduced: + + nacl.sign.detached(message, secretKey) -> signature + nacl.sign.detached.verify(message, signature, publicKey) -> true | false + + (Note that it's `verify`, not `open`, and it returns a boolean value, unlike + `open`, which returns an "unsigned" message.) + +* NPM package now comes without `test` directory to keep it small. + + +v0.9.2 +------ + +* Improved documentation. +* Fast version: increased theoretical message size limit from 2^32-1 to 2^52 + bytes in Poly1305 (and thus, secretbox and box). However this has no impact + in practice since JavaScript arrays or ArrayBuffers are limited to 32-bit + indexes, and most implementations won't allocate more than a gigabyte or so. + (Obviously, there are no tests for the correctness of implementation.) Also, + it's not recommended to use messages that large without splitting them into + smaller packets anyway. + + +v0.9.1 +------ + +* Initial release diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md new file mode 100644 index 00000000..c40721d5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md @@ -0,0 +1,463 @@ +TweetNaCl.js +============ + +Port of [TweetNaCl](http://tweetnacl.cr.yp.to) / [NaCl](http://nacl.cr.yp.to/) +to JavaScript for modern browsers and Node.js. Public domain. + +[![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master) +](https://travis-ci.org/dchest/tweetnacl-js) + +[Demo](https://dchest.github.io/tweetnacl-js/) + +**:warning: Beta version. The library is stable and API is frozen, however +it has not been independently reviewed. If you can help reviewing it, please +[contact me](mailto:dmitry@codingrobots.com).** + +Documentation +============= + +* [Overview](#overview) +* [Installation](#installation) +* [Usage](#usage) + * [Public-key authenticated encryption (box)](#public-key-authenticated-encryption-box) + * [Secret-key authenticated encryption (secretbox)](#secret-key-authenticated-encryption-secretbox) + * [Scalar multiplication](#scalar-multiplication) + * [Signatures](#signatures) + * [Hashing](#hashing) + * [Random bytes generation](#random-bytes-generation) + * [Constant-time comparison](#constant-time-comparison) + * [Utilities](#utilities) +* [Examples](#examples) +* [System requirements](#system-requirements) +* [Development and testing](#development-and-testing) +* [Contributors](#contributors) +* [Who uses it](#who-uses-it) + + +Overview +-------- + +The primary goal of this project is to produce a translation of TweetNaCl to +JavaScript which is as close as possible to the original C implementation, plus +a thin layer of idiomatic high-level API on top of it. + +There are two versions, you can use either of them: + +* `nacl.js` is the port of TweetNaCl with minimum differences from the + original + high-level API. + +* `nacl-fast.js` is like `nacl.js`, but with some functions replaced with + faster versions. + + +Installation +------------ + +You can install TweetNaCl.is via a package manager: + +[Bower](http://bower.io): + + $ bower install tweetnacl + +[NPM](https://www.npmjs.org/): + + $ npm install tweetnacl + +or [download source code](https://github.com/dchest/tweetnacl-js/releases). + + +Usage +------ + +All API functions accept and return bytes as `Uint8Array`s. If you need to +encode or decode strings, use functions from `nacl.util` namespace. + +### Public-key authenticated encryption (box) + +Implements *curve25519-xsalsa20-poly1305*. + +#### nacl.box.keyPair() + +Generates a new random key pair for box and returns it as an object with +`publicKey` and `secretKey` members: + + { + publicKey: ..., // Uint8Array with 32-byte public key + secretKey: ... // Uint8Array with 32-byte secret key + } + + +#### nacl.box.keyPair.fromSecretKey(secretKey) + +Returns a key pair for box with public key corresponding to the given secret +key. + +#### nacl.box(message, nonce, theirPublicKey, mySecretKey) + +Encrypt and authenticates message using peer's public key, our secret key, and +the given nonce, which must be unique for each distinct message for a key pair. + +Returns an encrypted and authenticated message, which is +`nacl.box.overheadLength` longer than the original message. + +#### nacl.box.open(box, nonce, theirPublicKey, mySecretKey) + +Authenticates and decrypts the given box with peer's public key, our secret +key, and the given nonce. + +Returns the original message, or `false` if authentication fails. + +#### nacl.box.before(theirPublicKey, mySecretKey) + +Returns a precomputed shared key which can be used in `nacl.box.after` and +`nacl.box.open.after`. + +#### nacl.box.after(message, nonce, sharedKey) + +Same as `nacl.box`, but uses a shared key precomputed with `nacl.box.before`. + +#### nacl.box.open.after(box, nonce, sharedKey) + +Same as `nacl.box.open`, but uses a shared key precomputed with `nacl.box.before`. + +#### nacl.box.publicKeyLength = 32 + +Length of public key in bytes. + +#### nacl.box.secretKeyLength = 32 + +Length of secret key in bytes. + +#### nacl.box.sharedKeyLength = 32 + +Length of precomputed shared key in bytes. + +#### nacl.box.nonceLength = 24 + +Length of nonce in bytes. + +#### nacl.box.overheadLength = 16 + +Length of overhead added to box compared to original message. + + +### Secret-key authenticated encryption (secretbox) + +Implements *xsalsa20-poly1305*. + +#### nacl.secretbox(message, nonce, key) + +Encrypt and authenticates message using the key and the nonce. The nonce must +be unique for each distinct message for this key. + +Returns an encrypted and authenticated message, which is +`nacl.secretbox.overheadLength` longer than the original message. + +#### nacl.secretbox.open(box, nonce, key) + +Authenticates and decrypts the given secret box using the key and the nonce. + +Returns the original message, or `false` if authentication fails. + +#### nacl.secretbox.keyLength = 32 + +Length of key in bytes. + +#### nacl.secretbox.nonceLength = 24 + +Length of nonce in bytes. + +#### nacl.secretbox.overheadLength = 16 + +Length of overhead added to secret box compared to original message. + + +### Scalar multiplication + +Implements *curve25519*. + +#### nacl.scalarMult(n, p) + +Multiplies an integer `n` by a group element `p` and returns the resulting +group element. + +#### nacl.scalarMult.base(n) + +Multiplies an integer `n` by a standard group element and returns the resulting +group element. + +#### nacl.scalarMult.scalarLength = 32 + +Length of scalar in bytes. + +#### nacl.scalarMult.groupElementLength = 32 + +Length of group element in bytes. + + +### Signatures + +Implements [ed25519](http://ed25519.cr.yp.to). + +#### nacl.sign.keyPair() + +Generates new random key pair for signing and returns it as an object with +`publicKey` and `secretKey` members: + + { + publicKey: ..., // Uint8Array with 32-byte public key + secretKey: ... // Uint8Array with 64-byte secret key + } + +#### nacl.sign.keyPair.fromSecretKey(secretKey) + +Returns a signing key pair with public key corresponding to the given +64-byte secret key. The secret key must have been generated by +`nacl.sign.keyPair` or `nacl.sign.keyPair.fromSeed`. + +#### nacl.sign.keyPair.fromSeed(seed) + +Returns a new signing key pair generated deterministically from a 32-byte seed. +The seed must contain enough entropy to be secure. This method is not +recommended for general use: instead, use `nacl.sign.keyPair` to generate a new +key pair from a random seed. + +#### nacl.sign(message, secretKey) + +Signs the message using the secret key and returns a signed message. + +#### nacl.sign.open(signedMessage, publicKey) + +Verifies the signed message and returns the message without signature. + +Returns `null` if verification failed. + +#### nacl.sign.detached(message, secretKey) + +Signs the message using the secret key and returns a signature. + +#### nacl.sign.detached.verify(message, signature, publicKey) + +Verifies the signature for the message and returns `true` if verification +succeeded or `false` if it failed. + +#### nacl.sign.publicKeyLength = 32 + +Length of signing public key in bytes. + +#### nacl.sign.secretKeyLength = 64 + +Length of signing secret key in bytes. + +#### nacl.sign.seedLength = 32 + +Length of seed for `nacl.sign.keyPair.fromSeed` in bytes. + +#### nacl.sign.signatureLength = 64 + +Length of signature in bytes. + + +### Hashing + +Implements *SHA-512*. + +#### nacl.hash(message) + +Returns SHA-512 hash of the message. + +#### nacl.hash.hashLength = 64 + +Length of hash in bytes. + + +### Random bytes generation + +#### nacl.randomBytes(length) + +Returns a `Uint8Array` of the given length containing random bytes of +cryptographic quality. + +**Implementation note** + +TweetNaCl.js uses the following methods to generate random bytes, +depending on the platform it runs on: + +* `window.crypto.getRandomValues` (WebCrypto standard) +* `window.msCrypto.getRandomValues` (Internet Explorer 11) +* `crypto.randomBytes` (Node.js) + +Note that browsers are required to throw `QuotaExceededError` exception if +requested `length` is more than 65536, so do not ask for more than 65536 bytes +in *one call* (multiple calls to get as many bytes as you like are okay: +browsers can generate infinite amount of random bytes without any bad +consequences). + +If the platform doesn't provide a suitable PRNG, the following functions, +which require random numbers, will throw exception: + +* `nacl.randomBytes` +* `nacl.box.keyPair` +* `nacl.sign.keyPair` + +Other functions are deterministic and will continue working. + +If a platform you are targeting doesn't implement secure random number +generator, but you somehow have a cryptographically-strong source of entropy +(not `Math.random`!), and you know what you are doing, you can plug it into +TweetNaCl.js like this: + + nacl.setPRNG(function(x, n) { + // ... copy n random bytes into x ... + }); + +Note that `nacl.setPRNG` *completely replaces* internal random byte generator +with the one provided. + + +### Constant-time comparison + +#### nacl.verify(x, y) + +Compares `x` and `y` in constant time and returns `true` if their lengths are +non-zero and equal, and their contents are equal. + +Returns `false` if either of the arguments has zero length, or arguments have +different lengths, or their contents differ. + + +### Utilities + +Encoding/decoding functions are provided for convenience. They are correct, +however their performance and wide compatibility with uncommon runtimes is not +something that is considered important compared to the simplicity and size of +implementation. You can use third-party libraries if you need to. + +#### nacl.util.decodeUTF8(string) + +Decodes string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeUTF8(array) + +Encodes `Uint8Array` or `Array` of bytes into string. + +#### nacl.util.decodeBase64(string) + +Decodes Base-64 encoded string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeBase64(array) + +Encodes `Uint8Array` or `Array` of bytes into string using Base-64 encoding. + + +System requirements +------------------- + +TweetNaCl.js supports modern browsers that have a cryptographically secure +pseudorandom number generator and typed arrays, including the latest versions +of: + +* Chrome +* Firefox +* Safari (Mac, iOS) +* Internet Explorer 11 + +Other systems: + +* Node.js (we test on 0.10 and later) + + +Development and testing +------------------------ + +Install NPM modules needed for development: + + $ npm install + +To build minified versions: + + $ npm run build + +Tests use minified version, so make sure to rebuild it every time you change +`nacl.js` or `nacl-fast.js`. + +### Testing + +To run tests in Node.js: + + $ npm test + +By default all tests described here work on `nacl.min.js`. To test other +versions, set environment variable `NACL_SRC` to the file name you want to test. +For example, the following command will test fast minified version: + + $ NACL_SRC=nacl-fast.min.js npm test + +To run full suite of tests in Node.js, including comparing outputs of +JavaScript port to outputs of the original C version: + + $ npm run testall + +To prepare tests for browsers: + + $ npm run browser + +and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to +run them. + +To run headless browser tests with `testling`: + + $ npm run testling + +(If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.) + +### Benchmarking + +To run benchmarks in Node.js: + + $ npm run bench + $ NACL_SRC=nacl-fast.min.js npm run bench + +To run benchmarks in a browser, open `test/benchmark/bench.html` (or +`test/benchmark/bench-fast.html`). + + +Contributors +------------ + +JavaScript port: + + * [Dmitry Chestnykh](http://github.com/dchest) (ported xsalsa20, poly1305, curve25519) + * [Devi Mandiri](https://github.com/devi) (ported curve25519, ed25519, sha512) + +Original authors of [NaCl](http://nacl.cr.yp.to), [TweetNaCl](http://tweetnacl.cr.yp.to) +and [Poly1305-donna](https://github.com/floodyberry/poly1305-donna) +(who are *not* responsible for any errors in this implementation): + + * [Daniel J. Bernstein](http://cr.yp.to/djb.html) + * Wesley Janssen + * [Tanja Lange](http://hyperelliptic.org/tanja) + * [Peter Schwabe](http://www.cryptojedi.org/users/peter/) + * [Matthew Dempsky](https://github.com/mdempsky) + * [Andrew Moon](https://github.com/floodyberry) + +Contributors have dedicated their work to the public domain. + +This software is distributed without any warranty. + + +Third-party libraries based on TweetNaCl.js +------------------------------------------- + +* [forward-secrecy](https://github.com/alax/forward-secrecy) — Axolotl ratchet implementation +* [nacl-stream](https://github.com/dchest/nacl-stream-js) - streaming encryption +* [tweetnacl-auth-js](https://github.com/dchest/tweetnacl-auth-js) — implementation of [`crypto_auth`](http://nacl.cr.yp.to/auth.html) + + +Who uses it +----------- + +Some notable users of TweetNaCl.js: + +* [miniLock](http://minilock.io/) +* [Stellar](https://www.stellar.org/) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js new file mode 100644 index 00000000..6c499584 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js @@ -0,0 +1,2418 @@ +(function(nacl) { +'use strict'; + +// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. +// Public domain. +// +// Implementation derived from TweetNaCl version 20140427. +// See for details: http://tweetnacl.cr.yp.to/ + +var gf = function(init) { + var i, r = new Float64Array(16); + if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; + return r; +}; + +// Pluggable, initialized in high-level API below. +var randombytes = function(/* x, n */) { throw new Error('no PRNG'); }; + +var _0 = new Uint8Array(16); +var _9 = new Uint8Array(32); _9[0] = 9; + +var gf0 = gf(), + gf1 = gf([1]), + _121665 = gf([0xdb41, 1]), + D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]), + D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]), + X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]), + Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]), + I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); + +function ts64(x, i, h, l) { + x[i] = (h >> 24) & 0xff; + x[i+1] = (h >> 16) & 0xff; + x[i+2] = (h >> 8) & 0xff; + x[i+3] = h & 0xff; + x[i+4] = (l >> 24) & 0xff; + x[i+5] = (l >> 16) & 0xff; + x[i+6] = (l >> 8) & 0xff; + x[i+7] = l & 0xff; +} + +function vn(x, xi, y, yi, n) { + var i,d = 0; + for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i]; + return (1 & ((d - 1) >>> 8)) - 1; +} + +function crypto_verify_16(x, xi, y, yi) { + return vn(x,xi,y,yi,16); +} + +function crypto_verify_32(x, xi, y, yi) { + return vn(x,xi,y,yi,32); +} + +function core_salsa20(o, p, k, c) { + var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, + j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, + j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, + j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, + j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, + j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, + j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, + j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, + j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, + j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, + j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, + j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, + j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, + j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, + j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, + j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; + + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, + x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, + x15 = j15, u; + + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u<<7 | u>>>(32-7); + u = x4 + x0 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x4 | 0; + x12 ^= u<<13 | u>>>(32-13); + u = x12 + x8 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x1 | 0; + x9 ^= u<<7 | u>>>(32-7); + u = x9 + x5 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x9 | 0; + x1 ^= u<<13 | u>>>(32-13); + u = x1 + x13 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x6 | 0; + x14 ^= u<<7 | u>>>(32-7); + u = x14 + x10 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x14 | 0; + x6 ^= u<<13 | u>>>(32-13); + u = x6 + x2 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x11 | 0; + x3 ^= u<<7 | u>>>(32-7); + u = x3 + x15 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x3 | 0; + x11 ^= u<<13 | u>>>(32-13); + u = x11 + x7 | 0; + x15 ^= u<<18 | u>>>(32-18); + + u = x0 + x3 | 0; + x1 ^= u<<7 | u>>>(32-7); + u = x1 + x0 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x1 | 0; + x3 ^= u<<13 | u>>>(32-13); + u = x3 + x2 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x4 | 0; + x6 ^= u<<7 | u>>>(32-7); + u = x6 + x5 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x6 | 0; + x4 ^= u<<13 | u>>>(32-13); + u = x4 + x7 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x9 | 0; + x11 ^= u<<7 | u>>>(32-7); + u = x11 + x10 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x11 | 0; + x9 ^= u<<13 | u>>>(32-13); + u = x9 + x8 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x14 | 0; + x12 ^= u<<7 | u>>>(32-7); + u = x12 + x15 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x12 | 0; + x14 ^= u<<13 | u>>>(32-13); + u = x14 + x13 | 0; + x15 ^= u<<18 | u>>>(32-18); + } + x0 = x0 + j0 | 0; + x1 = x1 + j1 | 0; + x2 = x2 + j2 | 0; + x3 = x3 + j3 | 0; + x4 = x4 + j4 | 0; + x5 = x5 + j5 | 0; + x6 = x6 + j6 | 0; + x7 = x7 + j7 | 0; + x8 = x8 + j8 | 0; + x9 = x9 + j9 | 0; + x10 = x10 + j10 | 0; + x11 = x11 + j11 | 0; + x12 = x12 + j12 | 0; + x13 = x13 + j13 | 0; + x14 = x14 + j14 | 0; + x15 = x15 + j15 | 0; + + o[ 0] = x0 >>> 0 & 0xff; + o[ 1] = x0 >>> 8 & 0xff; + o[ 2] = x0 >>> 16 & 0xff; + o[ 3] = x0 >>> 24 & 0xff; + + o[ 4] = x1 >>> 0 & 0xff; + o[ 5] = x1 >>> 8 & 0xff; + o[ 6] = x1 >>> 16 & 0xff; + o[ 7] = x1 >>> 24 & 0xff; + + o[ 8] = x2 >>> 0 & 0xff; + o[ 9] = x2 >>> 8 & 0xff; + o[10] = x2 >>> 16 & 0xff; + o[11] = x2 >>> 24 & 0xff; + + o[12] = x3 >>> 0 & 0xff; + o[13] = x3 >>> 8 & 0xff; + o[14] = x3 >>> 16 & 0xff; + o[15] = x3 >>> 24 & 0xff; + + o[16] = x4 >>> 0 & 0xff; + o[17] = x4 >>> 8 & 0xff; + o[18] = x4 >>> 16 & 0xff; + o[19] = x4 >>> 24 & 0xff; + + o[20] = x5 >>> 0 & 0xff; + o[21] = x5 >>> 8 & 0xff; + o[22] = x5 >>> 16 & 0xff; + o[23] = x5 >>> 24 & 0xff; + + o[24] = x6 >>> 0 & 0xff; + o[25] = x6 >>> 8 & 0xff; + o[26] = x6 >>> 16 & 0xff; + o[27] = x6 >>> 24 & 0xff; + + o[28] = x7 >>> 0 & 0xff; + o[29] = x7 >>> 8 & 0xff; + o[30] = x7 >>> 16 & 0xff; + o[31] = x7 >>> 24 & 0xff; + + o[32] = x8 >>> 0 & 0xff; + o[33] = x8 >>> 8 & 0xff; + o[34] = x8 >>> 16 & 0xff; + o[35] = x8 >>> 24 & 0xff; + + o[36] = x9 >>> 0 & 0xff; + o[37] = x9 >>> 8 & 0xff; + o[38] = x9 >>> 16 & 0xff; + o[39] = x9 >>> 24 & 0xff; + + o[40] = x10 >>> 0 & 0xff; + o[41] = x10 >>> 8 & 0xff; + o[42] = x10 >>> 16 & 0xff; + o[43] = x10 >>> 24 & 0xff; + + o[44] = x11 >>> 0 & 0xff; + o[45] = x11 >>> 8 & 0xff; + o[46] = x11 >>> 16 & 0xff; + o[47] = x11 >>> 24 & 0xff; + + o[48] = x12 >>> 0 & 0xff; + o[49] = x12 >>> 8 & 0xff; + o[50] = x12 >>> 16 & 0xff; + o[51] = x12 >>> 24 & 0xff; + + o[52] = x13 >>> 0 & 0xff; + o[53] = x13 >>> 8 & 0xff; + o[54] = x13 >>> 16 & 0xff; + o[55] = x13 >>> 24 & 0xff; + + o[56] = x14 >>> 0 & 0xff; + o[57] = x14 >>> 8 & 0xff; + o[58] = x14 >>> 16 & 0xff; + o[59] = x14 >>> 24 & 0xff; + + o[60] = x15 >>> 0 & 0xff; + o[61] = x15 >>> 8 & 0xff; + o[62] = x15 >>> 16 & 0xff; + o[63] = x15 >>> 24 & 0xff; +} + +function core_hsalsa20(o,p,k,c) { + var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24, + j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24, + j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24, + j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24, + j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24, + j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24, + j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24, + j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24, + j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24, + j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24, + j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24, + j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24, + j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24, + j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24, + j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24, + j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24; + + var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, + x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, + x15 = j15, u; + + for (var i = 0; i < 20; i += 2) { + u = x0 + x12 | 0; + x4 ^= u<<7 | u>>>(32-7); + u = x4 + x0 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x4 | 0; + x12 ^= u<<13 | u>>>(32-13); + u = x12 + x8 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x1 | 0; + x9 ^= u<<7 | u>>>(32-7); + u = x9 + x5 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x9 | 0; + x1 ^= u<<13 | u>>>(32-13); + u = x1 + x13 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x6 | 0; + x14 ^= u<<7 | u>>>(32-7); + u = x14 + x10 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x14 | 0; + x6 ^= u<<13 | u>>>(32-13); + u = x6 + x2 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x11 | 0; + x3 ^= u<<7 | u>>>(32-7); + u = x3 + x15 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x3 | 0; + x11 ^= u<<13 | u>>>(32-13); + u = x11 + x7 | 0; + x15 ^= u<<18 | u>>>(32-18); + + u = x0 + x3 | 0; + x1 ^= u<<7 | u>>>(32-7); + u = x1 + x0 | 0; + x2 ^= u<<9 | u>>>(32-9); + u = x2 + x1 | 0; + x3 ^= u<<13 | u>>>(32-13); + u = x3 + x2 | 0; + x0 ^= u<<18 | u>>>(32-18); + + u = x5 + x4 | 0; + x6 ^= u<<7 | u>>>(32-7); + u = x6 + x5 | 0; + x7 ^= u<<9 | u>>>(32-9); + u = x7 + x6 | 0; + x4 ^= u<<13 | u>>>(32-13); + u = x4 + x7 | 0; + x5 ^= u<<18 | u>>>(32-18); + + u = x10 + x9 | 0; + x11 ^= u<<7 | u>>>(32-7); + u = x11 + x10 | 0; + x8 ^= u<<9 | u>>>(32-9); + u = x8 + x11 | 0; + x9 ^= u<<13 | u>>>(32-13); + u = x9 + x8 | 0; + x10 ^= u<<18 | u>>>(32-18); + + u = x15 + x14 | 0; + x12 ^= u<<7 | u>>>(32-7); + u = x12 + x15 | 0; + x13 ^= u<<9 | u>>>(32-9); + u = x13 + x12 | 0; + x14 ^= u<<13 | u>>>(32-13); + u = x14 + x13 | 0; + x15 ^= u<<18 | u>>>(32-18); + } + + o[ 0] = x0 >>> 0 & 0xff; + o[ 1] = x0 >>> 8 & 0xff; + o[ 2] = x0 >>> 16 & 0xff; + o[ 3] = x0 >>> 24 & 0xff; + + o[ 4] = x5 >>> 0 & 0xff; + o[ 5] = x5 >>> 8 & 0xff; + o[ 6] = x5 >>> 16 & 0xff; + o[ 7] = x5 >>> 24 & 0xff; + + o[ 8] = x10 >>> 0 & 0xff; + o[ 9] = x10 >>> 8 & 0xff; + o[10] = x10 >>> 16 & 0xff; + o[11] = x10 >>> 24 & 0xff; + + o[12] = x15 >>> 0 & 0xff; + o[13] = x15 >>> 8 & 0xff; + o[14] = x15 >>> 16 & 0xff; + o[15] = x15 >>> 24 & 0xff; + + o[16] = x6 >>> 0 & 0xff; + o[17] = x6 >>> 8 & 0xff; + o[18] = x6 >>> 16 & 0xff; + o[19] = x6 >>> 24 & 0xff; + + o[20] = x7 >>> 0 & 0xff; + o[21] = x7 >>> 8 & 0xff; + o[22] = x7 >>> 16 & 0xff; + o[23] = x7 >>> 24 & 0xff; + + o[24] = x8 >>> 0 & 0xff; + o[25] = x8 >>> 8 & 0xff; + o[26] = x8 >>> 16 & 0xff; + o[27] = x8 >>> 24 & 0xff; + + o[28] = x9 >>> 0 & 0xff; + o[29] = x9 >>> 8 & 0xff; + o[30] = x9 >>> 16 & 0xff; + o[31] = x9 >>> 24 & 0xff; +} + +function crypto_core_salsa20(out,inp,k,c) { + core_salsa20(out,inp,k,c); +} + +function crypto_core_hsalsa20(out,inp,k,c) { + core_hsalsa20(out,inp,k,c); +} + +var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + // "expand 32-byte k" + +function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) z[i] = 0; + for (i = 0; i < 8; i++) z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 0xff) | 0; + z[i] = u & 0xff; + u >>>= 8; + } + b -= 64; + cpos += 64; + mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i]; + } + return 0; +} + +function crypto_stream_salsa20(c,cpos,b,n,k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + for (i = 0; i < 16; i++) z[i] = 0; + for (i = 0; i < 8; i++) z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < 64; i++) c[cpos+i] = x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 0xff) | 0; + z[i] = u & 0xff; + u >>>= 8; + } + b -= 64; + cpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < b; i++) c[cpos+i] = x[i]; + } + return 0; +} + +function crypto_stream(c,cpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) sn[i] = n[i+16]; + return crypto_stream_salsa20(c,cpos,d,sn,s); +} + +function crypto_stream_xor(c,cpos,m,mpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + var sn = new Uint8Array(8); + for (var i = 0; i < 8; i++) sn[i] = n[i+16]; + return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s); +} + +/* +* Port of Andrew Moon's Poly1305-donna-16. Public domain. +* https://github.com/floodyberry/poly1305-donna +*/ + +var poly1305 = function(key) { + this.buffer = new Uint8Array(16); + this.r = new Uint16Array(10); + this.h = new Uint16Array(10); + this.pad = new Uint16Array(8); + this.leftover = 0; + this.fin = 0; + + var t0, t1, t2, t3, t4, t5, t6, t7; + + t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff; + t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff; + t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03; + t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff; + t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff; + this.r[5] = ((t4 >>> 1)) & 0x1ffe; + t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff; + t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81; + t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff; + this.r[9] = ((t7 >>> 5)) & 0x007f; + + this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8; + this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8; + this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8; + this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8; + this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8; + this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8; + this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8; + this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8; +}; + +poly1305.prototype.blocks = function(m, mpos, bytes) { + var hibit = this.fin ? 0 : (1 << 11); + var t0, t1, t2, t3, t4, t5, t6, t7, c; + var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9; + + var h0 = this.h[0], + h1 = this.h[1], + h2 = this.h[2], + h3 = this.h[3], + h4 = this.h[4], + h5 = this.h[5], + h6 = this.h[6], + h7 = this.h[7], + h8 = this.h[8], + h9 = this.h[9]; + + var r0 = this.r[0], + r1 = this.r[1], + r2 = this.r[2], + r3 = this.r[3], + r4 = this.r[4], + r5 = this.r[5], + r6 = this.r[6], + r7 = this.r[7], + r8 = this.r[8], + r9 = this.r[9]; + + while (bytes >= 16) { + t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff; + t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff; + t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff; + t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff; + t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff; + h5 += ((t4 >>> 1)) & 0x1fff; + t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff; + t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff; + t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff; + h9 += ((t7 >>> 5)) | hibit; + + c = 0; + + d0 = c; + d0 += h0 * r0; + d0 += h1 * (5 * r9); + d0 += h2 * (5 * r8); + d0 += h3 * (5 * r7); + d0 += h4 * (5 * r6); + c = (d0 >>> 13); d0 &= 0x1fff; + d0 += h5 * (5 * r5); + d0 += h6 * (5 * r4); + d0 += h7 * (5 * r3); + d0 += h8 * (5 * r2); + d0 += h9 * (5 * r1); + c += (d0 >>> 13); d0 &= 0x1fff; + + d1 = c; + d1 += h0 * r1; + d1 += h1 * r0; + d1 += h2 * (5 * r9); + d1 += h3 * (5 * r8); + d1 += h4 * (5 * r7); + c = (d1 >>> 13); d1 &= 0x1fff; + d1 += h5 * (5 * r6); + d1 += h6 * (5 * r5); + d1 += h7 * (5 * r4); + d1 += h8 * (5 * r3); + d1 += h9 * (5 * r2); + c += (d1 >>> 13); d1 &= 0x1fff; + + d2 = c; + d2 += h0 * r2; + d2 += h1 * r1; + d2 += h2 * r0; + d2 += h3 * (5 * r9); + d2 += h4 * (5 * r8); + c = (d2 >>> 13); d2 &= 0x1fff; + d2 += h5 * (5 * r7); + d2 += h6 * (5 * r6); + d2 += h7 * (5 * r5); + d2 += h8 * (5 * r4); + d2 += h9 * (5 * r3); + c += (d2 >>> 13); d2 &= 0x1fff; + + d3 = c; + d3 += h0 * r3; + d3 += h1 * r2; + d3 += h2 * r1; + d3 += h3 * r0; + d3 += h4 * (5 * r9); + c = (d3 >>> 13); d3 &= 0x1fff; + d3 += h5 * (5 * r8); + d3 += h6 * (5 * r7); + d3 += h7 * (5 * r6); + d3 += h8 * (5 * r5); + d3 += h9 * (5 * r4); + c += (d3 >>> 13); d3 &= 0x1fff; + + d4 = c; + d4 += h0 * r4; + d4 += h1 * r3; + d4 += h2 * r2; + d4 += h3 * r1; + d4 += h4 * r0; + c = (d4 >>> 13); d4 &= 0x1fff; + d4 += h5 * (5 * r9); + d4 += h6 * (5 * r8); + d4 += h7 * (5 * r7); + d4 += h8 * (5 * r6); + d4 += h9 * (5 * r5); + c += (d4 >>> 13); d4 &= 0x1fff; + + d5 = c; + d5 += h0 * r5; + d5 += h1 * r4; + d5 += h2 * r3; + d5 += h3 * r2; + d5 += h4 * r1; + c = (d5 >>> 13); d5 &= 0x1fff; + d5 += h5 * r0; + d5 += h6 * (5 * r9); + d5 += h7 * (5 * r8); + d5 += h8 * (5 * r7); + d5 += h9 * (5 * r6); + c += (d5 >>> 13); d5 &= 0x1fff; + + d6 = c; + d6 += h0 * r6; + d6 += h1 * r5; + d6 += h2 * r4; + d6 += h3 * r3; + d6 += h4 * r2; + c = (d6 >>> 13); d6 &= 0x1fff; + d6 += h5 * r1; + d6 += h6 * r0; + d6 += h7 * (5 * r9); + d6 += h8 * (5 * r8); + d6 += h9 * (5 * r7); + c += (d6 >>> 13); d6 &= 0x1fff; + + d7 = c; + d7 += h0 * r7; + d7 += h1 * r6; + d7 += h2 * r5; + d7 += h3 * r4; + d7 += h4 * r3; + c = (d7 >>> 13); d7 &= 0x1fff; + d7 += h5 * r2; + d7 += h6 * r1; + d7 += h7 * r0; + d7 += h8 * (5 * r9); + d7 += h9 * (5 * r8); + c += (d7 >>> 13); d7 &= 0x1fff; + + d8 = c; + d8 += h0 * r8; + d8 += h1 * r7; + d8 += h2 * r6; + d8 += h3 * r5; + d8 += h4 * r4; + c = (d8 >>> 13); d8 &= 0x1fff; + d8 += h5 * r3; + d8 += h6 * r2; + d8 += h7 * r1; + d8 += h8 * r0; + d8 += h9 * (5 * r9); + c += (d8 >>> 13); d8 &= 0x1fff; + + d9 = c; + d9 += h0 * r9; + d9 += h1 * r8; + d9 += h2 * r7; + d9 += h3 * r6; + d9 += h4 * r5; + c = (d9 >>> 13); d9 &= 0x1fff; + d9 += h5 * r4; + d9 += h6 * r3; + d9 += h7 * r2; + d9 += h8 * r1; + d9 += h9 * r0; + c += (d9 >>> 13); d9 &= 0x1fff; + + c = (((c << 2) + c)) | 0; + c = (c + d0) | 0; + d0 = c & 0x1fff; + c = (c >>> 13); + d1 += c; + + h0 = d0; + h1 = d1; + h2 = d2; + h3 = d3; + h4 = d4; + h5 = d5; + h6 = d6; + h7 = d7; + h8 = d8; + h9 = d9; + + mpos += 16; + bytes -= 16; + } + this.h[0] = h0; + this.h[1] = h1; + this.h[2] = h2; + this.h[3] = h3; + this.h[4] = h4; + this.h[5] = h5; + this.h[6] = h6; + this.h[7] = h7; + this.h[8] = h8; + this.h[9] = h9; +}; + +poly1305.prototype.finish = function(mac, macpos) { + var g = new Uint16Array(10); + var c, mask, f, i; + + if (this.leftover) { + i = this.leftover; + this.buffer[i++] = 1; + for (; i < 16; i++) this.buffer[i] = 0; + this.fin = 1; + this.blocks(this.buffer, 0, 16); + } + + c = this.h[1] >>> 13; + this.h[1] &= 0x1fff; + for (i = 2; i < 10; i++) { + this.h[i] += c; + c = this.h[i] >>> 13; + this.h[i] &= 0x1fff; + } + this.h[0] += (c * 5); + c = this.h[0] >>> 13; + this.h[0] &= 0x1fff; + this.h[1] += c; + c = this.h[1] >>> 13; + this.h[1] &= 0x1fff; + this.h[2] += c; + + g[0] = this.h[0] + 5; + c = g[0] >>> 13; + g[0] &= 0x1fff; + for (i = 1; i < 10; i++) { + g[i] = this.h[i] + c; + c = g[i] >>> 13; + g[i] &= 0x1fff; + } + g[9] -= (1 << 13); + + mask = (g[9] >>> ((2 * 8) - 1)) - 1; + for (i = 0; i < 10; i++) g[i] &= mask; + mask = ~mask; + for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i]; + + this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff; + this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff; + this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff; + this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff; + this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff; + this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff; + this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff; + this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff; + + f = this.h[0] + this.pad[0]; + this.h[0] = f & 0xffff; + for (i = 1; i < 8; i++) { + f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0; + this.h[i] = f & 0xffff; + } + + mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff; + mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff; + mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff; + mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff; + mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff; + mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff; + mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff; + mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff; + mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff; + mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff; + mac[macpos+10] = (this.h[5] >>> 0) & 0xff; + mac[macpos+11] = (this.h[5] >>> 8) & 0xff; + mac[macpos+12] = (this.h[6] >>> 0) & 0xff; + mac[macpos+13] = (this.h[6] >>> 8) & 0xff; + mac[macpos+14] = (this.h[7] >>> 0) & 0xff; + mac[macpos+15] = (this.h[7] >>> 8) & 0xff; +}; + +poly1305.prototype.update = function(m, mpos, bytes) { + var i, want; + + if (this.leftover) { + want = (16 - this.leftover); + if (want > bytes) + want = bytes; + for (i = 0; i < want; i++) + this.buffer[this.leftover + i] = m[mpos+i]; + bytes -= want; + mpos += want; + this.leftover += want; + if (this.leftover < 16) + return; + this.blocks(this.buffer, 0, 16); + this.leftover = 0; + } + + if (bytes >= 16) { + want = bytes - (bytes % 16); + this.blocks(m, mpos, want); + mpos += want; + bytes -= want; + } + + if (bytes) { + for (i = 0; i < bytes; i++) + this.buffer[this.leftover + i] = m[mpos+i]; + this.leftover += bytes; + } +}; + +function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s = new poly1305(k); + s.update(m, mpos, n); + s.finish(out, outpos); + return 0; +} + +function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x,0,m,mpos,n,k); + return crypto_verify_16(h,hpos,x,0); +} + +function crypto_secretbox(c,m,d,n,k) { + var i; + if (d < 32) return -1; + crypto_stream_xor(c,0,m,0,d,n,k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) c[i] = 0; + return 0; +} + +function crypto_secretbox_open(m,c,d,n,k) { + var i; + var x = new Uint8Array(32); + if (d < 32) return -1; + crypto_stream(x,0,32,n,k); + if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1; + crypto_stream_xor(m,0,c,0,d,n,k); + for (i = 0; i < 32; i++) m[i] = 0; + return 0; +} + +function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) r[i] = a[i]|0; +} + +function car25519(o) { + var i, v, c = 1; + for (i = 0; i < 16; i++) { + v = o[i] + c + 65535; + c = Math.floor(v / 65536); + o[i] = v - c * 65536; + } + o[0] += c-1 + 37 * (c-1); +} + +function sel25519(p, q, b) { + var t, c = ~(b-1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } +} + +function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 0xffed; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1); + m[i-1] &= 0xffff; + } + m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1); + b = (m[15]>>16) & 1; + m[14] &= 0xffff; + sel25519(t, m, 1-b); + } + for (i = 0; i < 16; i++) { + o[2*i] = t[i] & 0xff; + o[2*i+1] = t[i]>>8; + } +} + +function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); +} + +function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; +} + +function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8); + o[15] &= 0x7fff; +} + +function A(o, a, b) { + for (var i = 0; i < 16; i++) o[i] = a[i] + b[i]; +} + +function Z(o, a, b) { + for (var i = 0; i < 16; i++) o[i] = a[i] - b[i]; +} + +function M(o, a, b) { + var v, c, + t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, + t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, + t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, + t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, + b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3], + b4 = b[4], + b5 = b[5], + b6 = b[6], + b7 = b[7], + b8 = b[8], + b9 = b[9], + b10 = b[10], + b11 = b[11], + b12 = b[12], + b13 = b[13], + b14 = b[14], + b15 = b[15]; + + v = a[0]; + t0 += v * b0; + t1 += v * b1; + t2 += v * b2; + t3 += v * b3; + t4 += v * b4; + t5 += v * b5; + t6 += v * b6; + t7 += v * b7; + t8 += v * b8; + t9 += v * b9; + t10 += v * b10; + t11 += v * b11; + t12 += v * b12; + t13 += v * b13; + t14 += v * b14; + t15 += v * b15; + v = a[1]; + t1 += v * b0; + t2 += v * b1; + t3 += v * b2; + t4 += v * b3; + t5 += v * b4; + t6 += v * b5; + t7 += v * b6; + t8 += v * b7; + t9 += v * b8; + t10 += v * b9; + t11 += v * b10; + t12 += v * b11; + t13 += v * b12; + t14 += v * b13; + t15 += v * b14; + t16 += v * b15; + v = a[2]; + t2 += v * b0; + t3 += v * b1; + t4 += v * b2; + t5 += v * b3; + t6 += v * b4; + t7 += v * b5; + t8 += v * b6; + t9 += v * b7; + t10 += v * b8; + t11 += v * b9; + t12 += v * b10; + t13 += v * b11; + t14 += v * b12; + t15 += v * b13; + t16 += v * b14; + t17 += v * b15; + v = a[3]; + t3 += v * b0; + t4 += v * b1; + t5 += v * b2; + t6 += v * b3; + t7 += v * b4; + t8 += v * b5; + t9 += v * b6; + t10 += v * b7; + t11 += v * b8; + t12 += v * b9; + t13 += v * b10; + t14 += v * b11; + t15 += v * b12; + t16 += v * b13; + t17 += v * b14; + t18 += v * b15; + v = a[4]; + t4 += v * b0; + t5 += v * b1; + t6 += v * b2; + t7 += v * b3; + t8 += v * b4; + t9 += v * b5; + t10 += v * b6; + t11 += v * b7; + t12 += v * b8; + t13 += v * b9; + t14 += v * b10; + t15 += v * b11; + t16 += v * b12; + t17 += v * b13; + t18 += v * b14; + t19 += v * b15; + v = a[5]; + t5 += v * b0; + t6 += v * b1; + t7 += v * b2; + t8 += v * b3; + t9 += v * b4; + t10 += v * b5; + t11 += v * b6; + t12 += v * b7; + t13 += v * b8; + t14 += v * b9; + t15 += v * b10; + t16 += v * b11; + t17 += v * b12; + t18 += v * b13; + t19 += v * b14; + t20 += v * b15; + v = a[6]; + t6 += v * b0; + t7 += v * b1; + t8 += v * b2; + t9 += v * b3; + t10 += v * b4; + t11 += v * b5; + t12 += v * b6; + t13 += v * b7; + t14 += v * b8; + t15 += v * b9; + t16 += v * b10; + t17 += v * b11; + t18 += v * b12; + t19 += v * b13; + t20 += v * b14; + t21 += v * b15; + v = a[7]; + t7 += v * b0; + t8 += v * b1; + t9 += v * b2; + t10 += v * b3; + t11 += v * b4; + t12 += v * b5; + t13 += v * b6; + t14 += v * b7; + t15 += v * b8; + t16 += v * b9; + t17 += v * b10; + t18 += v * b11; + t19 += v * b12; + t20 += v * b13; + t21 += v * b14; + t22 += v * b15; + v = a[8]; + t8 += v * b0; + t9 += v * b1; + t10 += v * b2; + t11 += v * b3; + t12 += v * b4; + t13 += v * b5; + t14 += v * b6; + t15 += v * b7; + t16 += v * b8; + t17 += v * b9; + t18 += v * b10; + t19 += v * b11; + t20 += v * b12; + t21 += v * b13; + t22 += v * b14; + t23 += v * b15; + v = a[9]; + t9 += v * b0; + t10 += v * b1; + t11 += v * b2; + t12 += v * b3; + t13 += v * b4; + t14 += v * b5; + t15 += v * b6; + t16 += v * b7; + t17 += v * b8; + t18 += v * b9; + t19 += v * b10; + t20 += v * b11; + t21 += v * b12; + t22 += v * b13; + t23 += v * b14; + t24 += v * b15; + v = a[10]; + t10 += v * b0; + t11 += v * b1; + t12 += v * b2; + t13 += v * b3; + t14 += v * b4; + t15 += v * b5; + t16 += v * b6; + t17 += v * b7; + t18 += v * b8; + t19 += v * b9; + t20 += v * b10; + t21 += v * b11; + t22 += v * b12; + t23 += v * b13; + t24 += v * b14; + t25 += v * b15; + v = a[11]; + t11 += v * b0; + t12 += v * b1; + t13 += v * b2; + t14 += v * b3; + t15 += v * b4; + t16 += v * b5; + t17 += v * b6; + t18 += v * b7; + t19 += v * b8; + t20 += v * b9; + t21 += v * b10; + t22 += v * b11; + t23 += v * b12; + t24 += v * b13; + t25 += v * b14; + t26 += v * b15; + v = a[12]; + t12 += v * b0; + t13 += v * b1; + t14 += v * b2; + t15 += v * b3; + t16 += v * b4; + t17 += v * b5; + t18 += v * b6; + t19 += v * b7; + t20 += v * b8; + t21 += v * b9; + t22 += v * b10; + t23 += v * b11; + t24 += v * b12; + t25 += v * b13; + t26 += v * b14; + t27 += v * b15; + v = a[13]; + t13 += v * b0; + t14 += v * b1; + t15 += v * b2; + t16 += v * b3; + t17 += v * b4; + t18 += v * b5; + t19 += v * b6; + t20 += v * b7; + t21 += v * b8; + t22 += v * b9; + t23 += v * b10; + t24 += v * b11; + t25 += v * b12; + t26 += v * b13; + t27 += v * b14; + t28 += v * b15; + v = a[14]; + t14 += v * b0; + t15 += v * b1; + t16 += v * b2; + t17 += v * b3; + t18 += v * b4; + t19 += v * b5; + t20 += v * b6; + t21 += v * b7; + t22 += v * b8; + t23 += v * b9; + t24 += v * b10; + t25 += v * b11; + t26 += v * b12; + t27 += v * b13; + t28 += v * b14; + t29 += v * b15; + v = a[15]; + t15 += v * b0; + t16 += v * b1; + t17 += v * b2; + t18 += v * b3; + t19 += v * b4; + t20 += v * b5; + t21 += v * b6; + t22 += v * b7; + t23 += v * b8; + t24 += v * b9; + t25 += v * b10; + t26 += v * b11; + t27 += v * b12; + t28 += v * b13; + t29 += v * b14; + t30 += v * b15; + + t0 += 38 * t16; + t1 += 38 * t17; + t2 += 38 * t18; + t3 += 38 * t19; + t4 += 38 * t20; + t5 += 38 * t21; + t6 += 38 * t22; + t7 += 38 * t23; + t8 += 38 * t24; + t9 += 38 * t25; + t10 += 38 * t26; + t11 += 38 * t27; + t12 += 38 * t28; + t13 += 38 * t29; + t14 += 38 * t30; + // t15 left as is + + // first car + c = 1; + v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; + v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; + v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; + v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; + v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; + v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; + v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; + v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; + v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; + v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; + v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; + v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; + v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; + v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; + v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; + v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; + t0 += c-1 + 37 * (c-1); + + // second car + c = 1; + v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536; + v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536; + v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536; + v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536; + v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536; + v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536; + v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536; + v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536; + v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536; + v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536; + v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536; + v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536; + v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536; + v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536; + v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536; + v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536; + t0 += c-1 + 37 * (c-1); + + o[ 0] = t0; + o[ 1] = t1; + o[ 2] = t2; + o[ 3] = t3; + o[ 4] = t4; + o[ 5] = t5; + o[ 6] = t6; + o[ 7] = t7; + o[ 8] = t8; + o[ 9] = t9; + o[10] = t10; + o[11] = t11; + o[12] = t12; + o[13] = t13; + o[14] = t14; + o[15] = t15; +} + +function S(o, a) { + M(o, a, a); +} + +function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if(a !== 2 && a !== 4) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if(a !== 1) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) z[i] = n[i]; + z[31]=(n[31]&127)|64; + z[0]&=248; + unpack25519(x,p); + for (i = 0; i < 16; i++) { + b[i]=x[i]; + d[i]=a[i]=c[i]=0; + } + a[0]=d[0]=1; + for (i=254; i>=0; --i) { + r=(z[i>>>3]>>>(i&7))&1; + sel25519(a,b,r); + sel25519(c,d,r); + A(e,a,c); + Z(a,a,c); + A(c,b,d); + Z(b,b,d); + S(d,e); + S(f,a); + M(a,c,a); + M(c,b,e); + A(e,a,c); + Z(a,a,c); + S(b,a); + Z(c,d,f); + M(a,c,_121665); + A(a,a,d); + M(c,c,a); + M(a,d,f); + M(d,b,x); + S(b,e); + sel25519(a,b,r); + sel25519(c,d,r); + } + for (i = 0; i < 16; i++) { + x[i+16]=a[i]; + x[i+32]=c[i]; + x[i+48]=b[i]; + x[i+64]=d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32,x32); + M(x16,x16,x32); + pack25519(q,x16); + return 0; +} + +function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); +} + +function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); +} + +function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); +} + +var crypto_box_afternm = crypto_secretbox; +var crypto_box_open_afternm = crypto_secretbox_open; + +function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); +} + +function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); +} + +var K = [ + 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, + 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, + 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, + 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, + 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, + 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, + 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, + 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, + 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, + 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, + 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, + 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, + 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, + 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, + 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, + 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, + 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, + 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, + 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, + 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, + 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 +]; + +function crypto_hashblocks_hl(hh, hl, m, n) { + var wh = new Int32Array(16), wl = new Int32Array(16), + bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, + bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, + th, tl, i, j, h, l, a, b, c, d; + + var ah0 = hh[0], + ah1 = hh[1], + ah2 = hh[2], + ah3 = hh[3], + ah4 = hh[4], + ah5 = hh[5], + ah6 = hh[6], + ah7 = hh[7], + + al0 = hl[0], + al1 = hl[1], + al2 = hl[2], + al3 = hl[3], + al4 = hl[4], + al5 = hl[5], + al6 = hl[6], + al7 = hl[7]; + + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) { + j = 8 * i + pos; + wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3]; + wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7]; + } + for (i = 0; i < 80; i++) { + bh0 = ah0; + bh1 = ah1; + bh2 = ah2; + bh3 = ah3; + bh4 = ah4; + bh5 = ah5; + bh6 = ah6; + bh7 = ah7; + + bl0 = al0; + bl1 = al1; + bl2 = al2; + bl3 = al3; + bl4 = al4; + bl5 = al5; + bl6 = al6; + bl7 = al7; + + // add + h = ah7; + l = al7; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + // Sigma1 + h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32)))); + l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32)))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // Ch + h = (ah4 & ah5) ^ (~ah4 & ah6); + l = (al4 & al5) ^ (~al4 & al6); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // K + h = K[i*2]; + l = K[i*2+1]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // w + h = wh[i%16]; + l = wl[i%16]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + th = c & 0xffff | d << 16; + tl = a & 0xffff | b << 16; + + // add + h = th; + l = tl; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + // Sigma0 + h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32)))); + l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32)))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // Maj + h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2); + l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + bh7 = (c & 0xffff) | (d << 16); + bl7 = (a & 0xffff) | (b << 16); + + // add + h = bh3; + l = bl3; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = th; + l = tl; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + bh3 = (c & 0xffff) | (d << 16); + bl3 = (a & 0xffff) | (b << 16); + + ah1 = bh0; + ah2 = bh1; + ah3 = bh2; + ah4 = bh3; + ah5 = bh4; + ah6 = bh5; + ah7 = bh6; + ah0 = bh7; + + al1 = bl0; + al2 = bl1; + al3 = bl2; + al4 = bl3; + al5 = bl4; + al6 = bl5; + al7 = bl6; + al0 = bl7; + + if (i%16 === 15) { + for (j = 0; j < 16; j++) { + // add + h = wh[j]; + l = wl[j]; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = wh[(j+9)%16]; + l = wl[(j+9)%16]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // sigma0 + th = wh[(j+1)%16]; + tl = wl[(j+1)%16]; + h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7); + l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + // sigma1 + th = wh[(j+14)%16]; + tl = wl[(j+14)%16]; + h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6); + l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6))); + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + wh[j] = (c & 0xffff) | (d << 16); + wl[j] = (a & 0xffff) | (b << 16); + } + } + } + + // add + h = ah0; + l = al0; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[0]; + l = hl[0]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[0] = ah0 = (c & 0xffff) | (d << 16); + hl[0] = al0 = (a & 0xffff) | (b << 16); + + h = ah1; + l = al1; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[1]; + l = hl[1]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[1] = ah1 = (c & 0xffff) | (d << 16); + hl[1] = al1 = (a & 0xffff) | (b << 16); + + h = ah2; + l = al2; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[2]; + l = hl[2]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[2] = ah2 = (c & 0xffff) | (d << 16); + hl[2] = al2 = (a & 0xffff) | (b << 16); + + h = ah3; + l = al3; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[3]; + l = hl[3]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[3] = ah3 = (c & 0xffff) | (d << 16); + hl[3] = al3 = (a & 0xffff) | (b << 16); + + h = ah4; + l = al4; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[4]; + l = hl[4]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[4] = ah4 = (c & 0xffff) | (d << 16); + hl[4] = al4 = (a & 0xffff) | (b << 16); + + h = ah5; + l = al5; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[5]; + l = hl[5]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[5] = ah5 = (c & 0xffff) | (d << 16); + hl[5] = al5 = (a & 0xffff) | (b << 16); + + h = ah6; + l = al6; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[6]; + l = hl[6]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[6] = ah6 = (c & 0xffff) | (d << 16); + hl[6] = al6 = (a & 0xffff) | (b << 16); + + h = ah7; + l = al7; + + a = l & 0xffff; b = l >>> 16; + c = h & 0xffff; d = h >>> 16; + + h = hh[7]; + l = hl[7]; + + a += l & 0xffff; b += l >>> 16; + c += h & 0xffff; d += h >>> 16; + + b += a >>> 16; + c += b >>> 16; + d += c >>> 16; + + hh[7] = ah7 = (c & 0xffff) | (d << 16); + hl[7] = al7 = (a & 0xffff) | (b << 16); + + pos += 128; + n -= 128; + } + + return n; +} + +function crypto_hash(out, m, n) { + var hh = new Int32Array(8), + hl = new Int32Array(8), + x = new Uint8Array(256), + i, b = n; + + hh[0] = 0x6a09e667; + hh[1] = 0xbb67ae85; + hh[2] = 0x3c6ef372; + hh[3] = 0xa54ff53a; + hh[4] = 0x510e527f; + hh[5] = 0x9b05688c; + hh[6] = 0x1f83d9ab; + hh[7] = 0x5be0cd19; + + hl[0] = 0xf3bcc908; + hl[1] = 0x84caa73b; + hl[2] = 0xfe94f82b; + hl[3] = 0x5f1d36f1; + hl[4] = 0xade682d1; + hl[5] = 0x2b3e6c1f; + hl[6] = 0xfb41bd6b; + hl[7] = 0x137e2179; + + crypto_hashblocks_hl(hh, hl, m, n); + n %= 128; + + for (i = 0; i < n; i++) x[i] = m[b-n+i]; + x[n] = 128; + + n = 256-128*(n<112?1:0); + x[n-9] = 0; + ts64(x, n-8, (b / 0x20000000) | 0, b << 3); + crypto_hashblocks_hl(hh, hl, x, n); + + for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]); + + return 0; +} + +function add(p, q) { + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(), + g = gf(), h = gf(), t = gf(); + + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); +} + +function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } +} + +function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; +} + +function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = (s[(i/8)|0] >> (i&7)) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } +} + +function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); +} + +function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + + if (!seeded) randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + scalarbase(p, d); + pack(pk, p); + + for (i = 0; i < 32; i++) sk[i+32] = pk[i]; + return 0; +} + +var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); + +function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L[j - (i - 32)]; + carry = (x[j] + 128) >> 8; + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) x[j] -= carry * L[j]; + for (i = 0; i < 32; i++) { + x[i+1] += x[i] >> 8; + r[i] = x[i] & 255; + } +} + +function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) x[i] = r[i]; + for (i = 0; i < 64; i++) r[i] = 0; + modL(r, x); +} + +// Note: difference from C - smlen returned, not passed as argument. +function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + var smlen = n + 64; + for (i = 0; i < n; i++) sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; + + crypto_hash(r, sm.subarray(32), n+32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + + for (i = 32; i < 64; i++) sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + + for (i = 0; i < 64; i++) x[i] = 0; + for (i = 0; i < 32; i++) x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i+j] += h[i] * d[j]; + } + } + + modL(sm.subarray(32), x); + return smlen; +} + +function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), + den = gf(), den2 = gf(), den4 = gf(), + den6 = gf(); + + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) M(r[0], r[0], I); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) return -1; + + if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]); + + M(r[3], r[0], r[1]); + return 0; +} + +function crypto_sign_open(m, sm, n, pk) { + var i, mlen; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], + q = [gf(), gf(), gf(), gf()]; + + mlen = -1; + if (n < 64) return -1; + + if (unpackneg(q, pk)) return -1; + + for (i = 0; i < n; i++) m[i] = sm[i]; + for (i = 0; i < 32; i++) m[i+32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) m[i] = 0; + return -1; + } + + for (i = 0; i < n; i++) m[i] = sm[i + 64]; + mlen = n; + return mlen; +} + +var crypto_secretbox_KEYBYTES = 32, + crypto_secretbox_NONCEBYTES = 24, + crypto_secretbox_ZEROBYTES = 32, + crypto_secretbox_BOXZEROBYTES = 16, + crypto_scalarmult_BYTES = 32, + crypto_scalarmult_SCALARBYTES = 32, + crypto_box_PUBLICKEYBYTES = 32, + crypto_box_SECRETKEYBYTES = 32, + crypto_box_BEFORENMBYTES = 32, + crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, + crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, + crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, + crypto_sign_BYTES = 64, + crypto_sign_PUBLICKEYBYTES = 32, + crypto_sign_SECRETKEYBYTES = 64, + crypto_sign_SEEDBYTES = 32, + crypto_hash_BYTES = 64; + +nacl.lowlevel = { + crypto_core_hsalsa20: crypto_core_hsalsa20, + crypto_stream_xor: crypto_stream_xor, + crypto_stream: crypto_stream, + crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, + crypto_stream_salsa20: crypto_stream_salsa20, + crypto_onetimeauth: crypto_onetimeauth, + crypto_onetimeauth_verify: crypto_onetimeauth_verify, + crypto_verify_16: crypto_verify_16, + crypto_verify_32: crypto_verify_32, + crypto_secretbox: crypto_secretbox, + crypto_secretbox_open: crypto_secretbox_open, + crypto_scalarmult: crypto_scalarmult, + crypto_scalarmult_base: crypto_scalarmult_base, + crypto_box_beforenm: crypto_box_beforenm, + crypto_box_afternm: crypto_box_afternm, + crypto_box: crypto_box, + crypto_box_open: crypto_box_open, + crypto_box_keypair: crypto_box_keypair, + crypto_hash: crypto_hash, + crypto_sign: crypto_sign, + crypto_sign_keypair: crypto_sign_keypair, + crypto_sign_open: crypto_sign_open, + + crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES: crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES: crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES: crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES, + crypto_sign_BYTES: crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, + crypto_hash_BYTES: crypto_hash_BYTES +}; + +/* High-level API */ + +function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); + if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size'); +} + +function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size'); + if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); +} + +function checkArrayTypes() { + var t, i; + for (i = 0; i < arguments.length; i++) { + if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]') + throw new TypeError('unexpected type ' + t + ', use Uint8Array'); + } +} + +function cleanup(arr) { + for (var i = 0; i < arr.length; i++) arr[i] = 0; +} + +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; + +nacl.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; +}; + +nacl.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); +}; + +nacl.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) return false; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false; + return m.subarray(crypto_secretbox_ZEROBYTES); +}; + +nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; +nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; +nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + +nacl.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; +}; + +nacl.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; +}; + +nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; +nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + +nacl.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox(msg, nonce, k); +}; + +nacl.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; +}; + +nacl.box.after = nacl.secretbox; + +nacl.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox.open(msg, nonce, k); +}; + +nacl.box.open.after = nacl.secretbox.open; + +nacl.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; +nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; +nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; +nacl.box.nonceLength = crypto_box_NONCEBYTES; +nacl.box.overheadLength = nacl.secretbox.overheadLength; + +nacl.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; +}; + +nacl.sign.open = function(signedMsg, publicKey) { + if (arguments.length !== 2) + throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?'); + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) m[i] = tmp[i]; + return m; +}; + +nacl.sign.detached = function(msg, secretKey) { + var signedMsg = nacl.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; + return sig; +}; + +nacl.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error('bad signature size'); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; + return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); +}; + +nacl.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i]; + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error('bad seed size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; +nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; +nacl.sign.seedLength = crypto_sign_SEEDBYTES; +nacl.sign.signatureLength = crypto_sign_BYTES; + +nacl.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; +}; + +nacl.hash.hashLength = crypto_hash_BYTES; + +nacl.verify = function(x, y) { + checkArrayTypes(x, y); + // Zero length arguments are considered not equal. + if (x.length === 0 || y.length === 0) return false; + if (x.length !== y.length) return false; + return (vn(x, 0, y, 0, x.length) === 0) ? true : false; +}; + +nacl.setPRNG = function(fn) { + randombytes = fn; +}; + +(function() { + // Initialize PRNG if environment provides CSPRNG. + // If not, methods calling randombytes will throw. + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } else if (typeof require !== 'undefined') { + // Node.js. + crypto = require('crypto'); + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = crypto.randomBytes(n); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } +})(); + +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js new file mode 100644 index 00000000..7072c2af --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js @@ -0,0 +1,2 @@ +!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;_=_+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+g|0,L=L+v|0,C=C+b|0,R=R+d|0,z=z+A|0,r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=C>>>0&255,r[53]=C>>>8&255,r[54]=C>>>16&255,r[55]=C>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=z>>>0&255,r[61]=z>>>8&255,r[62]=z>>>16&255,r[63]=z>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=z>>>0&255,r[13]=z>>>8&255,r[14]=z>>>16&255,r[15]=z>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function g(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function v(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function b(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function d(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(b(h),b(h),b(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function _(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,g=0,v=0,b=0,d=0,A=0,_=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,C=0,R=0,z=n[0],P=n[1],O=n[2],N=n[3],F=n[4],I=n[5],j=n[6],G=n[7],Z=n[8],V=n[9],q=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*z,h+=e*P,a+=e*O,f+=e*N,s+=e*F,u+=e*I,c+=e*j,y+=e*G,l+=e*Z,w+=e*V,p+=e*q,g+=e*X,v+=e*D,b+=e*H,d+=e*J,A+=e*Q,e=t[1],h+=e*z,a+=e*P,f+=e*O,s+=e*N,u+=e*F,c+=e*I,y+=e*j,l+=e*G,w+=e*Z,p+=e*V,g+=e*q,v+=e*X,b+=e*D,d+=e*H,A+=e*J,_+=e*Q,e=t[2],a+=e*z,f+=e*P,s+=e*O,u+=e*N,c+=e*F,y+=e*I,l+=e*j,w+=e*G,p+=e*Z,g+=e*V,v+=e*q,b+=e*X,d+=e*D,A+=e*H,_+=e*J,U+=e*Q,e=t[3],f+=e*z,s+=e*P,u+=e*O,c+=e*N,y+=e*F,l+=e*I,w+=e*j,p+=e*G,g+=e*Z,v+=e*V,b+=e*q,d+=e*X,A+=e*D,_+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*z,u+=e*P,c+=e*O,y+=e*N,l+=e*F,w+=e*I,p+=e*j,g+=e*G,v+=e*Z,b+=e*V,d+=e*q,A+=e*X,_+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*z,c+=e*P,y+=e*O,l+=e*N,w+=e*F,p+=e*I,g+=e*j,v+=e*G,b+=e*Z,d+=e*V,A+=e*q,_+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*z,y+=e*P,l+=e*O,w+=e*N,p+=e*F,g+=e*I,v+=e*j,b+=e*G,d+=e*Z,A+=e*V,_+=e*q,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*z,l+=e*P,w+=e*O,p+=e*N,g+=e*F,v+=e*I,b+=e*j,d+=e*G,A+=e*Z,_+=e*V,U+=e*q,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*z,w+=e*P,p+=e*O,g+=e*N,v+=e*F,b+=e*I,d+=e*j,A+=e*G,_+=e*Z,U+=e*V,E+=e*q,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*z,p+=e*P,g+=e*O,v+=e*N,b+=e*F,d+=e*I,A+=e*j,_+=e*G,U+=e*Z,E+=e*V,x+=e*q,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*z,g+=e*P,v+=e*O,b+=e*N,d+=e*F,A+=e*I,_+=e*j,U+=e*G,E+=e*Z,x+=e*V,M+=e*q,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],g+=e*z,v+=e*P,b+=e*O,d+=e*N,A+=e*F,_+=e*I,U+=e*j,E+=e*G,x+=e*Z,M+=e*V,m+=e*q,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],v+=e*z,b+=e*P,d+=e*O,A+=e*N,_+=e*F,U+=e*I,E+=e*j,x+=e*G,M+=e*Z,m+=e*V,B+=e*q,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],b+=e*z,d+=e*P,A+=e*O,_+=e*N,U+=e*F,E+=e*I,x+=e*j,M+=e*G,m+=e*Z,B+=e*V,S+=e*q,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],d+=e*z,A+=e*P,_+=e*O,U+=e*N,E+=e*F,x+=e*I,M+=e*j,m+=e*G,B+=e*Z,S+=e*V,K+=e*q,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,C+=e*Q,e=t[15],A+=e*z,_+=e*P,U+=e*O,E+=e*N,x+=e*F,M+=e*I,m+=e*j,B+=e*G,S+=e*Z,K+=e*V,T+=e*q,Y+=e*X,k+=e*D,L+=e*H,C+=e*J,R+=e*Q,i+=38*_,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,g+=38*k,v+=38*L,b+=38*C,d+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=g,r[12]=v,r[13]=b,r[14]=d,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,d(a,f,e),d(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),d(a,f,e),d(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function C(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function z(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],C=r[2],R=r[3],z=r[4],P=r[5],O=r[6],N=r[7],F=t[0],I=t[1],j=t[2],G=t[3],Z=t[4],V=t[5],q=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=C,a=R,f=z,s=P,u=O,c=N,y=F,l=I,w=j,p=G,g=Z,v=V,b=q,d=X,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(z>>>14|Z<<18)^(z>>>18|Z<<14)^(Z>>>9|z<<23),M=(Z>>>14|z<<18)^(Z>>>18|z<<14)^(z>>>9|Z<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=z&P^~z&O,M=Z&V^~Z&q,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,_=65535&m|B<<16,x=A,M=_,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&C^L&C,M=F&I^F&j^I&j,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,d=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=_,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,C=i,R=h,z=a,P=f,O=s,N=u,k=c,I=y,j=l,G=w,Z=p,V=g,q=v,X=b,F=d,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],_=Y[(E+1)%16],x=(A>>>1|_<<31)^(A>>>8|_<<24)^A>>>7,M=(_>>>1|A<<31)^(_>>>8|A<<24)^(_>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],_=Y[(E+14)%16],x=(A>>>19|_<<13)^(_>>>29|A<<3)^A>>>6,M=(_>>>19|A<<13)^(A>>>29|_<<3)^(_>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=C,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=C=65535&S|K<<16,t[2]=j=65535&m|B<<16,x=R,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=G=65535&m|B<<16,x=z,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=z=65535&S|K<<16,t[4]=Z=65535&m|B<<16,x=P,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=P=65535&S|K<<16,t[5]=V=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=O=65535&S|K<<16,t[6]=q=65535&m|B<<16,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=N=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function P(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,z(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),z(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function O(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function N(r,t,n){var e;for(e=0;4>e;e++)d(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(v(r[0],er),v(r[1],or),v(r[2],or),v(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,N(r,t,e),O(t,r),O(r,r),N(r,t,e)}function j(r,t){var n=[$(),$(),$(),$()];v(n[0],fr),v(n[1],sr),v(n[2],or),m(n[3],fr,sr),I(r,n,t)}function G(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),P(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,j(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function Z(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*gr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*gr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*gr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function V(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;Z(r,n)}function q(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];P(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(P(f,r.subarray(32),n+32),V(f),j(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(P(a,r,n+64),V(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return Z(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return v(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),_(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),_(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(P(f,r,n),V(f),I(s,u,f),j(u,t.subarray(32)),O(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==vr)throw new Error("bad key size");if(t.length!==br)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],C=this.r[1],R=this.r[2],z=this.r[3],P=this.r[4],O=this.r[5],N=this.r[6],F=this.r[7],I=this.r[8],j=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=5*x*j,y+=5*M*I,y+=5*m*F,y+=5*B*N,c=y>>>13,y&=8191,y+=5*S*O,y+=5*K*P,y+=5*T*z,y+=5*Y*R,y+=5*k*C,c+=y>>>13,y&=8191,l=c,l+=E*C,l+=x*L,l+=5*M*j,l+=5*m*I,l+=5*B*F,c=l>>>13,l&=8191,l+=5*S*N,l+=5*K*O,l+=5*T*P,l+=5*Y*z,l+=5*k*R,c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*C,w+=M*L,w+=5*m*j,w+=5*B*I,c=w>>>13,w&=8191,w+=5*S*F,w+=5*K*N,w+=5*T*O,w+=5*Y*P,w+=5*k*z,c+=w>>>13,w&=8191,p=c,p+=E*z,p+=x*R,p+=M*C,p+=m*L,p+=5*B*j,c=p>>>13,p&=8191,p+=5*S*I,p+=5*K*F,p+=5*T*N,p+=5*Y*O,p+=5*k*P,c+=p>>>13,p&=8191,g=c,g+=E*P,g+=x*z,g+=M*R,g+=m*C,g+=B*L,c=g>>>13,g&=8191,g+=5*S*j,g+=5*K*I,g+=5*T*F,g+=5*Y*N,g+=5*k*O,c+=g>>>13,g&=8191,v=c,v+=E*O,v+=x*P,v+=M*z,v+=m*R,v+=B*C,c=v>>>13,v&=8191,v+=S*L,v+=5*K*j,v+=5*T*I,v+=5*Y*F,v+=5*k*N,c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*z,b+=B*R,c=b>>>13,b&=8191,b+=S*C,b+=K*L,b+=5*T*j,b+=5*Y*I,b+=5*k*F,c+=b>>>13,b&=8191,d=c,d+=E*F,d+=x*N,d+=M*O,d+=m*P,d+=B*z,c=d>>>13,d&=8191,d+=S*R,d+=K*C,d+=T*L,d+=5*Y*j,d+=5*k*I,c+=d>>>13,d&=8191,A=c,A+=E*I,A+=x*F,A+=M*N,A+=m*O,A+=B*P,c=A>>>13,A&=8191,A+=S*z,A+=K*R,A+=T*C,A+=Y*L,A+=5*k*j,c+=A>>>13,A&=8191,_=c,_+=E*j,_+=x*I,_+=M*F,_+=m*N,_+=B*O,c=_>>>13,_&=8191,_+=S*P,_+=K*z,_+=T*R,_+=Y*C,_+=k*L,c+=_>>>13,_&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=g,S=v,K=b,T=d,Y=A,k=_,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(h[9]>>>15)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=g,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],gr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),vr=32,br=24,dr=32,Ar=16,_r=32,Ur=32,Er=32,xr=32,Mr=32,mr=br,Br=dr,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:g,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:C,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:P,crypto_sign:q,crypto_sign_keypair:G,crypto_sign_open:D,crypto_secretbox_KEYBYTES:vr,crypto_secretbox_NONCEBYTES:br,crypto_secretbox_ZEROBYTES:dr,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:_r,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util={},r.util.decodeUTF8=function(r){var t,n=unescape(encodeURIComponent(r)),e=new Uint8Array(n.length);for(t=0;tt;t++)n.push(String.fromCharCode(r[t]));return btoa(n.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var t,n=atob(r),e=new Uint8Array(n.length);for(t=0;te)return null;for(var o=new Uint8Array(e),i=0;ie;e++)o[e]=t[e];for(e=0;e=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return G(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;ne;e++)n[e]=r[e];return G(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return P(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t),0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?t=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(t=window.msCrypto),t&&r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(t.getRandomValues(o),e=0;n>e;e++)r[e]=o[e];W(o)})):"undefined"!=typeof require&&(t=require("crypto"),t&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js new file mode 100644 index 00000000..b8edbbee --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js @@ -0,0 +1,1205 @@ +(function(nacl) { +'use strict'; + +// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri. +// Public domain. +// +// Implementation derived from TweetNaCl version 20140427. +// See for details: http://tweetnacl.cr.yp.to/ + +var u64 = function(h, l) { this.hi = h|0 >>> 0; this.lo = l|0 >>> 0; }; +var gf = function(init) { + var i, r = new Float64Array(16); + if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; + return r; +}; + +// Pluggable, initialized in high-level API below. +var randombytes = function(/* x, n */) { throw new Error('no PRNG'); }; + +var _0 = new Uint8Array(16); +var _9 = new Uint8Array(32); _9[0] = 9; + +var gf0 = gf(), + gf1 = gf([1]), + _121665 = gf([0xdb41, 1]), + D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]), + D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]), + X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]), + Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]), + I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]); + +function L32(x, c) { return (x << c) | (x >>> (32 - c)); } + +function ld32(x, i) { + var u = x[i+3] & 0xff; + u = (u<<8)|(x[i+2] & 0xff); + u = (u<<8)|(x[i+1] & 0xff); + return (u<<8)|(x[i+0] & 0xff); +} + +function dl64(x, i) { + var h = (x[i] << 24) | (x[i+1] << 16) | (x[i+2] << 8) | x[i+3]; + var l = (x[i+4] << 24) | (x[i+5] << 16) | (x[i+6] << 8) | x[i+7]; + return new u64(h, l); +} + +function st32(x, j, u) { + var i; + for (i = 0; i < 4; i++) { x[j+i] = u & 255; u >>>= 8; } +} + +function ts64(x, i, u) { + x[i] = (u.hi >> 24) & 0xff; + x[i+1] = (u.hi >> 16) & 0xff; + x[i+2] = (u.hi >> 8) & 0xff; + x[i+3] = u.hi & 0xff; + x[i+4] = (u.lo >> 24) & 0xff; + x[i+5] = (u.lo >> 16) & 0xff; + x[i+6] = (u.lo >> 8) & 0xff; + x[i+7] = u.lo & 0xff; +} + +function vn(x, xi, y, yi, n) { + var i,d = 0; + for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i]; + return (1 & ((d - 1) >>> 8)) - 1; +} + +function crypto_verify_16(x, xi, y, yi) { + return vn(x,xi,y,yi,16); +} + +function crypto_verify_32(x, xi, y, yi) { + return vn(x,xi,y,yi,32); +} + +function core(out,inp,k,c,h) { + var w = new Uint32Array(16), x = new Uint32Array(16), + y = new Uint32Array(16), t = new Uint32Array(4); + var i, j, m; + + for (i = 0; i < 4; i++) { + x[5*i] = ld32(c, 4*i); + x[1+i] = ld32(k, 4*i); + x[6+i] = ld32(inp, 4*i); + x[11+i] = ld32(k, 16+4*i); + } + + for (i = 0; i < 16; i++) y[i] = x[i]; + + for (i = 0; i < 20; i++) { + for (j = 0; j < 4; j++) { + for (m = 0; m < 4; m++) t[m] = x[(5*j+4*m)%16]; + t[1] ^= L32((t[0]+t[3])|0, 7); + t[2] ^= L32((t[1]+t[0])|0, 9); + t[3] ^= L32((t[2]+t[1])|0,13); + t[0] ^= L32((t[3]+t[2])|0,18); + for (m = 0; m < 4; m++) w[4*j+(j+m)%4] = t[m]; + } + for (m = 0; m < 16; m++) x[m] = w[m]; + } + + if (h) { + for (i = 0; i < 16; i++) x[i] = (x[i] + y[i]) | 0; + for (i = 0; i < 4; i++) { + x[5*i] = (x[5*i] - ld32(c, 4*i)) | 0; + x[6+i] = (x[6+i] - ld32(inp, 4*i)) | 0; + } + for (i = 0; i < 4; i++) { + st32(out,4*i,x[5*i]); + st32(out,16+4*i,x[6+i]); + } + } else { + for (i = 0; i < 16; i++) st32(out, 4 * i, (x[i] + y[i]) | 0); + } +} + +function crypto_core_salsa20(out,inp,k,c) { + core(out,inp,k,c,false); + return 0; +} + +function crypto_core_hsalsa20(out,inp,k,c) { + core(out,inp,k,c,true); + return 0; +} + +var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]); + // "expand 32-byte k" + +function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) { + var z = new Uint8Array(16), x = new Uint8Array(64); + var u, i; + if (!b) return 0; + for (i = 0; i < 16; i++) z[i] = 0; + for (i = 0; i < 8; i++) z[i] = n[i]; + while (b >= 64) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < 64; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i]; + u = 1; + for (i = 8; i < 16; i++) { + u = u + (z[i] & 0xff) | 0; + z[i] = u & 0xff; + u >>>= 8; + } + b -= 64; + cpos += 64; + if (m) mpos += 64; + } + if (b > 0) { + crypto_core_salsa20(x,z,k,sigma); + for (i = 0; i < b; i++) c[cpos+i] = (m?m[mpos+i]:0) ^ x[i]; + } + return 0; +} + +function crypto_stream_salsa20(c,cpos,d,n,k) { + return crypto_stream_salsa20_xor(c,cpos,null,0,d,n,k); +} + +function crypto_stream(c,cpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + return crypto_stream_salsa20(c,cpos,d,n.subarray(16),s); +} + +function crypto_stream_xor(c,cpos,m,mpos,d,n,k) { + var s = new Uint8Array(32); + crypto_core_hsalsa20(s,n,k,sigma); + return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,n.subarray(16),s); +} + +function add1305(h, c) { + var j, u = 0; + for (j = 0; j < 17; j++) { + u = (u + ((h[j] + c[j]) | 0)) | 0; + h[j] = u & 255; + u >>>= 8; + } +} + +var minusp = new Uint32Array([ + 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 252 +]); + +function crypto_onetimeauth(out, outpos, m, mpos, n, k) { + var s, i, j, u; + var x = new Uint32Array(17), r = new Uint32Array(17), + h = new Uint32Array(17), c = new Uint32Array(17), + g = new Uint32Array(17); + for (j = 0; j < 17; j++) r[j]=h[j]=0; + for (j = 0; j < 16; j++) r[j]=k[j]; + r[3]&=15; + r[4]&=252; + r[7]&=15; + r[8]&=252; + r[11]&=15; + r[12]&=252; + r[15]&=15; + + while (n > 0) { + for (j = 0; j < 17; j++) c[j] = 0; + for (j = 0; (j < 16) && (j < n); ++j) c[j] = m[mpos+j]; + c[j] = 1; + mpos += j; n -= j; + add1305(h,c); + for (i = 0; i < 17; i++) { + x[i] = 0; + for (j = 0; j < 17; j++) x[i] = (x[i] + (h[j] * ((j <= i) ? r[i - j] : ((320 * r[i + 17 - j])|0))) | 0) | 0; + } + for (i = 0; i < 17; i++) h[i] = x[i]; + u = 0; + for (j = 0; j < 16; j++) { + u = (u + h[j]) | 0; + h[j] = u & 255; + u >>>= 8; + } + u = (u + h[16]) | 0; h[16] = u & 3; + u = (5 * (u >>> 2)) | 0; + for (j = 0; j < 16; j++) { + u = (u + h[j]) | 0; + h[j] = u & 255; + u >>>= 8; + } + u = (u + h[16]) | 0; h[16] = u; + } + + for (j = 0; j < 17; j++) g[j] = h[j]; + add1305(h,minusp); + s = (-(h[16] >>> 7) | 0); + for (j = 0; j < 17; j++) h[j] ^= s & (g[j] ^ h[j]); + + for (j = 0; j < 16; j++) c[j] = k[j + 16]; + c[16] = 0; + add1305(h,c); + for (j = 0; j < 16; j++) out[outpos+j] = h[j]; + return 0; +} + +function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { + var x = new Uint8Array(16); + crypto_onetimeauth(x,0,m,mpos,n,k); + return crypto_verify_16(h,hpos,x,0); +} + +function crypto_secretbox(c,m,d,n,k) { + var i; + if (d < 32) return -1; + crypto_stream_xor(c,0,m,0,d,n,k); + crypto_onetimeauth(c, 16, c, 32, d - 32, c); + for (i = 0; i < 16; i++) c[i] = 0; + return 0; +} + +function crypto_secretbox_open(m,c,d,n,k) { + var i; + var x = new Uint8Array(32); + if (d < 32) return -1; + crypto_stream(x,0,32,n,k); + if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1; + crypto_stream_xor(m,0,c,0,d,n,k); + for (i = 0; i < 32; i++) m[i] = 0; + return 0; +} + +function set25519(r, a) { + var i; + for (i = 0; i < 16; i++) r[i] = a[i]|0; +} + +function car25519(o) { + var c; + var i; + for (i = 0; i < 16; i++) { + o[i] += 65536; + c = Math.floor(o[i] / 65536); + o[(i+1)*(i<15?1:0)] += c - 1 + 37 * (c-1) * (i===15?1:0); + o[i] -= (c * 65536); + } +} + +function sel25519(p, q, b) { + var t, c = ~(b-1); + for (var i = 0; i < 16; i++) { + t = c & (p[i] ^ q[i]); + p[i] ^= t; + q[i] ^= t; + } +} + +function pack25519(o, n) { + var i, j, b; + var m = gf(), t = gf(); + for (i = 0; i < 16; i++) t[i] = n[i]; + car25519(t); + car25519(t); + car25519(t); + for (j = 0; j < 2; j++) { + m[0] = t[0] - 0xffed; + for (i = 1; i < 15; i++) { + m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1); + m[i-1] &= 0xffff; + } + m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1); + b = (m[15]>>16) & 1; + m[14] &= 0xffff; + sel25519(t, m, 1-b); + } + for (i = 0; i < 16; i++) { + o[2*i] = t[i] & 0xff; + o[2*i+1] = t[i]>>8; + } +} + +function neq25519(a, b) { + var c = new Uint8Array(32), d = new Uint8Array(32); + pack25519(c, a); + pack25519(d, b); + return crypto_verify_32(c, 0, d, 0); +} + +function par25519(a) { + var d = new Uint8Array(32); + pack25519(d, a); + return d[0] & 1; +} + +function unpack25519(o, n) { + var i; + for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8); + o[15] &= 0x7fff; +} + +function A(o, a, b) { + var i; + for (i = 0; i < 16; i++) o[i] = (a[i] + b[i])|0; +} + +function Z(o, a, b) { + var i; + for (i = 0; i < 16; i++) o[i] = (a[i] - b[i])|0; +} + +function M(o, a, b) { + var i, j, t = new Float64Array(31); + for (i = 0; i < 31; i++) t[i] = 0; + for (i = 0; i < 16; i++) { + for (j = 0; j < 16; j++) { + t[i+j] += a[i] * b[j]; + } + } + for (i = 0; i < 15; i++) { + t[i] += 38 * t[i+16]; + } + for (i = 0; i < 16; i++) o[i] = t[i]; + car25519(o); + car25519(o); +} + +function S(o, a) { + M(o, a, a); +} + +function inv25519(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 253; a >= 0; a--) { + S(c, c); + if(a !== 2 && a !== 4) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function pow2523(o, i) { + var c = gf(); + var a; + for (a = 0; a < 16; a++) c[a] = i[a]; + for (a = 250; a >= 0; a--) { + S(c, c); + if(a !== 1) M(c, c, i); + } + for (a = 0; a < 16; a++) o[a] = c[a]; +} + +function crypto_scalarmult(q, n, p) { + var z = new Uint8Array(32); + var x = new Float64Array(80), r, i; + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(); + for (i = 0; i < 31; i++) z[i] = n[i]; + z[31]=(n[31]&127)|64; + z[0]&=248; + unpack25519(x,p); + for (i = 0; i < 16; i++) { + b[i]=x[i]; + d[i]=a[i]=c[i]=0; + } + a[0]=d[0]=1; + for (i=254; i>=0; --i) { + r=(z[i>>>3]>>>(i&7))&1; + sel25519(a,b,r); + sel25519(c,d,r); + A(e,a,c); + Z(a,a,c); + A(c,b,d); + Z(b,b,d); + S(d,e); + S(f,a); + M(a,c,a); + M(c,b,e); + A(e,a,c); + Z(a,a,c); + S(b,a); + Z(c,d,f); + M(a,c,_121665); + A(a,a,d); + M(c,c,a); + M(a,d,f); + M(d,b,x); + S(b,e); + sel25519(a,b,r); + sel25519(c,d,r); + } + for (i = 0; i < 16; i++) { + x[i+16]=a[i]; + x[i+32]=c[i]; + x[i+48]=b[i]; + x[i+64]=d[i]; + } + var x32 = x.subarray(32); + var x16 = x.subarray(16); + inv25519(x32,x32); + M(x16,x16,x32); + pack25519(q,x16); + return 0; +} + +function crypto_scalarmult_base(q, n) { + return crypto_scalarmult(q, n, _9); +} + +function crypto_box_keypair(y, x) { + randombytes(x, 32); + return crypto_scalarmult_base(y, x); +} + +function crypto_box_beforenm(k, y, x) { + var s = new Uint8Array(32); + crypto_scalarmult(s, x, y); + return crypto_core_hsalsa20(k, _0, s, sigma); +} + +var crypto_box_afternm = crypto_secretbox; +var crypto_box_open_afternm = crypto_secretbox_open; + +function crypto_box(c, m, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_afternm(c, m, d, n, k); +} + +function crypto_box_open(m, c, d, n, y, x) { + var k = new Uint8Array(32); + crypto_box_beforenm(k, y, x); + return crypto_box_open_afternm(m, c, d, n, k); +} + +function add64() { + var a = 0, b = 0, c = 0, d = 0, m16 = 65535, l, h, i; + for (i = 0; i < arguments.length; i++) { + l = arguments[i].lo; + h = arguments[i].hi; + a += (l & m16); b += (l >>> 16); + c += (h & m16); d += (h >>> 16); + } + + b += (a >>> 16); + c += (b >>> 16); + d += (c >>> 16); + + return new u64((c & m16) | (d << 16), (a & m16) | (b << 16)); +} + +function shr64(x, c) { + return new u64((x.hi >>> c), (x.lo >>> c) | (x.hi << (32 - c))); +} + +function xor64() { + var l = 0, h = 0, i; + for (i = 0; i < arguments.length; i++) { + l ^= arguments[i].lo; + h ^= arguments[i].hi; + } + return new u64(h, l); +} + +function R(x, c) { + var h, l, c1 = 32 - c; + if (c < 32) { + h = (x.hi >>> c) | (x.lo << c1); + l = (x.lo >>> c) | (x.hi << c1); + } else if (c < 64) { + h = (x.lo >>> c) | (x.hi << c1); + l = (x.hi >>> c) | (x.lo << c1); + } + return new u64(h, l); +} + +function Ch(x, y, z) { + var h = (x.hi & y.hi) ^ (~x.hi & z.hi), + l = (x.lo & y.lo) ^ (~x.lo & z.lo); + return new u64(h, l); +} + +function Maj(x, y, z) { + var h = (x.hi & y.hi) ^ (x.hi & z.hi) ^ (y.hi & z.hi), + l = (x.lo & y.lo) ^ (x.lo & z.lo) ^ (y.lo & z.lo); + return new u64(h, l); +} + +function Sigma0(x) { return xor64(R(x,28), R(x,34), R(x,39)); } +function Sigma1(x) { return xor64(R(x,14), R(x,18), R(x,41)); } +function sigma0(x) { return xor64(R(x, 1), R(x, 8), shr64(x,7)); } +function sigma1(x) { return xor64(R(x,19), R(x,61), shr64(x,6)); } + +var K = [ + new u64(0x428a2f98, 0xd728ae22), new u64(0x71374491, 0x23ef65cd), + new u64(0xb5c0fbcf, 0xec4d3b2f), new u64(0xe9b5dba5, 0x8189dbbc), + new u64(0x3956c25b, 0xf348b538), new u64(0x59f111f1, 0xb605d019), + new u64(0x923f82a4, 0xaf194f9b), new u64(0xab1c5ed5, 0xda6d8118), + new u64(0xd807aa98, 0xa3030242), new u64(0x12835b01, 0x45706fbe), + new u64(0x243185be, 0x4ee4b28c), new u64(0x550c7dc3, 0xd5ffb4e2), + new u64(0x72be5d74, 0xf27b896f), new u64(0x80deb1fe, 0x3b1696b1), + new u64(0x9bdc06a7, 0x25c71235), new u64(0xc19bf174, 0xcf692694), + new u64(0xe49b69c1, 0x9ef14ad2), new u64(0xefbe4786, 0x384f25e3), + new u64(0x0fc19dc6, 0x8b8cd5b5), new u64(0x240ca1cc, 0x77ac9c65), + new u64(0x2de92c6f, 0x592b0275), new u64(0x4a7484aa, 0x6ea6e483), + new u64(0x5cb0a9dc, 0xbd41fbd4), new u64(0x76f988da, 0x831153b5), + new u64(0x983e5152, 0xee66dfab), new u64(0xa831c66d, 0x2db43210), + new u64(0xb00327c8, 0x98fb213f), new u64(0xbf597fc7, 0xbeef0ee4), + new u64(0xc6e00bf3, 0x3da88fc2), new u64(0xd5a79147, 0x930aa725), + new u64(0x06ca6351, 0xe003826f), new u64(0x14292967, 0x0a0e6e70), + new u64(0x27b70a85, 0x46d22ffc), new u64(0x2e1b2138, 0x5c26c926), + new u64(0x4d2c6dfc, 0x5ac42aed), new u64(0x53380d13, 0x9d95b3df), + new u64(0x650a7354, 0x8baf63de), new u64(0x766a0abb, 0x3c77b2a8), + new u64(0x81c2c92e, 0x47edaee6), new u64(0x92722c85, 0x1482353b), + new u64(0xa2bfe8a1, 0x4cf10364), new u64(0xa81a664b, 0xbc423001), + new u64(0xc24b8b70, 0xd0f89791), new u64(0xc76c51a3, 0x0654be30), + new u64(0xd192e819, 0xd6ef5218), new u64(0xd6990624, 0x5565a910), + new u64(0xf40e3585, 0x5771202a), new u64(0x106aa070, 0x32bbd1b8), + new u64(0x19a4c116, 0xb8d2d0c8), new u64(0x1e376c08, 0x5141ab53), + new u64(0x2748774c, 0xdf8eeb99), new u64(0x34b0bcb5, 0xe19b48a8), + new u64(0x391c0cb3, 0xc5c95a63), new u64(0x4ed8aa4a, 0xe3418acb), + new u64(0x5b9cca4f, 0x7763e373), new u64(0x682e6ff3, 0xd6b2b8a3), + new u64(0x748f82ee, 0x5defb2fc), new u64(0x78a5636f, 0x43172f60), + new u64(0x84c87814, 0xa1f0ab72), new u64(0x8cc70208, 0x1a6439ec), + new u64(0x90befffa, 0x23631e28), new u64(0xa4506ceb, 0xde82bde9), + new u64(0xbef9a3f7, 0xb2c67915), new u64(0xc67178f2, 0xe372532b), + new u64(0xca273ece, 0xea26619c), new u64(0xd186b8c7, 0x21c0c207), + new u64(0xeada7dd6, 0xcde0eb1e), new u64(0xf57d4f7f, 0xee6ed178), + new u64(0x06f067aa, 0x72176fba), new u64(0x0a637dc5, 0xa2c898a6), + new u64(0x113f9804, 0xbef90dae), new u64(0x1b710b35, 0x131c471b), + new u64(0x28db77f5, 0x23047d84), new u64(0x32caab7b, 0x40c72493), + new u64(0x3c9ebe0a, 0x15c9bebc), new u64(0x431d67c4, 0x9c100d4c), + new u64(0x4cc5d4be, 0xcb3e42b6), new u64(0x597f299c, 0xfc657e2a), + new u64(0x5fcb6fab, 0x3ad6faec), new u64(0x6c44198c, 0x4a475817) +]; + +function crypto_hashblocks(x, m, n) { + var z = [], b = [], a = [], w = [], t, i, j; + + for (i = 0; i < 8; i++) z[i] = a[i] = dl64(x, 8*i); + + var pos = 0; + while (n >= 128) { + for (i = 0; i < 16; i++) w[i] = dl64(m, 8*i+pos); + for (i = 0; i < 80; i++) { + for (j = 0; j < 8; j++) b[j] = a[j]; + t = add64(a[7], Sigma1(a[4]), Ch(a[4], a[5], a[6]), K[i], w[i%16]); + b[7] = add64(t, Sigma0(a[0]), Maj(a[0], a[1], a[2])); + b[3] = add64(b[3], t); + for (j = 0; j < 8; j++) a[(j+1)%8] = b[j]; + if (i%16 === 15) { + for (j = 0; j < 16; j++) { + w[j] = add64(w[j], w[(j+9)%16], sigma0(w[(j+1)%16]), sigma1(w[(j+14)%16])); + } + } + } + + for (i = 0; i < 8; i++) { + a[i] = add64(a[i], z[i]); + z[i] = a[i]; + } + + pos += 128; + n -= 128; + } + + for (i = 0; i < 8; i++) ts64(x, 8*i, z[i]); + return n; +} + +var iv = new Uint8Array([ + 0x6a,0x09,0xe6,0x67,0xf3,0xbc,0xc9,0x08, + 0xbb,0x67,0xae,0x85,0x84,0xca,0xa7,0x3b, + 0x3c,0x6e,0xf3,0x72,0xfe,0x94,0xf8,0x2b, + 0xa5,0x4f,0xf5,0x3a,0x5f,0x1d,0x36,0xf1, + 0x51,0x0e,0x52,0x7f,0xad,0xe6,0x82,0xd1, + 0x9b,0x05,0x68,0x8c,0x2b,0x3e,0x6c,0x1f, + 0x1f,0x83,0xd9,0xab,0xfb,0x41,0xbd,0x6b, + 0x5b,0xe0,0xcd,0x19,0x13,0x7e,0x21,0x79 +]); + +function crypto_hash(out, m, n) { + var h = new Uint8Array(64), x = new Uint8Array(256); + var i, b = n; + + for (i = 0; i < 64; i++) h[i] = iv[i]; + + crypto_hashblocks(h, m, n); + n %= 128; + + for (i = 0; i < 256; i++) x[i] = 0; + for (i = 0; i < n; i++) x[i] = m[b-n+i]; + x[n] = 128; + + n = 256-128*(n<112?1:0); + x[n-9] = 0; + ts64(x, n-8, new u64((b / 0x20000000) | 0, b << 3)); + crypto_hashblocks(h, x, n); + + for (i = 0; i < 64; i++) out[i] = h[i]; + + return 0; +} + +function add(p, q) { + var a = gf(), b = gf(), c = gf(), + d = gf(), e = gf(), f = gf(), + g = gf(), h = gf(), t = gf(); + + Z(a, p[1], p[0]); + Z(t, q[1], q[0]); + M(a, a, t); + A(b, p[0], p[1]); + A(t, q[0], q[1]); + M(b, b, t); + M(c, p[3], q[3]); + M(c, c, D2); + M(d, p[2], q[2]); + A(d, d, d); + Z(e, b, a); + Z(f, d, c); + A(g, d, c); + A(h, b, a); + + M(p[0], e, f); + M(p[1], h, g); + M(p[2], g, f); + M(p[3], e, h); +} + +function cswap(p, q, b) { + var i; + for (i = 0; i < 4; i++) { + sel25519(p[i], q[i], b); + } +} + +function pack(r, p) { + var tx = gf(), ty = gf(), zi = gf(); + inv25519(zi, p[2]); + M(tx, p[0], zi); + M(ty, p[1], zi); + pack25519(r, ty); + r[31] ^= par25519(tx) << 7; +} + +function scalarmult(p, q, s) { + var b, i; + set25519(p[0], gf0); + set25519(p[1], gf1); + set25519(p[2], gf1); + set25519(p[3], gf0); + for (i = 255; i >= 0; --i) { + b = (s[(i/8)|0] >> (i&7)) & 1; + cswap(p, q, b); + add(q, p); + add(p, p); + cswap(p, q, b); + } +} + +function scalarbase(p, s) { + var q = [gf(), gf(), gf(), gf()]; + set25519(q[0], X); + set25519(q[1], Y); + set25519(q[2], gf1); + M(q[3], X, Y); + scalarmult(p, q, s); +} + +function crypto_sign_keypair(pk, sk, seeded) { + var d = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()]; + var i; + + if (!seeded) randombytes(sk, 32); + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + scalarbase(p, d); + pack(pk, p); + + for (i = 0; i < 32; i++) sk[i+32] = pk[i]; + return 0; +} + +var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]); + +function modL(r, x) { + var carry, i, j, k; + for (i = 63; i >= 32; --i) { + carry = 0; + for (j = i - 32, k = i - 12; j < k; ++j) { + x[j] += carry - 16 * x[i] * L[j - (i - 32)]; + carry = (x[j] + 128) >> 8; + x[j] -= carry * 256; + } + x[j] += carry; + x[i] = 0; + } + carry = 0; + for (j = 0; j < 32; j++) { + x[j] += carry - (x[31] >> 4) * L[j]; + carry = x[j] >> 8; + x[j] &= 255; + } + for (j = 0; j < 32; j++) x[j] -= carry * L[j]; + for (i = 0; i < 32; i++) { + x[i+1] += x[i] >> 8; + r[i] = x[i] & 255; + } +} + +function reduce(r) { + var x = new Float64Array(64), i; + for (i = 0; i < 64; i++) x[i] = r[i]; + for (i = 0; i < 64; i++) r[i] = 0; + modL(r, x); +} + +// Note: difference from C - smlen returned, not passed as argument. +function crypto_sign(sm, m, n, sk) { + var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64); + var i, j, x = new Float64Array(64); + var p = [gf(), gf(), gf(), gf()]; + + crypto_hash(d, sk, 32); + d[0] &= 248; + d[31] &= 127; + d[31] |= 64; + + var smlen = n + 64; + for (i = 0; i < n; i++) sm[64 + i] = m[i]; + for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; + + crypto_hash(r, sm.subarray(32), n+32); + reduce(r); + scalarbase(p, r); + pack(sm, p); + + for (i = 32; i < 64; i++) sm[i] = sk[i]; + crypto_hash(h, sm, n + 64); + reduce(h); + + for (i = 0; i < 64; i++) x[i] = 0; + for (i = 0; i < 32; i++) x[i] = r[i]; + for (i = 0; i < 32; i++) { + for (j = 0; j < 32; j++) { + x[i+j] += h[i] * d[j]; + } + } + + modL(sm.subarray(32), x); + return smlen; +} + +function unpackneg(r, p) { + var t = gf(), chk = gf(), num = gf(), + den = gf(), den2 = gf(), den4 = gf(), + den6 = gf(); + + set25519(r[2], gf1); + unpack25519(r[1], p); + S(num, r[1]); + M(den, num, D); + Z(num, num, r[2]); + A(den, r[2], den); + + S(den2, den); + S(den4, den2); + M(den6, den4, den2); + M(t, den6, num); + M(t, t, den); + + pow2523(t, t); + M(t, t, num); + M(t, t, den); + M(t, t, den); + M(r[0], t, den); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) M(r[0], r[0], I); + + S(chk, r[0]); + M(chk, chk, den); + if (neq25519(chk, num)) return -1; + + if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]); + + M(r[3], r[0], r[1]); + return 0; +} + +function crypto_sign_open(m, sm, n, pk) { + var i, mlen; + var t = new Uint8Array(32), h = new Uint8Array(64); + var p = [gf(), gf(), gf(), gf()], + q = [gf(), gf(), gf(), gf()]; + + mlen = -1; + if (n < 64) return -1; + + if (unpackneg(q, pk)) return -1; + + for (i = 0; i < n; i++) m[i] = sm[i]; + for (i = 0; i < 32; i++) m[i+32] = pk[i]; + crypto_hash(h, m, n); + reduce(h); + scalarmult(p, q, h); + + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; i++) m[i] = 0; + return -1; + } + + for (i = 0; i < n; i++) m[i] = sm[i + 64]; + mlen = n; + return mlen; +} + +var crypto_secretbox_KEYBYTES = 32, + crypto_secretbox_NONCEBYTES = 24, + crypto_secretbox_ZEROBYTES = 32, + crypto_secretbox_BOXZEROBYTES = 16, + crypto_scalarmult_BYTES = 32, + crypto_scalarmult_SCALARBYTES = 32, + crypto_box_PUBLICKEYBYTES = 32, + crypto_box_SECRETKEYBYTES = 32, + crypto_box_BEFORENMBYTES = 32, + crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES, + crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES, + crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES, + crypto_sign_BYTES = 64, + crypto_sign_PUBLICKEYBYTES = 32, + crypto_sign_SECRETKEYBYTES = 64, + crypto_sign_SEEDBYTES = 32, + crypto_hash_BYTES = 64; + +nacl.lowlevel = { + crypto_core_hsalsa20: crypto_core_hsalsa20, + crypto_stream_xor: crypto_stream_xor, + crypto_stream: crypto_stream, + crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, + crypto_stream_salsa20: crypto_stream_salsa20, + crypto_onetimeauth: crypto_onetimeauth, + crypto_onetimeauth_verify: crypto_onetimeauth_verify, + crypto_verify_16: crypto_verify_16, + crypto_verify_32: crypto_verify_32, + crypto_secretbox: crypto_secretbox, + crypto_secretbox_open: crypto_secretbox_open, + crypto_scalarmult: crypto_scalarmult, + crypto_scalarmult_base: crypto_scalarmult_base, + crypto_box_beforenm: crypto_box_beforenm, + crypto_box_afternm: crypto_box_afternm, + crypto_box: crypto_box, + crypto_box_open: crypto_box_open, + crypto_box_keypair: crypto_box_keypair, + crypto_hash: crypto_hash, + crypto_sign: crypto_sign, + crypto_sign_keypair: crypto_sign_keypair, + crypto_sign_open: crypto_sign_open, + + crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES, + crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES, + crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES, + crypto_scalarmult_BYTES: crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES, + crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES, + crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES, + crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES, + crypto_box_NONCEBYTES: crypto_box_NONCEBYTES, + crypto_box_ZEROBYTES: crypto_box_ZEROBYTES, + crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES, + crypto_sign_BYTES: crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES, + crypto_hash_BYTES: crypto_hash_BYTES +}; + +/* High-level API */ + +function checkLengths(k, n) { + if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size'); + if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size'); +} + +function checkBoxLengths(pk, sk) { + if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size'); + if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size'); +} + +function checkArrayTypes() { + var t, i; + for (i = 0; i < arguments.length; i++) { + if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]') + throw new TypeError('unexpected type ' + t + ', use Uint8Array'); + } +} + +function cleanup(arr) { + for (var i = 0; i < arr.length; i++) arr[i] = 0; +} + +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; + +nacl.randomBytes = function(n) { + var b = new Uint8Array(n); + randombytes(b, n); + return b; +}; + +nacl.secretbox = function(msg, nonce, key) { + checkArrayTypes(msg, nonce, key); + checkLengths(key, nonce); + var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length); + var c = new Uint8Array(m.length); + for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i]; + crypto_secretbox(c, m, m.length, nonce, key); + return c.subarray(crypto_secretbox_BOXZEROBYTES); +}; + +nacl.secretbox.open = function(box, nonce, key) { + checkArrayTypes(box, nonce, key); + checkLengths(key, nonce); + var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length); + var m = new Uint8Array(c.length); + for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i]; + if (c.length < 32) return false; + if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false; + return m.subarray(crypto_secretbox_ZEROBYTES); +}; + +nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES; +nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES; +nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES; + +nacl.scalarMult = function(n, p) { + checkArrayTypes(n, p); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult(q, n, p); + return q; +}; + +nacl.scalarMult.base = function(n) { + checkArrayTypes(n); + if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size'); + var q = new Uint8Array(crypto_scalarmult_BYTES); + crypto_scalarmult_base(q, n); + return q; +}; + +nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES; +nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES; + +nacl.box = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox(msg, nonce, k); +}; + +nacl.box.before = function(publicKey, secretKey) { + checkArrayTypes(publicKey, secretKey); + checkBoxLengths(publicKey, secretKey); + var k = new Uint8Array(crypto_box_BEFORENMBYTES); + crypto_box_beforenm(k, publicKey, secretKey); + return k; +}; + +nacl.box.after = nacl.secretbox; + +nacl.box.open = function(msg, nonce, publicKey, secretKey) { + var k = nacl.box.before(publicKey, secretKey); + return nacl.secretbox.open(msg, nonce, k); +}; + +nacl.box.open.after = nacl.secretbox.open; + +nacl.box.keyPair = function() { + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_box_SECRETKEYBYTES); + crypto_box_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.box.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_box_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES); + crypto_scalarmult_base(pk, secretKey); + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES; +nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES; +nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES; +nacl.box.nonceLength = crypto_box_NONCEBYTES; +nacl.box.overheadLength = nacl.secretbox.overheadLength; + +nacl.sign = function(msg, secretKey) { + checkArrayTypes(msg, secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length); + crypto_sign(signedMsg, msg, msg.length, secretKey); + return signedMsg; +}; + +nacl.sign.open = function(signedMsg, publicKey) { + if (arguments.length !== 2) + throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?'); + checkArrayTypes(signedMsg, publicKey); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var tmp = new Uint8Array(signedMsg.length); + var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); + if (mlen < 0) return null; + var m = new Uint8Array(mlen); + for (var i = 0; i < m.length; i++) m[i] = tmp[i]; + return m; +}; + +nacl.sign.detached = function(msg, secretKey) { + var signedMsg = nacl.sign(msg, secretKey); + var sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; + return sig; +}; + +nacl.sign.detached.verify = function(msg, sig, publicKey) { + checkArrayTypes(msg, sig, publicKey); + if (sig.length !== crypto_sign_BYTES) + throw new Error('bad signature size'); + if (publicKey.length !== crypto_sign_PUBLICKEYBYTES) + throw new Error('bad public key size'); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; + return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0); +}; + +nacl.sign.keyPair = function() { + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + crypto_sign_keypair(pk, sk); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.keyPair.fromSecretKey = function(secretKey) { + checkArrayTypes(secretKey); + if (secretKey.length !== crypto_sign_SECRETKEYBYTES) + throw new Error('bad secret key size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i]; + return {publicKey: pk, secretKey: new Uint8Array(secretKey)}; +}; + +nacl.sign.keyPair.fromSeed = function(seed) { + checkArrayTypes(seed); + if (seed.length !== crypto_sign_SEEDBYTES) + throw new Error('bad seed size'); + var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES); + var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES); + for (var i = 0; i < 32; i++) sk[i] = seed[i]; + crypto_sign_keypair(pk, sk, true); + return {publicKey: pk, secretKey: sk}; +}; + +nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES; +nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES; +nacl.sign.seedLength = crypto_sign_SEEDBYTES; +nacl.sign.signatureLength = crypto_sign_BYTES; + +nacl.hash = function(msg) { + checkArrayTypes(msg); + var h = new Uint8Array(crypto_hash_BYTES); + crypto_hash(h, msg, msg.length); + return h; +}; + +nacl.hash.hashLength = crypto_hash_BYTES; + +nacl.verify = function(x, y) { + checkArrayTypes(x, y); + // Zero length arguments are considered not equal. + if (x.length === 0 || y.length === 0) return false; + if (x.length !== y.length) return false; + return (vn(x, 0, y, 0, x.length) === 0) ? true : false; +}; + +nacl.setPRNG = function(fn) { + randombytes = fn; +}; + +(function() { + // Initialize PRNG if environment provides CSPRNG. + // If not, methods calling randombytes will throw. + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } else if (typeof require !== 'undefined') { + // Node.js. + crypto = require('crypto'); + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = crypto.randomBytes(n); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } + } +})(); + +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js new file mode 100644 index 00000000..95d86950 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js @@ -0,0 +1 @@ +!function(r){"use strict";function n(r,n){return r<>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function p(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function v(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,p(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(p(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,p(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function b(r,n,e,t,o,i){var a=new Uint8Array(16);return v(a,0,e,t,o,i),f(r,n,a,0)}function A(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),v(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function U(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==b(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function _(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function d(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function E(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(d(a),d(a),d(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,E(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];d(r),d(r)}function L(r,n){Y(r,n,n)}function C(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function k(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,E(f,u,t),E(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ur),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),E(f,u,t),E(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return C(l,l),Y(h,h,l),x(r,h),0}function z(r,n){return k(r,n,vr)}function P(r,n){return gr(n,32),z(r,n)}function O(r,n,e){var t=new Uint8Array(32);return k(t,e,n),y(r,pr,t,Br)}function F(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Kr(r,n,e,t,a)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function j(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function G(){var r,n=0,e=0;for(r=0;rn?(e=r.hi>>>n|r.lo<>>n|r.hi<n&&(e=r.lo>>>n|r.hi<>>n|r.lo<a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),Z(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,q(w[0]),V(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,dr),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)E(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();C(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(_(r[0],br),_(r[1],Ar),_(r[2],Ar),_(r[3],br),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];_(e[0],Er),_(e[1],xr),_(e[2],Ar),Y(e[3],Er,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*Cr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*Cr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*Cr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return _(r[2],Ar),S(r[1],n),L(o,r[1]),Y(i,o,_r),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),R(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],br,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==Rr)throw new Error("bad key size");if(n.length!==kr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Nr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;nn;n++)e.push(String.fromCharCode(r[n]));return btoa(e.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var n,e=atob(r),t=new Uint8Array(e.length);for(n=0;nt)return null;for(var o=new Uint8Array(t),i=0;it;t++)o[t]=n[t];for(t=0;t=0},r.sign.keyPair=function(){var r=new Uint8Array(qr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(qr),e=0;et;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=qr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Vr,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?n=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(n=window.msCrypto),n&&r.setPRNG(function(r,e){var t,o=new Uint8Array(e);for(n.getRandomValues(o),t=0;e>t;t++)r[t]=o[t];sr(o)})):"undefined"!=typeof require&&(n=require("crypto"),n&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json new file mode 100644 index 00000000..c897d3b7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json @@ -0,0 +1,94 @@ +{ + "name": "tweetnacl", + "version": "0.13.2", + "description": "Port of TweetNaCl cryptographic library to JavaScript", + "main": "nacl-fast.js", + "directories": { + "test": "test" + }, + "scripts": { + "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js", + "test": "tape test/*.js | faucet", + "testall": "make -C test/c && tape test/*.js test/c/*.js | faucet", + "browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null", + "browser-quick": "browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", + "testling": "browserify test/browser/testling_init.js test/*.js | testling | faucet", + "firefox": "browserify test/browser/testling_init.js test/*.js | testling -x firefox | faucet", + "chrome": "browserify test/browser/testling_init.js test/*.js | testling -x google-chrome | faucet", + "bench": "node test/benchmark/bench.js", + "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "chrome/22..latest", + "firefox/16..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6..latest", + "ipad/6..latest", + "android-browser/latest" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/dchest/tweetnacl-js.git" + }, + "keywords": [ + "crypto", + "cryptography", + "curve25519", + "ed25519", + "encrypt", + "hash", + "key", + "nacl", + "poly1305", + "public", + "salsa20", + "signatures" + ], + "author": { + "name": "TweetNaCl-js contributors" + }, + "license": "CC0-1.0", + "bugs": { + "url": "https://github.com/dchest/tweetnacl-js/issues" + }, + "homepage": "https://dchest.github.io/tweetnacl-js", + "devDependencies": { + "browserify": "^10.1.3", + "eslint": "^1.4.3", + "faucet": "0.0.1", + "tap-browser-color": "^0.1.2", + "tape": "^4.0.0", + "testling": "^1.7.1", + "uglify-js": "^2.4.21" + }, + "browser": { + "buffer": false, + "crypto": false + }, + "gitHead": "f093f0c34fbab5caf51f3ed9a48149c37041abb3", + "_id": "tweetnacl@0.13.2", + "_shasum": "453161770469d45cd266c36404e2bc99a8fa9944", + "_from": "tweetnacl@>=0.13.0 <1.0.0", + "_npmVersion": "2.12.1", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "dchest", + "email": "dmitry@codingrobots.com" + }, + "dist": { + "shasum": "453161770469d45cd266c36404e2bc99a8fa9944", + "tarball": "http://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.2.tgz" + }, + "maintainers": [ + { + "name": "dchest", + "email": "dmitry@codingrobots.com" + } + ], + "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json new file mode 100644 index 00000000..eba284e4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json @@ -0,0 +1,87 @@ +{ + "name": "sshpk", + "version": "1.7.1", + "description": "A library for finding and using SSH public keys", + "main": "lib/index.js", + "scripts": { + "test": "tape test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/arekinath/node-sshpk.git" + }, + "author": { + "name": "Joyent, Inc" + }, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Alex Wilson", + "email": "alex@cooperi.net" + } + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/arekinath/node-sshpk/issues" + }, + "engines": { + "node": ">=0.8.0" + }, + "directories": { + "bin": "./bin", + "lib": "./lib" + }, + "homepage": "https://github.com/arekinath/node-sshpk#readme", + "dependencies": { + "asn1": ">=0.2.3 <0.3.0", + "assert-plus": ">=0.2.0 <0.3.0", + "dashdash": ">=1.10.1 <2.0.0", + "jsbn": ">=0.1.0 <0.2.0", + "tweetnacl": ">=0.13.0 <1.0.0", + "jodid25519": ">=1.0.0 <2.0.0", + "ecc-jsbn": ">=0.0.1 <1.0.0" + }, + "optionalDependencies": { + "jsbn": ">=0.1.0 <0.2.0", + "tweetnacl": ">=0.13.0 <1.0.0", + "jodid25519": ">=1.0.0 <2.0.0", + "ecc-jsbn": ">=0.0.1 <1.0.0" + }, + "devDependencies": { + "tape": ">=3.5.0 <4.0.0", + "benchmark": ">=1.0.0 <2.0.0", + "sinon": ">=1.17.2 <2.0.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv" + }, + "gitHead": "71dd768e94d6214a0b8e1196ca78297b582c6fb0", + "_id": "sshpk@1.7.1", + "_shasum": "565e386c42a77e6062fbd14c0472ff21cd53398c", + "_from": "sshpk@>=1.7.0 <2.0.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + "dist": { + "shasum": "565e386c42a77e6062fbd14c0472ff21cd53398c", + "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.1.tgz" + }, + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + } + ], + "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/package.json new file mode 100644 index 00000000..3d20cb8b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/http-signature/package.json @@ -0,0 +1,83 @@ +{ + "name": "http-signature", + "description": "Reference implementation of Joyent's HTTP Signature scheme.", + "version": "1.1.0", + "license": "MIT", + "author": { + "name": "Joyent, Inc" + }, + "contributors": [ + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "David I. Lehn", + "email": "dil@lehn.org" + }, + { + "name": "Patrick Mooney", + "email": "patrick.f.mooney@gmail.com" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/joyent/node-http-signature.git" + }, + "homepage": "https://github.com/joyent/node-http-signature/", + "bugs": { + "url": "https://github.com/joyent/node-http-signature/issues" + }, + "keywords": [ + "https", + "request" + ], + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + }, + "main": "lib/index.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": { + "assert-plus": "^0.1.5", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "devDependencies": { + "node-uuid": "^1.4.1", + "tap": "0.4.2" + }, + "gitHead": "162c2f0144b0645a57517d6d91fafcde3840cde2", + "_id": "http-signature@1.1.0", + "_shasum": "5d2d7e9b6ef49980ad5b128d8e4ef09a31c90d95", + "_from": "http-signature@>=1.1.0 <1.2.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + "dist": { + "shasum": "5d2d7e9b6ef49980ad5b128d8e4ef09a31c90d95", + "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-1.1.0.tgz" + }, + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + { + "name": "mcavage", + "email": "mcavage@gmail.com" + }, + { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/LICENSE.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/LICENSE.md new file mode 100644 index 00000000..ee27ba4b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/LICENSE.md @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/README.md new file mode 100644 index 00000000..27528639 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/README.md @@ -0,0 +1,16 @@ +# is-typedarray [![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) + +Detect whether or not an object is a +[Typed Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays). + +## Usage + +[![NPM](https://nodei.co/npm/is-typedarray.png)](https://nodei.co/npm/is-typedarray/) + +### isTypedArray(array) + +Returns `true` when array is a Typed Array, and `false` when it is not. + +## License + +MIT. See [LICENSE.md](http://github.com/hughsk/is-typedarray/blob/master/LICENSE.md) for details. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/index.js new file mode 100644 index 00000000..58596036 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/index.js @@ -0,0 +1,41 @@ +module.exports = isTypedArray +isTypedArray.strict = isStrictTypedArray +isTypedArray.loose = isLooseTypedArray + +var toString = Object.prototype.toString +var names = { + '[object Int8Array]': true + , '[object Int16Array]': true + , '[object Int32Array]': true + , '[object Uint8Array]': true + , '[object Uint8ClampedArray]': true + , '[object Uint16Array]': true + , '[object Uint32Array]': true + , '[object Float32Array]': true + , '[object Float64Array]': true +} + +function isTypedArray(arr) { + return ( + isStrictTypedArray(arr) + || isLooseTypedArray(arr) + ) +} + +function isStrictTypedArray(arr) { + return ( + arr instanceof Int8Array + || arr instanceof Int16Array + || arr instanceof Int32Array + || arr instanceof Uint8Array + || arr instanceof Uint8ClampedArray + || arr instanceof Uint16Array + || arr instanceof Uint32Array + || arr instanceof Float32Array + || arr instanceof Float64Array + ) +} + +function isLooseTypedArray(arr) { + return names[toString.call(arr)] +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/package.json new file mode 100644 index 00000000..861ef4f7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/package.json @@ -0,0 +1,57 @@ +{ + "name": "is-typedarray", + "version": "1.0.0", + "description": "Detect whether or not an object is a Typed Array", + "main": "index.js", + "scripts": { + "test": "node test" + }, + "author": { + "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", + "url": "http://hughsk.io/" + }, + "license": "MIT", + "dependencies": {}, + "devDependencies": { + "tape": "^2.13.1" + }, + "repository": { + "type": "git", + "url": "git://github.com/hughsk/is-typedarray.git" + }, + "keywords": [ + "typed", + "array", + "detect", + "is", + "util" + ], + "bugs": { + "url": "https://github.com/hughsk/is-typedarray/issues" + }, + "homepage": "https://github.com/hughsk/is-typedarray", + "gitHead": "0617cfa871686cf541af62b144f130488f44f6fe", + "_id": "is-typedarray@1.0.0", + "_shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", + "_from": "is-typedarray@>=1.0.0 <1.1.0", + "_npmVersion": "2.7.5", + "_nodeVersion": "0.10.36", + "_npmUser": { + "name": "hughsk", + "email": "hughskennedy@gmail.com" + }, + "dist": { + "shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", + "tarball": "http://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + }, + "maintainers": [ + { + "name": "hughsk", + "email": "hughskennedy@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/test.js new file mode 100644 index 00000000..b0c176fa --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/is-typedarray/test.js @@ -0,0 +1,34 @@ +var test = require('tape') +var ista = require('./') + +test('strict', function(t) { + t.ok(ista.strict(new Int8Array), 'Int8Array') + t.ok(ista.strict(new Int16Array), 'Int16Array') + t.ok(ista.strict(new Int32Array), 'Int32Array') + t.ok(ista.strict(new Uint8Array), 'Uint8Array') + t.ok(ista.strict(new Uint16Array), 'Uint16Array') + t.ok(ista.strict(new Uint32Array), 'Uint32Array') + t.ok(ista.strict(new Float32Array), 'Float32Array') + t.ok(ista.strict(new Float64Array), 'Float64Array') + + t.ok(!ista.strict(new Array), 'Array') + t.ok(!ista.strict([]), '[]') + + t.end() +}) + +test('loose', function(t) { + t.ok(ista.loose(new Int8Array), 'Int8Array') + t.ok(ista.loose(new Int16Array), 'Int16Array') + t.ok(ista.loose(new Int32Array), 'Int32Array') + t.ok(ista.loose(new Uint8Array), 'Uint8Array') + t.ok(ista.loose(new Uint16Array), 'Uint16Array') + t.ok(ista.loose(new Uint32Array), 'Uint32Array') + t.ok(ista.loose(new Float32Array), 'Float32Array') + t.ok(ista.loose(new Float64Array), 'Float64Array') + + t.ok(!ista.loose(new Array), 'Array') + t.ok(!ista.loose([]), '[]') + + t.end() +}) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.jshintrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.jshintrc new file mode 100644 index 00000000..c8ef3ca4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.jshintrc @@ -0,0 +1,59 @@ +{ + "predef": [ ] + , "bitwise": false + , "camelcase": false + , "curly": false + , "eqeqeq": false + , "forin": false + , "immed": false + , "latedef": false + , "noarg": true + , "noempty": true + , "nonew": true + , "plusplus": false + , "quotmark": true + , "regexp": false + , "undef": true + , "unused": true + , "strict": false + , "trailing": true + , "maxlen": 120 + , "asi": true + , "boss": true + , "debug": true + , "eqnull": true + , "esnext": true + , "evil": true + , "expr": true + , "funcscope": false + , "globalstrict": false + , "iterator": false + , "lastsemic": true + , "laxbreak": true + , "laxcomma": true + , "loopfunc": true + , "multistr": false + , "onecase": false + , "proto": false + , "regexdash": false + , "scripturl": true + , "smarttabs": false + , "shadow": false + , "sub": true + , "supernew": false + , "validthis": true + , "browser": true + , "couch": false + , "devel": false + , "dojo": false + , "mootools": false + , "node": true + , "nonstandard": true + , "prototypejs": false + , "rhino": false + , "worker": true + , "wsh": false + , "nomen": false + , "onevar": false + , "passfail": false +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.npmignore new file mode 100644 index 00000000..aa1ec1ea --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.npmignore @@ -0,0 +1 @@ +*.tgz diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.travis.yml new file mode 100644 index 00000000..1fec2ab9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "0.8" + - "0.10" + - "0.11" +branches: + only: + - master +notifications: + email: + - rod@vagg.org +script: npm test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/LICENSE.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/LICENSE.md new file mode 100644 index 00000000..43f7153f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/LICENSE.md @@ -0,0 +1,11 @@ +The MIT License (MIT) +===================== + +Copyright (c) 2015 Rod Vagg +--------------------------- + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/README.md new file mode 100644 index 00000000..06770e82 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/README.md @@ -0,0 +1,66 @@ +# isStream + +[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream) + +**Test if an object is a `Stream`** + +[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/) + +The missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**. + +## Usage: + +```js +var isStream = require('isstream') +var Stream = require('stream') + +isStream(new Stream()) // true + +isStream({}) // false + +isStream(new Stream.Readable()) // true +isStream(new Stream.Writable()) // true +isStream(new Stream.Duplex()) // true +isStream(new Stream.Transform()) // true +isStream(new Stream.PassThrough()) // true +``` + +## But wait! There's more! + +You can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes. + +```js +var isReadable = require('isstream').isReadable +var isWritable = require('isstream').isWritable +var isDuplex = require('isstream').isDuplex +var Stream = require('stream') + +isReadable(new Stream()) // false +isWritable(new Stream()) // false +isDuplex(new Stream()) // false + +isReadable(new Stream.Readable()) // true +isReadable(new Stream.Writable()) // false +isReadable(new Stream.Duplex()) // true +isReadable(new Stream.Transform()) // true +isReadable(new Stream.PassThrough()) // true + +isWritable(new Stream.Readable()) // false +isWritable(new Stream.Writable()) // true +isWritable(new Stream.Duplex()) // true +isWritable(new Stream.Transform()) // true +isWritable(new Stream.PassThrough()) // true + +isDuplex(new Stream.Readable()) // false +isDuplex(new Stream.Writable()) // false +isDuplex(new Stream.Duplex()) // true +isDuplex(new Stream.Transform()) // true +isDuplex(new Stream.PassThrough()) // true +``` + +*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).* + + +## License + +**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/isstream.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/isstream.js new file mode 100644 index 00000000..a1d104a7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/isstream.js @@ -0,0 +1,27 @@ +var stream = require('stream') + + +function isStream (obj) { + return obj instanceof stream.Stream +} + + +function isReadable (obj) { + return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object' +} + + +function isWritable (obj) { + return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object' +} + + +function isDuplex (obj) { + return isReadable(obj) && isWritable(obj) +} + + +module.exports = isStream +module.exports.isReadable = isReadable +module.exports.isWritable = isWritable +module.exports.isDuplex = isDuplex diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/package.json new file mode 100644 index 00000000..85cb14c9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/package.json @@ -0,0 +1,59 @@ +{ + "name": "isstream", + "version": "0.1.2", + "description": "Determine if an object is a Stream", + "main": "isstream.js", + "scripts": { + "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/isstream.git" + }, + "keywords": [ + "stream", + "type", + "streams", + "readable-stream", + "hippo" + ], + "devDependencies": { + "tape": "~2.12.3", + "core-util-is": "~1.0.0", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "inherits": "~2.0.1" + }, + "author": { + "name": "Rod Vagg", + "email": "rod@vagg.org" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/rvagg/isstream/issues" + }, + "homepage": "https://github.com/rvagg/isstream", + "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc", + "_id": "isstream@0.1.2", + "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "_from": "isstream@>=0.1.2 <0.2.0", + "_npmVersion": "2.6.1", + "_nodeVersion": "1.4.3", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "dist": { + "shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "tarball": "http://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/test.js new file mode 100644 index 00000000..8c950c55 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/isstream/test.js @@ -0,0 +1,168 @@ +var tape = require('tape') + , EE = require('events').EventEmitter + , util = require('util') + + + , isStream = require('./') + , isReadable = require('./').isReadable + , isWritable = require('./').isWritable + , isDuplex = require('./').isDuplex + + , CoreStreams = require('stream') + , ReadableStream10 = require('./readable-stream-1.0/') + , ReadableStream11 = require('./readable-stream-1.1/') + + +function test (pass, type, stream) { + tape('isStream(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isStream(stream), type) + }) +} + + +function testReadable (pass, type, stream) { + tape('isReadable(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isReadable(stream), type) + }) +} + + +function testWritable (pass, type, stream) { + tape('isWritable(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isWritable(stream), type) + }) +} + + +function testDuplex (pass, type, stream) { + tape('isDuplex(' + type + ')', function (t) { + t.plan(1) + t.ok(pass === isDuplex(stream), type) + }) +} + + +[ undefined, null, '', true, false, 0, 1, 1.0, 'string', {}, function foo () {} ].forEach(function (o) { + test(false, 'non-stream / primitive: ' + (JSON.stringify(o) || (o && o.toString()) || o), o) +}) + + +test(false, 'fake stream obj', { pipe: function () {} }) + + +;(function () { + + // looks like a stream! + + function Stream () { + EE.call(this) + } + util.inherits(Stream, EE) + Stream.prototype.pipe = function () {} + Stream.Stream = Stream + + test(false, 'fake stream "new Stream()"', new Stream()) + +}()) + + +test(true, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +test(true, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +test(true, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +test(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +test(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +test(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +test(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +test(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +test(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +test(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +test(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +test(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +test(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +test(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +test(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +test(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +testReadable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +testReadable(true, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +testReadable(false, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +testReadable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +testReadable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +testReadable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +testReadable(true, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +testReadable(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +testReadable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +testReadable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +testReadable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +testReadable(true, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +testReadable(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +testReadable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +testReadable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +testReadable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +testWritable(false, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +testWritable(false, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +testWritable(true, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +testWritable(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +testWritable(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +testWritable(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +testWritable(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +testWritable(true, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +testWritable(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +testWritable(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +testWritable(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +testWritable(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +testWritable(true, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +testWritable(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +testWritable(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +testWritable(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +testDuplex(false, 'CoreStreams.Stream', new (CoreStreams.Stream)()) +testDuplex(false, 'CoreStreams.Readable', new (CoreStreams.Readable)()) +testDuplex(false, 'CoreStreams.Writable', new (CoreStreams.Writable)()) +testDuplex(true, 'CoreStreams.Duplex', new (CoreStreams.Duplex)()) +testDuplex(true, 'CoreStreams.Transform', new (CoreStreams.Transform)()) +testDuplex(true, 'CoreStreams.PassThrough', new (CoreStreams.PassThrough)()) + +testDuplex(false, 'ReadableStream10.Readable', new (ReadableStream10.Readable)()) +testDuplex(false, 'ReadableStream10.Writable', new (ReadableStream10.Writable)()) +testDuplex(true, 'ReadableStream10.Duplex', new (ReadableStream10.Duplex)()) +testDuplex(true, 'ReadableStream10.Transform', new (ReadableStream10.Transform)()) +testDuplex(true, 'ReadableStream10.PassThrough', new (ReadableStream10.PassThrough)()) + +testDuplex(false, 'ReadableStream11.Readable', new (ReadableStream11.Readable)()) +testDuplex(false, 'ReadableStream11.Writable', new (ReadableStream11.Writable)()) +testDuplex(true, 'ReadableStream11.Duplex', new (ReadableStream11.Duplex)()) +testDuplex(true, 'ReadableStream11.Transform', new (ReadableStream11.Transform)()) +testDuplex(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrough)()) + + +;[ CoreStreams, ReadableStream10, ReadableStream11 ].forEach(function (p) { + [ 'Stream', 'Readable', 'Writable', 'Duplex', 'Transform', 'PassThrough' ].forEach(function (k) { + if (!p[k]) + return + + function SubStream () { + p[k].call(this) + } + util.inherits(SubStream, p[k]) + + test(true, 'Stream subclass: ' + p.name + '.' + k, new SubStream()) + + }) +}) + + + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/.npmignore new file mode 100644 index 00000000..17d6b367 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/.npmignore @@ -0,0 +1 @@ +/*.tgz diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md new file mode 100644 index 00000000..42bcb60a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md @@ -0,0 +1,14 @@ +## Unreleased +- Fixes stringify to only take ancestors into account when checking + circularity. + It previously assumed every visited object was circular which led to [false + positives][issue9]. + Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago. +- Fixes calling the `replacer` function in the proper context (`thisArg`). +- Fixes calling the `cycleReplacer` function in the proper context (`thisArg`). +- Speeds serializing by a factor of + Big-O(h-my-god-it-linearly-searched-every-object) it had ever seen. Searching + only the ancestors for a circular references speeds up things considerably. + +[must]: https://github.com/moll/js-must +[issue9]: https://github.com/isaacs/json-stringify-safe/issues/9 diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/Makefile b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/Makefile new file mode 100644 index 00000000..36088c72 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/Makefile @@ -0,0 +1,35 @@ +NODE_OPTS = +TEST_OPTS = + +love: + @echo "Feel like makin' love." + +test: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot $(TEST_OPTS) + +spec: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec $(TEST_OPTS) + +autotest: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R dot --watch $(TEST_OPTS) + +autospec: + @node $(NODE_OPTS) ./node_modules/.bin/_mocha -R spec --watch $(TEST_OPTS) + +pack: + @file=$$(npm pack); echo "$$file"; tar tf "$$file" + +publish: + npm publish + +tag: + git tag "v$$(node -e 'console.log(require("./package").version)')" + +clean: + rm -f *.tgz + npm prune --production + +.PHONY: love +.PHONY: test spec autotest autospec +.PHONY: pack publish tag +.PHONY: clean diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/README.md new file mode 100644 index 00000000..a11f302a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/README.md @@ -0,0 +1,52 @@ +# json-stringify-safe + +Like JSON.stringify, but doesn't throw on circular references. + +## Usage + +Takes the same arguments as `JSON.stringify`. + +```javascript +var stringify = require('json-stringify-safe'); +var circularObj = {}; +circularObj.circularRef = circularObj; +circularObj.list = [ circularObj, circularObj ]; +console.log(stringify(circularObj, null, 2)); +``` + +Output: + +```json +{ + "circularRef": "[Circular]", + "list": [ + "[Circular]", + "[Circular]" + ] +} +``` + +## Details + +``` +stringify(obj, serializer, indent, decycler) +``` + +The first three arguments are the same as to JSON.stringify. The last +is an argument that's only used when the object has been seen already. + +The default `decycler` function returns the string `'[Circular]'`. +If, for example, you pass in `function(k,v){}` (return nothing) then it +will prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`, +then cyclical objects will always be represented as `{"foo":"bar"}` in +the result. + +``` +stringify.getSerialize(serializer, decycler) +``` + +Returns a serializer that can be used elsewhere. This is the actual +function that's passed to JSON.stringify. + +**Note** that the function returned from `getSerialize` is stateful for now, so +do **not** use it more than once. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/package.json new file mode 100644 index 00000000..ccd55b00 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/package.json @@ -0,0 +1,68 @@ +{ + "name": "json-stringify-safe", + "version": "5.0.1", + "description": "Like JSON.stringify, but doesn't blow up on circular refs.", + "keywords": [ + "json", + "stringify", + "circular", + "safe" + ], + "homepage": "https://github.com/isaacs/json-stringify-safe", + "bugs": { + "url": "https://github.com/isaacs/json-stringify-safe/issues" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "contributors": [ + { + "name": "Andri Möll", + "email": "andri@dot.ee", + "url": "http://themoll.com" + } + ], + "license": "ISC", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/json-stringify-safe.git" + }, + "main": "stringify.js", + "scripts": { + "test": "node test.js" + }, + "devDependencies": { + "mocha": ">= 2.1.0 < 3", + "must": ">= 0.12 < 0.13", + "sinon": ">= 1.12.2 < 2" + }, + "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5", + "_id": "json-stringify-safe@5.0.1", + "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "_from": "json-stringify-safe@>=5.0.1 <5.1.0", + "_npmVersion": "2.10.0", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "dist": { + "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "moll", + "email": "andri@dot.ee" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/stringify.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/stringify.js new file mode 100644 index 00000000..124a4521 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/stringify.js @@ -0,0 +1,27 @@ +exports = module.exports = stringify +exports.getSerialize = serializer + +function stringify(obj, replacer, spaces, cycleReplacer) { + return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces) +} + +function serializer(replacer, cycleReplacer) { + var stack = [], keys = [] + + if (cycleReplacer == null) cycleReplacer = function(key, value) { + if (stack[0] === value) return "[Circular ~]" + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]" + } + + return function(key, value) { + if (stack.length > 0) { + var thisPos = stack.indexOf(this) + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this) + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key) + if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value) + } + else stack.push(value) + + return replacer == null ? value : replacer.call(this, key, value) + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts new file mode 100644 index 00000000..2544e586 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/test/mocha.opts @@ -0,0 +1,2 @@ +--recursive +--require must diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js new file mode 100644 index 00000000..5b325831 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/json-stringify-safe/test/stringify_test.js @@ -0,0 +1,246 @@ +var Sinon = require("sinon") +var stringify = require("..") +function jsonify(obj) { return JSON.stringify(obj, null, 2) } + +describe("Stringify", function() { + it("must stringify circular objects", function() { + var obj = {name: "Alice"} + obj.self = obj + var json = stringify(obj, null, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + }) + + it("must stringify circular objects with intermediaries", function() { + var obj = {name: "Alice"} + obj.identity = {self: obj} + var json = stringify(obj, null, 2) + json.must.eql(jsonify({name: "Alice", identity: {self: "[Circular ~]"}})) + }) + + it("must stringify circular objects deeper", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + obj.child.self = obj.child + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + child: {name: "Bob", self: "[Circular ~.child]"} + })) + }) + + it("must stringify circular objects deeper with intermediaries", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + obj.child.identity = {self: obj.child} + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + child: {name: "Bob", identity: {self: "[Circular ~.child]"}} + })) + }) + + it("must stringify circular objects in an array", function() { + var obj = {name: "Alice"} + obj.self = [obj, obj] + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", self: ["[Circular ~]", "[Circular ~]"] + })) + }) + + it("must stringify circular objects deeper in an array", function() { + var obj = {name: "Alice", children: [{name: "Bob"}, {name: "Eve"}]} + obj.children[0].self = obj.children[0] + obj.children[1].self = obj.children[1] + + stringify(obj, null, 2).must.eql(jsonify({ + name: "Alice", + children: [ + {name: "Bob", self: "[Circular ~.children.0]"}, + {name: "Eve", self: "[Circular ~.children.1]"} + ] + })) + }) + + it("must stringify circular arrays", function() { + var obj = [] + obj.push(obj) + obj.push(obj) + var json = stringify(obj, null, 2) + json.must.eql(jsonify(["[Circular ~]", "[Circular ~]"])) + }) + + it("must stringify circular arrays with intermediaries", function() { + var obj = [] + obj.push({name: "Alice", self: obj}) + obj.push({name: "Bob", self: obj}) + + stringify(obj, null, 2).must.eql(jsonify([ + {name: "Alice", self: "[Circular ~]"}, + {name: "Bob", self: "[Circular ~]"} + ])) + }) + + it("must stringify repeated objects in objects", function() { + var obj = {} + var alice = {name: "Alice"} + obj.alice1 = alice + obj.alice2 = alice + + stringify(obj, null, 2).must.eql(jsonify({ + alice1: {name: "Alice"}, + alice2: {name: "Alice"} + })) + }) + + it("must stringify repeated objects in arrays", function() { + var alice = {name: "Alice"} + var obj = [alice, alice] + var json = stringify(obj, null, 2) + json.must.eql(jsonify([{name: "Alice"}, {name: "Alice"}])) + }) + + it("must call given decycler and use its output", function() { + var obj = {} + obj.a = obj + obj.b = obj + + var decycle = Sinon.spy(function() { return decycle.callCount }) + var json = stringify(obj, null, 2, decycle) + json.must.eql(jsonify({a: 1, b: 2}, null, 2)) + + decycle.callCount.must.equal(2) + decycle.thisValues[0].must.equal(obj) + decycle.args[0][0].must.equal("a") + decycle.args[0][1].must.equal(obj) + decycle.thisValues[1].must.equal(obj) + decycle.args[1][0].must.equal("b") + decycle.args[1][1].must.equal(obj) + }) + + it("must call replacer and use its output", function() { + var obj = {name: "Alice", child: {name: "Bob"}} + + var replacer = Sinon.spy(bangString) + var json = stringify(obj, replacer, 2) + json.must.eql(jsonify({name: "Alice!", child: {name: "Bob!"}})) + + replacer.callCount.must.equal(4) + replacer.args[0][0].must.equal("") + replacer.args[0][1].must.equal(obj) + replacer.thisValues[1].must.equal(obj) + replacer.args[1][0].must.equal("name") + replacer.args[1][1].must.equal("Alice") + replacer.thisValues[2].must.equal(obj) + replacer.args[2][0].must.equal("child") + replacer.args[2][1].must.equal(obj.child) + replacer.thisValues[3].must.equal(obj.child) + replacer.args[3][0].must.equal("name") + replacer.args[3][1].must.equal("Bob") + }) + + it("must call replacer after describing circular references", function() { + var obj = {name: "Alice"} + obj.self = obj + + var replacer = Sinon.spy(bangString) + var json = stringify(obj, replacer, 2) + json.must.eql(jsonify({name: "Alice!", self: "[Circular ~]!"})) + + replacer.callCount.must.equal(3) + replacer.args[0][0].must.equal("") + replacer.args[0][1].must.equal(obj) + replacer.thisValues[1].must.equal(obj) + replacer.args[1][0].must.equal("name") + replacer.args[1][1].must.equal("Alice") + replacer.thisValues[2].must.equal(obj) + replacer.args[2][0].must.equal("self") + replacer.args[2][1].must.equal("[Circular ~]") + }) + + it("must call given decycler and use its output for nested objects", + function() { + var obj = {} + obj.a = obj + obj.b = {self: obj} + + var decycle = Sinon.spy(function() { return decycle.callCount }) + var json = stringify(obj, null, 2, decycle) + json.must.eql(jsonify({a: 1, b: {self: 2}})) + + decycle.callCount.must.equal(2) + decycle.args[0][0].must.equal("a") + decycle.args[0][1].must.equal(obj) + decycle.args[1][0].must.equal("self") + decycle.args[1][1].must.equal(obj) + }) + + it("must use decycler's output when it returned null", function() { + var obj = {a: "b"} + obj.self = obj + obj.selves = [obj, obj] + + function decycle() { return null } + stringify(obj, null, 2, decycle).must.eql(jsonify({ + a: "b", + self: null, + selves: [null, null] + })) + }) + + it("must use decycler's output when it returned undefined", function() { + var obj = {a: "b"} + obj.self = obj + obj.selves = [obj, obj] + + function decycle() {} + stringify(obj, null, 2, decycle).must.eql(jsonify({ + a: "b", + selves: [null, null] + })) + }) + + it("must throw given a decycler that returns a cycle", function() { + var obj = {} + obj.self = obj + var err + function identity(key, value) { return value } + try { stringify(obj, null, 2, identity) } catch (ex) { err = ex } + err.must.be.an.instanceof(TypeError) + }) + + describe(".getSerialize", function() { + it("must stringify circular objects", function() { + var obj = {a: "b"} + obj.circularRef = obj + obj.list = [obj, obj] + + var json = JSON.stringify(obj, stringify.getSerialize(), 2) + json.must.eql(jsonify({ + "a": "b", + "circularRef": "[Circular ~]", + "list": ["[Circular ~]", "[Circular ~]"] + })) + }) + + // This is the behavior as of Mar 3, 2015. + // The serializer function keeps state inside the returned function and + // so far I'm not sure how to not do that. JSON.stringify's replacer is not + // called _after_ serialization. + xit("must return a function that could be called twice", function() { + var obj = {name: "Alice"} + obj.self = obj + + var json + var serializer = stringify.getSerialize() + + json = JSON.stringify(obj, serializer, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + + json = JSON.stringify(obj, serializer, 2) + json.must.eql(jsonify({name: "Alice", self: "[Circular ~]"})) + }) + }) +}) + +function bangString(key, value) { + return typeof value == "string" ? value + "!" : value +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/HISTORY.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/HISTORY.md new file mode 100644 index 00000000..64241d97 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/HISTORY.md @@ -0,0 +1,177 @@ +2.1.8 / 2015-11-30 +================== + + * deps: mime-db@~1.20.0 + - Add new mime types + +2.1.7 / 2015-09-20 +================== + + * deps: mime-db@~1.19.0 + - Add new mime types + +2.1.6 / 2015-09-03 +================== + + * deps: mime-db@~1.18.0 + - Add new mime types + +2.1.5 / 2015-08-20 +================== + + * deps: mime-db@~1.17.0 + - Add new mime types + +2.1.4 / 2015-07-30 +================== + + * deps: mime-db@~1.16.0 + - Add new mime types + +2.1.3 / 2015-07-13 +================== + + * deps: mime-db@~1.15.0 + - Add new mime types + +2.1.2 / 2015-06-25 +================== + + * deps: mime-db@~1.14.0 + - Add new mime types + +2.1.1 / 2015-06-08 +================== + + * perf: fix deopt during mapping + +2.1.0 / 2015-06-07 +================== + + * Fix incorrectly treating extension-less file name as extension + - i.e. `'path/to/json'` will no longer return `application/json` + * Fix `.charset(type)` to accept parameters + * Fix `.charset(type)` to match case-insensitive + * Improve generation of extension to MIME mapping + * Refactor internals for readability and no argument reassignment + * Prefer `application/*` MIME types from the same source + * Prefer any type over `application/octet-stream` + * deps: mime-db@~1.13.0 + - Add nginx as a source + - Add new mime types + +2.0.14 / 2015-06-06 +=================== + + * deps: mime-db@~1.12.0 + - Add new mime types + +2.0.13 / 2015-05-31 +=================== + + * deps: mime-db@~1.11.0 + - Add new mime types + +2.0.12 / 2015-05-19 +=================== + + * deps: mime-db@~1.10.0 + - Add new mime types + +2.0.11 / 2015-05-05 +=================== + + * deps: mime-db@~1.9.1 + - Add new mime types + +2.0.10 / 2015-03-13 +=================== + + * deps: mime-db@~1.8.0 + - Add new mime types + +2.0.9 / 2015-02-09 +================== + + * deps: mime-db@~1.7.0 + - Add new mime types + - Community extensions ownership transferred from `node-mime` + +2.0.8 / 2015-01-29 +================== + + * deps: mime-db@~1.6.0 + - Add new mime types + +2.0.7 / 2014-12-30 +================== + + * deps: mime-db@~1.5.0 + - Add new mime types + - Fix various invalid MIME type entries + +2.0.6 / 2014-12-30 +================== + + * deps: mime-db@~1.4.0 + - Add new mime types + - Fix various invalid MIME type entries + - Remove example template MIME types + +2.0.5 / 2014-12-29 +================== + + * deps: mime-db@~1.3.1 + - Fix missing extensions + +2.0.4 / 2014-12-10 +================== + + * deps: mime-db@~1.3.0 + - Add new mime types + +2.0.3 / 2014-11-09 +================== + + * deps: mime-db@~1.2.0 + - Add new mime types + +2.0.2 / 2014-09-28 +================== + + * deps: mime-db@~1.1.0 + - Add new mime types + - Add additional compressible + - Update charsets + +2.0.1 / 2014-09-07 +================== + + * Support Node.js 0.6 + +2.0.0 / 2014-09-02 +================== + + * Use `mime-db` + * Remove `.define()` + +1.0.2 / 2014-08-04 +================== + + * Set charset=utf-8 for `text/javascript` + +1.0.1 / 2014-06-24 +================== + + * Add `text/jsx` type + +1.0.0 / 2014-05-12 +================== + + * Return `false` for unknown types + * Set charset=utf-8 for `application/json` + +0.1.0 / 2014-05-02 +================== + + * Initial release diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/LICENSE new file mode 100644 index 00000000..06166077 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/LICENSE @@ -0,0 +1,23 @@ +(The MIT License) + +Copyright (c) 2014 Jonathan Ong +Copyright (c) 2015 Douglas Christopher Wilson + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/README.md new file mode 100644 index 00000000..e26295d0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/README.md @@ -0,0 +1,103 @@ +# mime-types + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +The ultimate javascript content-type utility. + +Similar to [node-mime](https://github.com/broofa/node-mime), except: + +- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`, + so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`. +- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`. +- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db) +- No `.define()` functionality + +Otherwise, the API is compatible. + +## Install + +```sh +$ npm install mime-types +``` + +## Adding Types + +All mime types are based on [mime-db](https://github.com/jshttp/mime-db), +so open a PR there if you'd like to add mime types. + +## API + +```js +var mime = require('mime-types') +``` + +All functions return `false` if input is invalid or not found. + +### mime.lookup(path) + +Lookup the content-type associated with a file. + +```js +mime.lookup('json') // 'application/json' +mime.lookup('.md') // 'text/x-markdown' +mime.lookup('file.html') // 'text/html' +mime.lookup('folder/file.js') // 'application/javascript' +mime.lookup('folder/.htaccess') // false + +mime.lookup('cats') // false +``` + +### mime.contentType(type) + +Create a full content-type header given a content-type or extension. + +```js +mime.contentType('markdown') // 'text/x-markdown; charset=utf-8' +mime.contentType('file.json') // 'application/json; charset=utf-8' + +// from a full path +mime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8' +``` + +### mime.extension(type) + +Get the default extension for a content-type. + +```js +mime.extension('application/octet-stream') // 'bin' +``` + +### mime.charset(type) + +Lookup the implied default charset of a content-type. + +```js +mime.charset('text/x-markdown') // 'UTF-8' +``` + +### var type = mime.types[extension] + +A map of content-types by extension. + +### [extensions...] = mime.extensions[type] + +A map of extensions by content-type. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/mime-types.svg +[npm-url]: https://npmjs.org/package/mime-types +[node-version-image]: https://img.shields.io/node/v/mime-types.svg +[node-version-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg +[travis-url]: https://travis-ci.org/jshttp/mime-types +[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/mime-types +[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg +[downloads-url]: https://npmjs.org/package/mime-types diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/index.js new file mode 100644 index 00000000..f7008b24 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/index.js @@ -0,0 +1,188 @@ +/*! + * mime-types + * Copyright(c) 2014 Jonathan Ong + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module dependencies. + * @private + */ + +var db = require('mime-db') +var extname = require('path').extname + +/** + * Module variables. + * @private + */ + +var extractTypeRegExp = /^\s*([^;\s]*)(?:;|\s|$)/ +var textTypeRegExp = /^text\//i + +/** + * Module exports. + * @public + */ + +exports.charset = charset +exports.charsets = { lookup: charset } +exports.contentType = contentType +exports.extension = extension +exports.extensions = Object.create(null) +exports.lookup = lookup +exports.types = Object.create(null) + +// Populate the extensions/types maps +populateMaps(exports.extensions, exports.types) + +/** + * Get the default charset for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function charset(type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = extractTypeRegExp.exec(type) + var mime = match && db[match[1].toLowerCase()] + + if (mime && mime.charset) { + return mime.charset + } + + // default text/* to utf-8 + if (match && textTypeRegExp.test(match[1])) { + return 'UTF-8' + } + + return false +} + +/** + * Create a full Content-Type header given a MIME type or extension. + * + * @param {string} str + * @return {boolean|string} + */ + +function contentType(str) { + // TODO: should this even be in this module? + if (!str || typeof str !== 'string') { + return false + } + + var mime = str.indexOf('/') === -1 + ? exports.lookup(str) + : str + + if (!mime) { + return false + } + + // TODO: use content-type or other module + if (mime.indexOf('charset') === -1) { + var charset = exports.charset(mime) + if (charset) mime += '; charset=' + charset.toLowerCase() + } + + return mime +} + +/** + * Get the default extension for a MIME type. + * + * @param {string} type + * @return {boolean|string} + */ + +function extension(type) { + if (!type || typeof type !== 'string') { + return false + } + + // TODO: use media-typer + var match = extractTypeRegExp.exec(type) + + // get extensions + var exts = match && exports.extensions[match[1].toLowerCase()] + + if (!exts || !exts.length) { + return false + } + + return exts[0] +} + +/** + * Lookup the MIME type for a file path/extension. + * + * @param {string} path + * @return {boolean|string} + */ + +function lookup(path) { + if (!path || typeof path !== 'string') { + return false + } + + // get the extension ("ext" or ".ext" or full path) + var extension = extname('x.' + path) + .toLowerCase() + .substr(1) + + if (!extension) { + return false + } + + return exports.types[extension] || false +} + +/** + * Populate the extensions and types maps. + * @private + */ + +function populateMaps(extensions, types) { + // source preference (least -> most) + var preference = ['nginx', 'apache', undefined, 'iana'] + + Object.keys(db).forEach(function forEachMimeType(type) { + var mime = db[type] + var exts = mime.extensions + + if (!exts || !exts.length) { + return + } + + // mime -> extensions + extensions[type] = exts + + // extension -> mime + for (var i = 0; i < exts.length; i++) { + var extension = exts[i] + + if (types[extension]) { + var from = preference.indexOf(db[types[extension]].source) + var to = preference.indexOf(mime.source) + + if (types[extension] !== 'application/octet-stream' + && from > to || (from === to && types[extension].substr(0, 12) === 'application/')) { + // skip the remapping + continue + } + } + + // set the extension -> mime + types[extension] = type + } + }) +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md new file mode 100644 index 00000000..c7f8b5a3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md @@ -0,0 +1,287 @@ +1.20.0 / 2015-11-10 +=================== + + * Add `application/cdni` + * Add `application/csvm+json` + * Add `application/rfc+xml` + * Add `application/vnd.3gpp.access-transfer-events+xml` + * Add `application/vnd.3gpp.srvcc-ext+xml` + * Add `application/vnd.ms-windows.wsd.oob` + * Add `application/vnd.oxli.countgraph` + * Add `application/vnd.pagerduty+json` + * Add `text/x-suse-ymp` + +1.19.0 / 2015-09-17 +=================== + + * Add `application/vnd.3gpp-prose-pc3ch+xml` + * Add `application/vnd.3gpp.srvcc-info+xml` + * Add `application/vnd.apple.pkpass` + * Add `application/vnd.drive+json` + +1.18.0 / 2015-09-03 +=================== + + * Add `application/pkcs12` + * Add `application/vnd.3gpp-prose+xml` + * Add `application/vnd.3gpp.mid-call+xml` + * Add `application/vnd.3gpp.state-and-event-info+xml` + * Add `application/vnd.anki` + * Add `application/vnd.firemonkeys.cloudcell` + * Add `application/vnd.openblox.game+xml` + * Add `application/vnd.openblox.game-binary` + +1.17.0 / 2015-08-13 +=================== + + * Add `application/x-msdos-program` + * Add `audio/g711-0` + * Add `image/vnd.mozilla.apng` + * Add extension `.exe` to `application/x-msdos-program` + +1.16.0 / 2015-07-29 +=================== + + * Add `application/vnd.uri-map` + +1.15.0 / 2015-07-13 +=================== + + * Add `application/x-httpd-php` + +1.14.0 / 2015-06-25 +=================== + + * Add `application/scim+json` + * Add `application/vnd.3gpp.ussd+xml` + * Add `application/vnd.biopax.rdf+xml` + * Add `text/x-processing` + +1.13.0 / 2015-06-07 +=================== + + * Add nginx as a source + * Add `application/x-cocoa` + * Add `application/x-java-archive-diff` + * Add `application/x-makeself` + * Add `application/x-perl` + * Add `application/x-pilot` + * Add `application/x-redhat-package-manager` + * Add `application/x-sea` + * Add `audio/x-m4a` + * Add `audio/x-realaudio` + * Add `image/x-jng` + * Add `text/mathml` + +1.12.0 / 2015-06-05 +=================== + + * Add `application/bdoc` + * Add `application/vnd.hyperdrive+json` + * Add `application/x-bdoc` + * Add extension `.rtf` to `text/rtf` + +1.11.0 / 2015-05-31 +=================== + + * Add `audio/wav` + * Add `audio/wave` + * Add extension `.litcoffee` to `text/coffeescript` + * Add extension `.sfd-hdstx` to `application/vnd.hydrostatix.sof-data` + * Add extension `.n-gage` to `application/vnd.nokia.n-gage.symbian.install` + +1.10.0 / 2015-05-19 +=================== + + * Add `application/vnd.balsamiq.bmpr` + * Add `application/vnd.microsoft.portable-executable` + * Add `application/x-ns-proxy-autoconfig` + +1.9.1 / 2015-04-19 +================== + + * Remove `.json` extension from `application/manifest+json` + - This is causing bugs downstream + +1.9.0 / 2015-04-19 +================== + + * Add `application/manifest+json` + * Add `application/vnd.micro+json` + * Add `image/vnd.zbrush.pcx` + * Add `image/x-ms-bmp` + +1.8.0 / 2015-03-13 +================== + + * Add `application/vnd.citationstyles.style+xml` + * Add `application/vnd.fastcopy-disk-image` + * Add `application/vnd.gov.sk.xmldatacontainer+xml` + * Add extension `.jsonld` to `application/ld+json` + +1.7.0 / 2015-02-08 +================== + + * Add `application/vnd.gerber` + * Add `application/vnd.msa-disk-image` + +1.6.1 / 2015-02-05 +================== + + * Community extensions ownership transferred from `node-mime` + +1.6.0 / 2015-01-29 +================== + + * Add `application/jose` + * Add `application/jose+json` + * Add `application/json-seq` + * Add `application/jwk+json` + * Add `application/jwk-set+json` + * Add `application/jwt` + * Add `application/rdap+json` + * Add `application/vnd.gov.sk.e-form+xml` + * Add `application/vnd.ims.imsccv1p3` + +1.5.0 / 2014-12-30 +================== + + * Add `application/vnd.oracle.resource+json` + * Fix various invalid MIME type entries + - `application/mbox+xml` + - `application/oscp-response` + - `application/vwg-multiplexed` + - `audio/g721` + +1.4.0 / 2014-12-21 +================== + + * Add `application/vnd.ims.imsccv1p2` + * Fix various invalid MIME type entries + - `application/vnd-acucobol` + - `application/vnd-curl` + - `application/vnd-dart` + - `application/vnd-dxr` + - `application/vnd-fdf` + - `application/vnd-mif` + - `application/vnd-sema` + - `application/vnd-wap-wmlc` + - `application/vnd.adobe.flash-movie` + - `application/vnd.dece-zip` + - `application/vnd.dvb_service` + - `application/vnd.micrografx-igx` + - `application/vnd.sealed-doc` + - `application/vnd.sealed-eml` + - `application/vnd.sealed-mht` + - `application/vnd.sealed-ppt` + - `application/vnd.sealed-tiff` + - `application/vnd.sealed-xls` + - `application/vnd.sealedmedia.softseal-html` + - `application/vnd.sealedmedia.softseal-pdf` + - `application/vnd.wap-slc` + - `application/vnd.wap-wbxml` + - `audio/vnd.sealedmedia.softseal-mpeg` + - `image/vnd-djvu` + - `image/vnd-svf` + - `image/vnd-wap-wbmp` + - `image/vnd.sealed-png` + - `image/vnd.sealedmedia.softseal-gif` + - `image/vnd.sealedmedia.softseal-jpg` + - `model/vnd-dwf` + - `model/vnd.parasolid.transmit-binary` + - `model/vnd.parasolid.transmit-text` + - `text/vnd-a` + - `text/vnd-curl` + - `text/vnd.wap-wml` + * Remove example template MIME types + - `application/example` + - `audio/example` + - `image/example` + - `message/example` + - `model/example` + - `multipart/example` + - `text/example` + - `video/example` + +1.3.1 / 2014-12-16 +================== + + * Fix missing extensions + - `application/json5` + - `text/hjson` + +1.3.0 / 2014-12-07 +================== + + * Add `application/a2l` + * Add `application/aml` + * Add `application/atfx` + * Add `application/atxml` + * Add `application/cdfx+xml` + * Add `application/dii` + * Add `application/json5` + * Add `application/lxf` + * Add `application/mf4` + * Add `application/vnd.apache.thrift.compact` + * Add `application/vnd.apache.thrift.json` + * Add `application/vnd.coffeescript` + * Add `application/vnd.enphase.envoy` + * Add `application/vnd.ims.imsccv1p1` + * Add `text/csv-schema` + * Add `text/hjson` + * Add `text/markdown` + * Add `text/yaml` + +1.2.0 / 2014-11-09 +================== + + * Add `application/cea` + * Add `application/dit` + * Add `application/vnd.gov.sk.e-form+zip` + * Add `application/vnd.tmd.mediaflex.api+xml` + * Type `application/epub+zip` is now IANA-registered + +1.1.2 / 2014-10-23 +================== + + * Rebuild database for `application/x-www-form-urlencoded` change + +1.1.1 / 2014-10-20 +================== + + * Mark `application/x-www-form-urlencoded` as compressible. + +1.1.0 / 2014-09-28 +================== + + * Add `application/font-woff2` + +1.0.3 / 2014-09-25 +================== + + * Fix engine requirement in package + +1.0.2 / 2014-09-25 +================== + + * Add `application/coap-group+json` + * Add `application/dcd` + * Add `application/vnd.apache.thrift.binary` + * Add `image/vnd.tencent.tap` + * Mark all JSON-derived types as compressible + * Update `text/vtt` data + +1.0.1 / 2014-08-30 +================== + + * Fix extension ordering + +1.0.0 / 2014-08-30 +================== + + * Add `application/atf` + * Add `application/merge-patch+json` + * Add `multipart/x-mixed-replace` + * Add `source: 'apache'` metadata + * Add `source: 'iana'` metadata + * Remove badly-assumed charset data diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE new file mode 100644 index 00000000..a7ae8ee9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/LICENSE @@ -0,0 +1,22 @@ + +The MIT License (MIT) + +Copyright (c) 2014 Jonathan Ong me@jongleberry.com + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md new file mode 100644 index 00000000..164cca03 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md @@ -0,0 +1,82 @@ +# mime-db + +[![NPM Version][npm-version-image]][npm-url] +[![NPM Downloads][npm-downloads-image]][npm-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Coverage Status][coveralls-image]][coveralls-url] + +This is a database of all mime types. +It consists of a single, public JSON file and does not include any logic, +allowing it to remain as un-opinionated as possible with an API. +It aggregates data from the following sources: + +- http://www.iana.org/assignments/media-types/media-types.xhtml +- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types +- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types + +## Installation + +```bash +npm install mime-db +``` + +### Database Download + +If you're crazy enough to use this in the browser, you can just grab the +JSON file using [RawGit](https://rawgit.com/). It is recommended to replace +`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the +JSON format may change in the future. + +``` +https://cdn.rawgit.com/jshttp/mime-db/master/db.json +``` + +## Usage + +```js +var db = require('mime-db'); + +// grab data on .js files +var data = db['application/javascript']; +``` + +## Data Structure + +The JSON file is a map lookup for lowercased mime types. +Each mime type has the following properties: + +- `.source` - where the mime type is defined. + If not set, it's probably a custom media type. + - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types) + - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml) + - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types) +- `.extensions[]` - known extensions associated with this mime type. +- `.compressible` - whether a file of this type is can be gzipped. +- `.charset` - the default charset associated with this type, if any. + +If unknown, every property could be `undefined`. + +## Contributing + +To edit the database, only make PRs against `src/custom.json` or +`src/custom-suffix.json`. + +To update the build, run `npm run build`. + +## Adding Custom Media Types + +The best way to get new media types included in this library is to register +them with the IANA. The community registration procedure is outlined in +[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types +registered with the IANA are automatically pulled into this library. + +[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg +[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg +[npm-url]: https://npmjs.org/package/mime-db +[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg +[travis-url]: https://travis-ci.org/jshttp/mime-db +[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master +[node-image]: https://img.shields.io/node/v/mime-db.svg +[node-url]: http://nodejs.org/download/ diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json new file mode 100644 index 00000000..123e7f95 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json @@ -0,0 +1,6504 @@ +{ + "application/1d-interleaved-parityfec": { + "source": "iana" + }, + "application/3gpdash-qoe-report+xml": { + "source": "iana" + }, + "application/3gpp-ims+xml": { + "source": "iana" + }, + "application/a2l": { + "source": "iana" + }, + "application/activemessage": { + "source": "iana" + }, + "application/alto-costmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-costmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/alto-directory+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcost+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointcostparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointprop+json": { + "source": "iana", + "compressible": true + }, + "application/alto-endpointpropparams+json": { + "source": "iana", + "compressible": true + }, + "application/alto-error+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmap+json": { + "source": "iana", + "compressible": true + }, + "application/alto-networkmapfilter+json": { + "source": "iana", + "compressible": true + }, + "application/aml": { + "source": "iana" + }, + "application/andrew-inset": { + "source": "iana", + "extensions": ["ez"] + }, + "application/applefile": { + "source": "iana" + }, + "application/applixware": { + "source": "apache", + "extensions": ["aw"] + }, + "application/atf": { + "source": "iana" + }, + "application/atfx": { + "source": "iana" + }, + "application/atom+xml": { + "source": "iana", + "compressible": true, + "extensions": ["atom"] + }, + "application/atomcat+xml": { + "source": "iana", + "extensions": ["atomcat"] + }, + "application/atomdeleted+xml": { + "source": "iana" + }, + "application/atomicmail": { + "source": "iana" + }, + "application/atomsvc+xml": { + "source": "iana", + "extensions": ["atomsvc"] + }, + "application/atxml": { + "source": "iana" + }, + "application/auth-policy+xml": { + "source": "iana" + }, + "application/bacnet-xdd+zip": { + "source": "iana" + }, + "application/batch-smtp": { + "source": "iana" + }, + "application/bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/beep+xml": { + "source": "iana" + }, + "application/calendar+json": { + "source": "iana", + "compressible": true + }, + "application/calendar+xml": { + "source": "iana" + }, + "application/call-completion": { + "source": "iana" + }, + "application/cals-1840": { + "source": "iana" + }, + "application/cbor": { + "source": "iana" + }, + "application/ccmp+xml": { + "source": "iana" + }, + "application/ccxml+xml": { + "source": "iana", + "extensions": ["ccxml"] + }, + "application/cdfx+xml": { + "source": "iana" + }, + "application/cdmi-capability": { + "source": "iana", + "extensions": ["cdmia"] + }, + "application/cdmi-container": { + "source": "iana", + "extensions": ["cdmic"] + }, + "application/cdmi-domain": { + "source": "iana", + "extensions": ["cdmid"] + }, + "application/cdmi-object": { + "source": "iana", + "extensions": ["cdmio"] + }, + "application/cdmi-queue": { + "source": "iana", + "extensions": ["cdmiq"] + }, + "application/cdni": { + "source": "iana" + }, + "application/cea": { + "source": "iana" + }, + "application/cea-2018+xml": { + "source": "iana" + }, + "application/cellml+xml": { + "source": "iana" + }, + "application/cfw": { + "source": "iana" + }, + "application/cms": { + "source": "iana" + }, + "application/cnrp+xml": { + "source": "iana" + }, + "application/coap-group+json": { + "source": "iana", + "compressible": true + }, + "application/commonground": { + "source": "iana" + }, + "application/conference-info+xml": { + "source": "iana" + }, + "application/cpl+xml": { + "source": "iana" + }, + "application/csrattrs": { + "source": "iana" + }, + "application/csta+xml": { + "source": "iana" + }, + "application/cstadata+xml": { + "source": "iana" + }, + "application/csvm+json": { + "source": "iana", + "compressible": true + }, + "application/cu-seeme": { + "source": "apache", + "extensions": ["cu"] + }, + "application/cybercash": { + "source": "iana" + }, + "application/dart": { + "compressible": true + }, + "application/dash+xml": { + "source": "iana", + "extensions": ["mdp"] + }, + "application/dashdelta": { + "source": "iana" + }, + "application/davmount+xml": { + "source": "iana", + "extensions": ["davmount"] + }, + "application/dca-rft": { + "source": "iana" + }, + "application/dcd": { + "source": "iana" + }, + "application/dec-dx": { + "source": "iana" + }, + "application/dialog-info+xml": { + "source": "iana" + }, + "application/dicom": { + "source": "iana" + }, + "application/dii": { + "source": "iana" + }, + "application/dit": { + "source": "iana" + }, + "application/dns": { + "source": "iana" + }, + "application/docbook+xml": { + "source": "apache", + "extensions": ["dbk"] + }, + "application/dskpp+xml": { + "source": "iana" + }, + "application/dssc+der": { + "source": "iana", + "extensions": ["dssc"] + }, + "application/dssc+xml": { + "source": "iana", + "extensions": ["xdssc"] + }, + "application/dvcs": { + "source": "iana" + }, + "application/ecmascript": { + "source": "iana", + "compressible": true, + "extensions": ["ecma"] + }, + "application/edi-consent": { + "source": "iana" + }, + "application/edi-x12": { + "source": "iana", + "compressible": false + }, + "application/edifact": { + "source": "iana", + "compressible": false + }, + "application/emma+xml": { + "source": "iana", + "extensions": ["emma"] + }, + "application/emotionml+xml": { + "source": "iana" + }, + "application/encaprtp": { + "source": "iana" + }, + "application/epp+xml": { + "source": "iana" + }, + "application/epub+zip": { + "source": "iana", + "extensions": ["epub"] + }, + "application/eshop": { + "source": "iana" + }, + "application/exi": { + "source": "iana", + "extensions": ["exi"] + }, + "application/fastinfoset": { + "source": "iana" + }, + "application/fastsoap": { + "source": "iana" + }, + "application/fdt+xml": { + "source": "iana" + }, + "application/fits": { + "source": "iana" + }, + "application/font-sfnt": { + "source": "iana" + }, + "application/font-tdpfr": { + "source": "iana", + "extensions": ["pfr"] + }, + "application/font-woff": { + "source": "iana", + "compressible": false, + "extensions": ["woff"] + }, + "application/font-woff2": { + "compressible": false, + "extensions": ["woff2"] + }, + "application/framework-attributes+xml": { + "source": "iana" + }, + "application/gml+xml": { + "source": "apache", + "extensions": ["gml"] + }, + "application/gpx+xml": { + "source": "apache", + "extensions": ["gpx"] + }, + "application/gxf": { + "source": "apache", + "extensions": ["gxf"] + }, + "application/gzip": { + "source": "iana", + "compressible": false + }, + "application/h224": { + "source": "iana" + }, + "application/held+xml": { + "source": "iana" + }, + "application/http": { + "source": "iana" + }, + "application/hyperstudio": { + "source": "iana", + "extensions": ["stk"] + }, + "application/ibe-key-request+xml": { + "source": "iana" + }, + "application/ibe-pkg-reply+xml": { + "source": "iana" + }, + "application/ibe-pp-data": { + "source": "iana" + }, + "application/iges": { + "source": "iana" + }, + "application/im-iscomposing+xml": { + "source": "iana" + }, + "application/index": { + "source": "iana" + }, + "application/index.cmd": { + "source": "iana" + }, + "application/index.obj": { + "source": "iana" + }, + "application/index.response": { + "source": "iana" + }, + "application/index.vnd": { + "source": "iana" + }, + "application/inkml+xml": { + "source": "iana", + "extensions": ["ink","inkml"] + }, + "application/iotp": { + "source": "iana" + }, + "application/ipfix": { + "source": "iana", + "extensions": ["ipfix"] + }, + "application/ipp": { + "source": "iana" + }, + "application/isup": { + "source": "iana" + }, + "application/its+xml": { + "source": "iana" + }, + "application/java-archive": { + "source": "apache", + "compressible": false, + "extensions": ["jar","war","ear"] + }, + "application/java-serialized-object": { + "source": "apache", + "compressible": false, + "extensions": ["ser"] + }, + "application/java-vm": { + "source": "apache", + "compressible": false, + "extensions": ["class"] + }, + "application/javascript": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["js"] + }, + "application/jose": { + "source": "iana" + }, + "application/jose+json": { + "source": "iana", + "compressible": true + }, + "application/jrd+json": { + "source": "iana", + "compressible": true + }, + "application/json": { + "source": "iana", + "charset": "UTF-8", + "compressible": true, + "extensions": ["json","map"] + }, + "application/json-patch+json": { + "source": "iana", + "compressible": true + }, + "application/json-seq": { + "source": "iana" + }, + "application/json5": { + "extensions": ["json5"] + }, + "application/jsonml+json": { + "source": "apache", + "compressible": true, + "extensions": ["jsonml"] + }, + "application/jwk+json": { + "source": "iana", + "compressible": true + }, + "application/jwk-set+json": { + "source": "iana", + "compressible": true + }, + "application/jwt": { + "source": "iana" + }, + "application/kpml-request+xml": { + "source": "iana" + }, + "application/kpml-response+xml": { + "source": "iana" + }, + "application/ld+json": { + "source": "iana", + "compressible": true, + "extensions": ["jsonld"] + }, + "application/link-format": { + "source": "iana" + }, + "application/load-control+xml": { + "source": "iana" + }, + "application/lost+xml": { + "source": "iana", + "extensions": ["lostxml"] + }, + "application/lostsync+xml": { + "source": "iana" + }, + "application/lxf": { + "source": "iana" + }, + "application/mac-binhex40": { + "source": "iana", + "extensions": ["hqx"] + }, + "application/mac-compactpro": { + "source": "apache", + "extensions": ["cpt"] + }, + "application/macwriteii": { + "source": "iana" + }, + "application/mads+xml": { + "source": "iana", + "extensions": ["mads"] + }, + "application/manifest+json": { + "charset": "UTF-8", + "compressible": true, + "extensions": ["webmanifest"] + }, + "application/marc": { + "source": "iana", + "extensions": ["mrc"] + }, + "application/marcxml+xml": { + "source": "iana", + "extensions": ["mrcx"] + }, + "application/mathematica": { + "source": "iana", + "extensions": ["ma","nb","mb"] + }, + "application/mathml+xml": { + "source": "iana", + "extensions": ["mathml"] + }, + "application/mathml-content+xml": { + "source": "iana" + }, + "application/mathml-presentation+xml": { + "source": "iana" + }, + "application/mbms-associated-procedure-description+xml": { + "source": "iana" + }, + "application/mbms-deregister+xml": { + "source": "iana" + }, + "application/mbms-envelope+xml": { + "source": "iana" + }, + "application/mbms-msk+xml": { + "source": "iana" + }, + "application/mbms-msk-response+xml": { + "source": "iana" + }, + "application/mbms-protection-description+xml": { + "source": "iana" + }, + "application/mbms-reception-report+xml": { + "source": "iana" + }, + "application/mbms-register+xml": { + "source": "iana" + }, + "application/mbms-register-response+xml": { + "source": "iana" + }, + "application/mbms-schedule+xml": { + "source": "iana" + }, + "application/mbms-user-service-description+xml": { + "source": "iana" + }, + "application/mbox": { + "source": "iana", + "extensions": ["mbox"] + }, + "application/media-policy-dataset+xml": { + "source": "iana" + }, + "application/media_control+xml": { + "source": "iana" + }, + "application/mediaservercontrol+xml": { + "source": "iana", + "extensions": ["mscml"] + }, + "application/merge-patch+json": { + "source": "iana", + "compressible": true + }, + "application/metalink+xml": { + "source": "apache", + "extensions": ["metalink"] + }, + "application/metalink4+xml": { + "source": "iana", + "extensions": ["meta4"] + }, + "application/mets+xml": { + "source": "iana", + "extensions": ["mets"] + }, + "application/mf4": { + "source": "iana" + }, + "application/mikey": { + "source": "iana" + }, + "application/mods+xml": { + "source": "iana", + "extensions": ["mods"] + }, + "application/moss-keys": { + "source": "iana" + }, + "application/moss-signature": { + "source": "iana" + }, + "application/mosskey-data": { + "source": "iana" + }, + "application/mosskey-request": { + "source": "iana" + }, + "application/mp21": { + "source": "iana", + "extensions": ["m21","mp21"] + }, + "application/mp4": { + "source": "iana", + "extensions": ["mp4s","m4p"] + }, + "application/mpeg4-generic": { + "source": "iana" + }, + "application/mpeg4-iod": { + "source": "iana" + }, + "application/mpeg4-iod-xmt": { + "source": "iana" + }, + "application/mrb-consumer+xml": { + "source": "iana" + }, + "application/mrb-publish+xml": { + "source": "iana" + }, + "application/msc-ivr+xml": { + "source": "iana" + }, + "application/msc-mixer+xml": { + "source": "iana" + }, + "application/msword": { + "source": "iana", + "compressible": false, + "extensions": ["doc","dot"] + }, + "application/mxf": { + "source": "iana", + "extensions": ["mxf"] + }, + "application/nasdata": { + "source": "iana" + }, + "application/news-checkgroups": { + "source": "iana" + }, + "application/news-groupinfo": { + "source": "iana" + }, + "application/news-transmission": { + "source": "iana" + }, + "application/nlsml+xml": { + "source": "iana" + }, + "application/nss": { + "source": "iana" + }, + "application/ocsp-request": { + "source": "iana" + }, + "application/ocsp-response": { + "source": "iana" + }, + "application/octet-stream": { + "source": "iana", + "compressible": false, + "extensions": ["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"] + }, + "application/oda": { + "source": "iana", + "extensions": ["oda"] + }, + "application/odx": { + "source": "iana" + }, + "application/oebps-package+xml": { + "source": "iana", + "extensions": ["opf"] + }, + "application/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["ogx"] + }, + "application/omdoc+xml": { + "source": "apache", + "extensions": ["omdoc"] + }, + "application/onenote": { + "source": "apache", + "extensions": ["onetoc","onetoc2","onetmp","onepkg"] + }, + "application/oxps": { + "source": "iana", + "extensions": ["oxps"] + }, + "application/p2p-overlay+xml": { + "source": "iana" + }, + "application/parityfec": { + "source": "iana" + }, + "application/patch-ops-error+xml": { + "source": "iana", + "extensions": ["xer"] + }, + "application/pdf": { + "source": "iana", + "compressible": false, + "extensions": ["pdf"] + }, + "application/pdx": { + "source": "iana" + }, + "application/pgp-encrypted": { + "source": "iana", + "compressible": false, + "extensions": ["pgp"] + }, + "application/pgp-keys": { + "source": "iana" + }, + "application/pgp-signature": { + "source": "iana", + "extensions": ["asc","sig"] + }, + "application/pics-rules": { + "source": "apache", + "extensions": ["prf"] + }, + "application/pidf+xml": { + "source": "iana" + }, + "application/pidf-diff+xml": { + "source": "iana" + }, + "application/pkcs10": { + "source": "iana", + "extensions": ["p10"] + }, + "application/pkcs12": { + "source": "iana" + }, + "application/pkcs7-mime": { + "source": "iana", + "extensions": ["p7m","p7c"] + }, + "application/pkcs7-signature": { + "source": "iana", + "extensions": ["p7s"] + }, + "application/pkcs8": { + "source": "iana", + "extensions": ["p8"] + }, + "application/pkix-attr-cert": { + "source": "iana", + "extensions": ["ac"] + }, + "application/pkix-cert": { + "source": "iana", + "extensions": ["cer"] + }, + "application/pkix-crl": { + "source": "iana", + "extensions": ["crl"] + }, + "application/pkix-pkipath": { + "source": "iana", + "extensions": ["pkipath"] + }, + "application/pkixcmp": { + "source": "iana", + "extensions": ["pki"] + }, + "application/pls+xml": { + "source": "iana", + "extensions": ["pls"] + }, + "application/poc-settings+xml": { + "source": "iana" + }, + "application/postscript": { + "source": "iana", + "compressible": true, + "extensions": ["ai","eps","ps"] + }, + "application/provenance+xml": { + "source": "iana" + }, + "application/prs.alvestrand.titrax-sheet": { + "source": "iana" + }, + "application/prs.cww": { + "source": "iana", + "extensions": ["cww"] + }, + "application/prs.hpub+zip": { + "source": "iana" + }, + "application/prs.nprend": { + "source": "iana" + }, + "application/prs.plucker": { + "source": "iana" + }, + "application/prs.rdf-xml-crypt": { + "source": "iana" + }, + "application/prs.xsf+xml": { + "source": "iana" + }, + "application/pskc+xml": { + "source": "iana", + "extensions": ["pskcxml"] + }, + "application/qsig": { + "source": "iana" + }, + "application/raptorfec": { + "source": "iana" + }, + "application/rdap+json": { + "source": "iana", + "compressible": true + }, + "application/rdf+xml": { + "source": "iana", + "compressible": true, + "extensions": ["rdf"] + }, + "application/reginfo+xml": { + "source": "iana", + "extensions": ["rif"] + }, + "application/relax-ng-compact-syntax": { + "source": "iana", + "extensions": ["rnc"] + }, + "application/remote-printing": { + "source": "iana" + }, + "application/reputon+json": { + "source": "iana", + "compressible": true + }, + "application/resource-lists+xml": { + "source": "iana", + "extensions": ["rl"] + }, + "application/resource-lists-diff+xml": { + "source": "iana", + "extensions": ["rld"] + }, + "application/rfc+xml": { + "source": "iana" + }, + "application/riscos": { + "source": "iana" + }, + "application/rlmi+xml": { + "source": "iana" + }, + "application/rls-services+xml": { + "source": "iana", + "extensions": ["rs"] + }, + "application/rpki-ghostbusters": { + "source": "iana", + "extensions": ["gbr"] + }, + "application/rpki-manifest": { + "source": "iana", + "extensions": ["mft"] + }, + "application/rpki-roa": { + "source": "iana", + "extensions": ["roa"] + }, + "application/rpki-updown": { + "source": "iana" + }, + "application/rsd+xml": { + "source": "apache", + "extensions": ["rsd"] + }, + "application/rss+xml": { + "source": "apache", + "compressible": true, + "extensions": ["rss"] + }, + "application/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "application/rtploopback": { + "source": "iana" + }, + "application/rtx": { + "source": "iana" + }, + "application/samlassertion+xml": { + "source": "iana" + }, + "application/samlmetadata+xml": { + "source": "iana" + }, + "application/sbml+xml": { + "source": "iana", + "extensions": ["sbml"] + }, + "application/scaip+xml": { + "source": "iana" + }, + "application/scim+json": { + "source": "iana", + "compressible": true + }, + "application/scvp-cv-request": { + "source": "iana", + "extensions": ["scq"] + }, + "application/scvp-cv-response": { + "source": "iana", + "extensions": ["scs"] + }, + "application/scvp-vp-request": { + "source": "iana", + "extensions": ["spq"] + }, + "application/scvp-vp-response": { + "source": "iana", + "extensions": ["spp"] + }, + "application/sdp": { + "source": "iana", + "extensions": ["sdp"] + }, + "application/sep+xml": { + "source": "iana" + }, + "application/sep-exi": { + "source": "iana" + }, + "application/session-info": { + "source": "iana" + }, + "application/set-payment": { + "source": "iana" + }, + "application/set-payment-initiation": { + "source": "iana", + "extensions": ["setpay"] + }, + "application/set-registration": { + "source": "iana" + }, + "application/set-registration-initiation": { + "source": "iana", + "extensions": ["setreg"] + }, + "application/sgml": { + "source": "iana" + }, + "application/sgml-open-catalog": { + "source": "iana" + }, + "application/shf+xml": { + "source": "iana", + "extensions": ["shf"] + }, + "application/sieve": { + "source": "iana" + }, + "application/simple-filter+xml": { + "source": "iana" + }, + "application/simple-message-summary": { + "source": "iana" + }, + "application/simplesymbolcontainer": { + "source": "iana" + }, + "application/slate": { + "source": "iana" + }, + "application/smil": { + "source": "iana" + }, + "application/smil+xml": { + "source": "iana", + "extensions": ["smi","smil"] + }, + "application/smpte336m": { + "source": "iana" + }, + "application/soap+fastinfoset": { + "source": "iana" + }, + "application/soap+xml": { + "source": "iana", + "compressible": true + }, + "application/sparql-query": { + "source": "iana", + "extensions": ["rq"] + }, + "application/sparql-results+xml": { + "source": "iana", + "extensions": ["srx"] + }, + "application/spirits-event+xml": { + "source": "iana" + }, + "application/sql": { + "source": "iana" + }, + "application/srgs": { + "source": "iana", + "extensions": ["gram"] + }, + "application/srgs+xml": { + "source": "iana", + "extensions": ["grxml"] + }, + "application/sru+xml": { + "source": "iana", + "extensions": ["sru"] + }, + "application/ssdl+xml": { + "source": "apache", + "extensions": ["ssdl"] + }, + "application/ssml+xml": { + "source": "iana", + "extensions": ["ssml"] + }, + "application/tamp-apex-update": { + "source": "iana" + }, + "application/tamp-apex-update-confirm": { + "source": "iana" + }, + "application/tamp-community-update": { + "source": "iana" + }, + "application/tamp-community-update-confirm": { + "source": "iana" + }, + "application/tamp-error": { + "source": "iana" + }, + "application/tamp-sequence-adjust": { + "source": "iana" + }, + "application/tamp-sequence-adjust-confirm": { + "source": "iana" + }, + "application/tamp-status-query": { + "source": "iana" + }, + "application/tamp-status-response": { + "source": "iana" + }, + "application/tamp-update": { + "source": "iana" + }, + "application/tamp-update-confirm": { + "source": "iana" + }, + "application/tar": { + "compressible": true + }, + "application/tei+xml": { + "source": "iana", + "extensions": ["tei","teicorpus"] + }, + "application/thraud+xml": { + "source": "iana", + "extensions": ["tfi"] + }, + "application/timestamp-query": { + "source": "iana" + }, + "application/timestamp-reply": { + "source": "iana" + }, + "application/timestamped-data": { + "source": "iana", + "extensions": ["tsd"] + }, + "application/ttml+xml": { + "source": "iana" + }, + "application/tve-trigger": { + "source": "iana" + }, + "application/ulpfec": { + "source": "iana" + }, + "application/urc-grpsheet+xml": { + "source": "iana" + }, + "application/urc-ressheet+xml": { + "source": "iana" + }, + "application/urc-targetdesc+xml": { + "source": "iana" + }, + "application/urc-uisocketdesc+xml": { + "source": "iana" + }, + "application/vcard+json": { + "source": "iana", + "compressible": true + }, + "application/vcard+xml": { + "source": "iana" + }, + "application/vemmi": { + "source": "iana" + }, + "application/vividence.scriptfile": { + "source": "apache" + }, + "application/vnd.3gpp-prose+xml": { + "source": "iana" + }, + "application/vnd.3gpp-prose-pc3ch+xml": { + "source": "iana" + }, + "application/vnd.3gpp.access-transfer-events+xml": { + "source": "iana" + }, + "application/vnd.3gpp.bsf+xml": { + "source": "iana" + }, + "application/vnd.3gpp.mid-call+xml": { + "source": "iana" + }, + "application/vnd.3gpp.pic-bw-large": { + "source": "iana", + "extensions": ["plb"] + }, + "application/vnd.3gpp.pic-bw-small": { + "source": "iana", + "extensions": ["psb"] + }, + "application/vnd.3gpp.pic-bw-var": { + "source": "iana", + "extensions": ["pvb"] + }, + "application/vnd.3gpp.sms": { + "source": "iana" + }, + "application/vnd.3gpp.srvcc-ext+xml": { + "source": "iana" + }, + "application/vnd.3gpp.srvcc-info+xml": { + "source": "iana" + }, + "application/vnd.3gpp.state-and-event-info+xml": { + "source": "iana" + }, + "application/vnd.3gpp.ussd+xml": { + "source": "iana" + }, + "application/vnd.3gpp2.bcmcsinfo+xml": { + "source": "iana" + }, + "application/vnd.3gpp2.sms": { + "source": "iana" + }, + "application/vnd.3gpp2.tcap": { + "source": "iana", + "extensions": ["tcap"] + }, + "application/vnd.3m.post-it-notes": { + "source": "iana", + "extensions": ["pwn"] + }, + "application/vnd.accpac.simply.aso": { + "source": "iana", + "extensions": ["aso"] + }, + "application/vnd.accpac.simply.imp": { + "source": "iana", + "extensions": ["imp"] + }, + "application/vnd.acucobol": { + "source": "iana", + "extensions": ["acu"] + }, + "application/vnd.acucorp": { + "source": "iana", + "extensions": ["atc","acutc"] + }, + "application/vnd.adobe.air-application-installer-package+zip": { + "source": "apache", + "extensions": ["air"] + }, + "application/vnd.adobe.flash.movie": { + "source": "iana" + }, + "application/vnd.adobe.formscentral.fcdt": { + "source": "iana", + "extensions": ["fcdt"] + }, + "application/vnd.adobe.fxp": { + "source": "iana", + "extensions": ["fxp","fxpl"] + }, + "application/vnd.adobe.partial-upload": { + "source": "iana" + }, + "application/vnd.adobe.xdp+xml": { + "source": "iana", + "extensions": ["xdp"] + }, + "application/vnd.adobe.xfdf": { + "source": "iana", + "extensions": ["xfdf"] + }, + "application/vnd.aether.imp": { + "source": "iana" + }, + "application/vnd.ah-barcode": { + "source": "iana" + }, + "application/vnd.ahead.space": { + "source": "iana", + "extensions": ["ahead"] + }, + "application/vnd.airzip.filesecure.azf": { + "source": "iana", + "extensions": ["azf"] + }, + "application/vnd.airzip.filesecure.azs": { + "source": "iana", + "extensions": ["azs"] + }, + "application/vnd.amazon.ebook": { + "source": "apache", + "extensions": ["azw"] + }, + "application/vnd.americandynamics.acc": { + "source": "iana", + "extensions": ["acc"] + }, + "application/vnd.amiga.ami": { + "source": "iana", + "extensions": ["ami"] + }, + "application/vnd.amundsen.maze+xml": { + "source": "iana" + }, + "application/vnd.android.package-archive": { + "source": "apache", + "compressible": false, + "extensions": ["apk"] + }, + "application/vnd.anki": { + "source": "iana" + }, + "application/vnd.anser-web-certificate-issue-initiation": { + "source": "iana", + "extensions": ["cii"] + }, + "application/vnd.anser-web-funds-transfer-initiation": { + "source": "apache", + "extensions": ["fti"] + }, + "application/vnd.antix.game-component": { + "source": "iana", + "extensions": ["atx"] + }, + "application/vnd.apache.thrift.binary": { + "source": "iana" + }, + "application/vnd.apache.thrift.compact": { + "source": "iana" + }, + "application/vnd.apache.thrift.json": { + "source": "iana" + }, + "application/vnd.api+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.apple.installer+xml": { + "source": "iana", + "extensions": ["mpkg"] + }, + "application/vnd.apple.mpegurl": { + "source": "iana", + "extensions": ["m3u8"] + }, + "application/vnd.apple.pkpass": { + "compressible": false, + "extensions": ["pkpass"] + }, + "application/vnd.arastra.swi": { + "source": "iana" + }, + "application/vnd.aristanetworks.swi": { + "source": "iana", + "extensions": ["swi"] + }, + "application/vnd.artsquare": { + "source": "iana" + }, + "application/vnd.astraea-software.iota": { + "source": "iana", + "extensions": ["iota"] + }, + "application/vnd.audiograph": { + "source": "iana", + "extensions": ["aep"] + }, + "application/vnd.autopackage": { + "source": "iana" + }, + "application/vnd.avistar+xml": { + "source": "iana" + }, + "application/vnd.balsamiq.bmml+xml": { + "source": "iana" + }, + "application/vnd.balsamiq.bmpr": { + "source": "iana" + }, + "application/vnd.bekitzur-stech+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.biopax.rdf+xml": { + "source": "iana" + }, + "application/vnd.blueice.multipass": { + "source": "iana", + "extensions": ["mpm"] + }, + "application/vnd.bluetooth.ep.oob": { + "source": "iana" + }, + "application/vnd.bluetooth.le.oob": { + "source": "iana" + }, + "application/vnd.bmi": { + "source": "iana", + "extensions": ["bmi"] + }, + "application/vnd.businessobjects": { + "source": "iana", + "extensions": ["rep"] + }, + "application/vnd.cab-jscript": { + "source": "iana" + }, + "application/vnd.canon-cpdl": { + "source": "iana" + }, + "application/vnd.canon-lips": { + "source": "iana" + }, + "application/vnd.cendio.thinlinc.clientconf": { + "source": "iana" + }, + "application/vnd.century-systems.tcp_stream": { + "source": "iana" + }, + "application/vnd.chemdraw+xml": { + "source": "iana", + "extensions": ["cdxml"] + }, + "application/vnd.chipnuts.karaoke-mmd": { + "source": "iana", + "extensions": ["mmd"] + }, + "application/vnd.cinderella": { + "source": "iana", + "extensions": ["cdy"] + }, + "application/vnd.cirpack.isdn-ext": { + "source": "iana" + }, + "application/vnd.citationstyles.style+xml": { + "source": "iana" + }, + "application/vnd.claymore": { + "source": "iana", + "extensions": ["cla"] + }, + "application/vnd.cloanto.rp9": { + "source": "iana", + "extensions": ["rp9"] + }, + "application/vnd.clonk.c4group": { + "source": "iana", + "extensions": ["c4g","c4d","c4f","c4p","c4u"] + }, + "application/vnd.cluetrust.cartomobile-config": { + "source": "iana", + "extensions": ["c11amc"] + }, + "application/vnd.cluetrust.cartomobile-config-pkg": { + "source": "iana", + "extensions": ["c11amz"] + }, + "application/vnd.coffeescript": { + "source": "iana" + }, + "application/vnd.collection+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.doc+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.collection.next+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.commerce-battelle": { + "source": "iana" + }, + "application/vnd.commonspace": { + "source": "iana", + "extensions": ["csp"] + }, + "application/vnd.contact.cmsg": { + "source": "iana", + "extensions": ["cdbcmsg"] + }, + "application/vnd.cosmocaller": { + "source": "iana", + "extensions": ["cmc"] + }, + "application/vnd.crick.clicker": { + "source": "iana", + "extensions": ["clkx"] + }, + "application/vnd.crick.clicker.keyboard": { + "source": "iana", + "extensions": ["clkk"] + }, + "application/vnd.crick.clicker.palette": { + "source": "iana", + "extensions": ["clkp"] + }, + "application/vnd.crick.clicker.template": { + "source": "iana", + "extensions": ["clkt"] + }, + "application/vnd.crick.clicker.wordbank": { + "source": "iana", + "extensions": ["clkw"] + }, + "application/vnd.criticaltools.wbs+xml": { + "source": "iana", + "extensions": ["wbs"] + }, + "application/vnd.ctc-posml": { + "source": "iana", + "extensions": ["pml"] + }, + "application/vnd.ctct.ws+xml": { + "source": "iana" + }, + "application/vnd.cups-pdf": { + "source": "iana" + }, + "application/vnd.cups-postscript": { + "source": "iana" + }, + "application/vnd.cups-ppd": { + "source": "iana", + "extensions": ["ppd"] + }, + "application/vnd.cups-raster": { + "source": "iana" + }, + "application/vnd.cups-raw": { + "source": "iana" + }, + "application/vnd.curl": { + "source": "iana" + }, + "application/vnd.curl.car": { + "source": "apache", + "extensions": ["car"] + }, + "application/vnd.curl.pcurl": { + "source": "apache", + "extensions": ["pcurl"] + }, + "application/vnd.cyan.dean.root+xml": { + "source": "iana" + }, + "application/vnd.cybank": { + "source": "iana" + }, + "application/vnd.dart": { + "source": "iana", + "compressible": true, + "extensions": ["dart"] + }, + "application/vnd.data-vision.rdz": { + "source": "iana", + "extensions": ["rdz"] + }, + "application/vnd.debian.binary-package": { + "source": "iana" + }, + "application/vnd.dece.data": { + "source": "iana", + "extensions": ["uvf","uvvf","uvd","uvvd"] + }, + "application/vnd.dece.ttml+xml": { + "source": "iana", + "extensions": ["uvt","uvvt"] + }, + "application/vnd.dece.unspecified": { + "source": "iana", + "extensions": ["uvx","uvvx"] + }, + "application/vnd.dece.zip": { + "source": "iana", + "extensions": ["uvz","uvvz"] + }, + "application/vnd.denovo.fcselayout-link": { + "source": "iana", + "extensions": ["fe_launch"] + }, + "application/vnd.desmume-movie": { + "source": "iana" + }, + "application/vnd.dir-bi.plate-dl-nosuffix": { + "source": "iana" + }, + "application/vnd.dm.delegation+xml": { + "source": "iana" + }, + "application/vnd.dna": { + "source": "iana", + "extensions": ["dna"] + }, + "application/vnd.document+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.dolby.mlp": { + "source": "apache", + "extensions": ["mlp"] + }, + "application/vnd.dolby.mobile.1": { + "source": "iana" + }, + "application/vnd.dolby.mobile.2": { + "source": "iana" + }, + "application/vnd.doremir.scorecloud-binary-document": { + "source": "iana" + }, + "application/vnd.dpgraph": { + "source": "iana", + "extensions": ["dpg"] + }, + "application/vnd.dreamfactory": { + "source": "iana", + "extensions": ["dfac"] + }, + "application/vnd.drive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ds-keypoint": { + "source": "apache", + "extensions": ["kpxx"] + }, + "application/vnd.dtg.local": { + "source": "iana" + }, + "application/vnd.dtg.local.flash": { + "source": "iana" + }, + "application/vnd.dtg.local.html": { + "source": "iana" + }, + "application/vnd.dvb.ait": { + "source": "iana", + "extensions": ["ait"] + }, + "application/vnd.dvb.dvbj": { + "source": "iana" + }, + "application/vnd.dvb.esgcontainer": { + "source": "iana" + }, + "application/vnd.dvb.ipdcdftnotifaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgaccess2": { + "source": "iana" + }, + "application/vnd.dvb.ipdcesgpdd": { + "source": "iana" + }, + "application/vnd.dvb.ipdcroaming": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-base": { + "source": "iana" + }, + "application/vnd.dvb.iptv.alfec-enhancement": { + "source": "iana" + }, + "application/vnd.dvb.notif-aggregate-root+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-container+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-generic+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-msglist+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-registration-request+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-ia-registration-response+xml": { + "source": "iana" + }, + "application/vnd.dvb.notif-init+xml": { + "source": "iana" + }, + "application/vnd.dvb.pfr": { + "source": "iana" + }, + "application/vnd.dvb.service": { + "source": "iana", + "extensions": ["svc"] + }, + "application/vnd.dxr": { + "source": "iana" + }, + "application/vnd.dynageo": { + "source": "iana", + "extensions": ["geo"] + }, + "application/vnd.dzr": { + "source": "iana" + }, + "application/vnd.easykaraoke.cdgdownload": { + "source": "iana" + }, + "application/vnd.ecdis-update": { + "source": "iana" + }, + "application/vnd.ecowin.chart": { + "source": "iana", + "extensions": ["mag"] + }, + "application/vnd.ecowin.filerequest": { + "source": "iana" + }, + "application/vnd.ecowin.fileupdate": { + "source": "iana" + }, + "application/vnd.ecowin.series": { + "source": "iana" + }, + "application/vnd.ecowin.seriesrequest": { + "source": "iana" + }, + "application/vnd.ecowin.seriesupdate": { + "source": "iana" + }, + "application/vnd.emclient.accessrequest+xml": { + "source": "iana" + }, + "application/vnd.enliven": { + "source": "iana", + "extensions": ["nml"] + }, + "application/vnd.enphase.envoy": { + "source": "iana" + }, + "application/vnd.eprints.data+xml": { + "source": "iana" + }, + "application/vnd.epson.esf": { + "source": "iana", + "extensions": ["esf"] + }, + "application/vnd.epson.msf": { + "source": "iana", + "extensions": ["msf"] + }, + "application/vnd.epson.quickanime": { + "source": "iana", + "extensions": ["qam"] + }, + "application/vnd.epson.salt": { + "source": "iana", + "extensions": ["slt"] + }, + "application/vnd.epson.ssf": { + "source": "iana", + "extensions": ["ssf"] + }, + "application/vnd.ericsson.quickcall": { + "source": "iana" + }, + "application/vnd.eszigno3+xml": { + "source": "iana", + "extensions": ["es3","et3"] + }, + "application/vnd.etsi.aoc+xml": { + "source": "iana" + }, + "application/vnd.etsi.asic-e+zip": { + "source": "iana" + }, + "application/vnd.etsi.asic-s+zip": { + "source": "iana" + }, + "application/vnd.etsi.cug+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvcommand+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvdiscovery+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvprofile+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-bc+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-cod+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsad-npvr+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvservice+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvsync+xml": { + "source": "iana" + }, + "application/vnd.etsi.iptvueprofile+xml": { + "source": "iana" + }, + "application/vnd.etsi.mcid+xml": { + "source": "iana" + }, + "application/vnd.etsi.mheg5": { + "source": "iana" + }, + "application/vnd.etsi.overload-control-policy-dataset+xml": { + "source": "iana" + }, + "application/vnd.etsi.pstn+xml": { + "source": "iana" + }, + "application/vnd.etsi.sci+xml": { + "source": "iana" + }, + "application/vnd.etsi.simservs+xml": { + "source": "iana" + }, + "application/vnd.etsi.timestamp-token": { + "source": "iana" + }, + "application/vnd.etsi.tsl+xml": { + "source": "iana" + }, + "application/vnd.etsi.tsl.der": { + "source": "iana" + }, + "application/vnd.eudora.data": { + "source": "iana" + }, + "application/vnd.ezpix-album": { + "source": "iana", + "extensions": ["ez2"] + }, + "application/vnd.ezpix-package": { + "source": "iana", + "extensions": ["ez3"] + }, + "application/vnd.f-secure.mobile": { + "source": "iana" + }, + "application/vnd.fastcopy-disk-image": { + "source": "iana" + }, + "application/vnd.fdf": { + "source": "iana", + "extensions": ["fdf"] + }, + "application/vnd.fdsn.mseed": { + "source": "iana", + "extensions": ["mseed"] + }, + "application/vnd.fdsn.seed": { + "source": "iana", + "extensions": ["seed","dataless"] + }, + "application/vnd.ffsns": { + "source": "iana" + }, + "application/vnd.fints": { + "source": "iana" + }, + "application/vnd.firemonkeys.cloudcell": { + "source": "iana" + }, + "application/vnd.flographit": { + "source": "iana", + "extensions": ["gph"] + }, + "application/vnd.fluxtime.clip": { + "source": "iana", + "extensions": ["ftc"] + }, + "application/vnd.font-fontforge-sfd": { + "source": "iana" + }, + "application/vnd.framemaker": { + "source": "iana", + "extensions": ["fm","frame","maker","book"] + }, + "application/vnd.frogans.fnc": { + "source": "iana", + "extensions": ["fnc"] + }, + "application/vnd.frogans.ltf": { + "source": "iana", + "extensions": ["ltf"] + }, + "application/vnd.fsc.weblaunch": { + "source": "iana", + "extensions": ["fsc"] + }, + "application/vnd.fujitsu.oasys": { + "source": "iana", + "extensions": ["oas"] + }, + "application/vnd.fujitsu.oasys2": { + "source": "iana", + "extensions": ["oa2"] + }, + "application/vnd.fujitsu.oasys3": { + "source": "iana", + "extensions": ["oa3"] + }, + "application/vnd.fujitsu.oasysgp": { + "source": "iana", + "extensions": ["fg5"] + }, + "application/vnd.fujitsu.oasysprs": { + "source": "iana", + "extensions": ["bh2"] + }, + "application/vnd.fujixerox.art-ex": { + "source": "iana" + }, + "application/vnd.fujixerox.art4": { + "source": "iana" + }, + "application/vnd.fujixerox.ddd": { + "source": "iana", + "extensions": ["ddd"] + }, + "application/vnd.fujixerox.docuworks": { + "source": "iana", + "extensions": ["xdw"] + }, + "application/vnd.fujixerox.docuworks.binder": { + "source": "iana", + "extensions": ["xbd"] + }, + "application/vnd.fujixerox.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujixerox.hbpl": { + "source": "iana" + }, + "application/vnd.fut-misnet": { + "source": "iana" + }, + "application/vnd.fuzzysheet": { + "source": "iana", + "extensions": ["fzs"] + }, + "application/vnd.genomatix.tuxedo": { + "source": "iana", + "extensions": ["txd"] + }, + "application/vnd.geo+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.geocube+xml": { + "source": "iana" + }, + "application/vnd.geogebra.file": { + "source": "iana", + "extensions": ["ggb"] + }, + "application/vnd.geogebra.tool": { + "source": "iana", + "extensions": ["ggt"] + }, + "application/vnd.geometry-explorer": { + "source": "iana", + "extensions": ["gex","gre"] + }, + "application/vnd.geonext": { + "source": "iana", + "extensions": ["gxt"] + }, + "application/vnd.geoplan": { + "source": "iana", + "extensions": ["g2w"] + }, + "application/vnd.geospace": { + "source": "iana", + "extensions": ["g3w"] + }, + "application/vnd.gerber": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt": { + "source": "iana" + }, + "application/vnd.globalplatform.card-content-mgt-response": { + "source": "iana" + }, + "application/vnd.gmx": { + "source": "iana", + "extensions": ["gmx"] + }, + "application/vnd.google-earth.kml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["kml"] + }, + "application/vnd.google-earth.kmz": { + "source": "iana", + "compressible": false, + "extensions": ["kmz"] + }, + "application/vnd.gov.sk.e-form+xml": { + "source": "iana" + }, + "application/vnd.gov.sk.e-form+zip": { + "source": "iana" + }, + "application/vnd.gov.sk.xmldatacontainer+xml": { + "source": "iana" + }, + "application/vnd.grafeq": { + "source": "iana", + "extensions": ["gqf","gqs"] + }, + "application/vnd.gridmp": { + "source": "iana" + }, + "application/vnd.groove-account": { + "source": "iana", + "extensions": ["gac"] + }, + "application/vnd.groove-help": { + "source": "iana", + "extensions": ["ghf"] + }, + "application/vnd.groove-identity-message": { + "source": "iana", + "extensions": ["gim"] + }, + "application/vnd.groove-injector": { + "source": "iana", + "extensions": ["grv"] + }, + "application/vnd.groove-tool-message": { + "source": "iana", + "extensions": ["gtm"] + }, + "application/vnd.groove-tool-template": { + "source": "iana", + "extensions": ["tpl"] + }, + "application/vnd.groove-vcard": { + "source": "iana", + "extensions": ["vcg"] + }, + "application/vnd.hal+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hal+xml": { + "source": "iana", + "extensions": ["hal"] + }, + "application/vnd.handheld-entertainment+xml": { + "source": "iana", + "extensions": ["zmm"] + }, + "application/vnd.hbci": { + "source": "iana", + "extensions": ["hbci"] + }, + "application/vnd.hcl-bireports": { + "source": "iana" + }, + "application/vnd.heroku+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hhe.lesson-player": { + "source": "iana", + "extensions": ["les"] + }, + "application/vnd.hp-hpgl": { + "source": "iana", + "extensions": ["hpgl"] + }, + "application/vnd.hp-hpid": { + "source": "iana", + "extensions": ["hpid"] + }, + "application/vnd.hp-hps": { + "source": "iana", + "extensions": ["hps"] + }, + "application/vnd.hp-jlyt": { + "source": "iana", + "extensions": ["jlt"] + }, + "application/vnd.hp-pcl": { + "source": "iana", + "extensions": ["pcl"] + }, + "application/vnd.hp-pclxl": { + "source": "iana", + "extensions": ["pclxl"] + }, + "application/vnd.httphone": { + "source": "iana" + }, + "application/vnd.hydrostatix.sof-data": { + "source": "iana", + "extensions": ["sfd-hdstx"] + }, + "application/vnd.hyperdrive+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.hzn-3d-crossword": { + "source": "iana" + }, + "application/vnd.ibm.afplinedata": { + "source": "iana" + }, + "application/vnd.ibm.electronic-media": { + "source": "iana" + }, + "application/vnd.ibm.minipay": { + "source": "iana", + "extensions": ["mpy"] + }, + "application/vnd.ibm.modcap": { + "source": "iana", + "extensions": ["afp","listafp","list3820"] + }, + "application/vnd.ibm.rights-management": { + "source": "iana", + "extensions": ["irm"] + }, + "application/vnd.ibm.secure-container": { + "source": "iana", + "extensions": ["sc"] + }, + "application/vnd.iccprofile": { + "source": "iana", + "extensions": ["icc","icm"] + }, + "application/vnd.ieee.1905": { + "source": "iana" + }, + "application/vnd.igloader": { + "source": "iana", + "extensions": ["igl"] + }, + "application/vnd.immervision-ivp": { + "source": "iana", + "extensions": ["ivp"] + }, + "application/vnd.immervision-ivu": { + "source": "iana", + "extensions": ["ivu"] + }, + "application/vnd.ims.imsccv1p1": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p2": { + "source": "iana" + }, + "application/vnd.ims.imsccv1p3": { + "source": "iana" + }, + "application/vnd.ims.lis.v2.result+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolconsumerprofile+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolproxy.id+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.ims.lti.v2.toolsettings.simple+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.informedcontrol.rms+xml": { + "source": "iana" + }, + "application/vnd.informix-visionary": { + "source": "iana" + }, + "application/vnd.infotech.project": { + "source": "iana" + }, + "application/vnd.infotech.project+xml": { + "source": "iana" + }, + "application/vnd.innopath.wamp.notification": { + "source": "iana" + }, + "application/vnd.insors.igm": { + "source": "iana", + "extensions": ["igm"] + }, + "application/vnd.intercon.formnet": { + "source": "iana", + "extensions": ["xpw","xpx"] + }, + "application/vnd.intergeo": { + "source": "iana", + "extensions": ["i2g"] + }, + "application/vnd.intertrust.digibox": { + "source": "iana" + }, + "application/vnd.intertrust.nncp": { + "source": "iana" + }, + "application/vnd.intu.qbo": { + "source": "iana", + "extensions": ["qbo"] + }, + "application/vnd.intu.qfx": { + "source": "iana", + "extensions": ["qfx"] + }, + "application/vnd.iptc.g2.catalogitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.conceptitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.knowledgeitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.newsitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.newsmessage+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.packageitem+xml": { + "source": "iana" + }, + "application/vnd.iptc.g2.planningitem+xml": { + "source": "iana" + }, + "application/vnd.ipunplugged.rcprofile": { + "source": "iana", + "extensions": ["rcprofile"] + }, + "application/vnd.irepository.package+xml": { + "source": "iana", + "extensions": ["irp"] + }, + "application/vnd.is-xpr": { + "source": "iana", + "extensions": ["xpr"] + }, + "application/vnd.isac.fcs": { + "source": "iana", + "extensions": ["fcs"] + }, + "application/vnd.jam": { + "source": "iana", + "extensions": ["jam"] + }, + "application/vnd.japannet-directory-service": { + "source": "iana" + }, + "application/vnd.japannet-jpnstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-payment-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-registration": { + "source": "iana" + }, + "application/vnd.japannet-registration-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-setstore-wakeup": { + "source": "iana" + }, + "application/vnd.japannet-verification": { + "source": "iana" + }, + "application/vnd.japannet-verification-wakeup": { + "source": "iana" + }, + "application/vnd.jcp.javame.midlet-rms": { + "source": "iana", + "extensions": ["rms"] + }, + "application/vnd.jisp": { + "source": "iana", + "extensions": ["jisp"] + }, + "application/vnd.joost.joda-archive": { + "source": "iana", + "extensions": ["joda"] + }, + "application/vnd.jsk.isdn-ngn": { + "source": "iana" + }, + "application/vnd.kahootz": { + "source": "iana", + "extensions": ["ktz","ktr"] + }, + "application/vnd.kde.karbon": { + "source": "iana", + "extensions": ["karbon"] + }, + "application/vnd.kde.kchart": { + "source": "iana", + "extensions": ["chrt"] + }, + "application/vnd.kde.kformula": { + "source": "iana", + "extensions": ["kfo"] + }, + "application/vnd.kde.kivio": { + "source": "iana", + "extensions": ["flw"] + }, + "application/vnd.kde.kontour": { + "source": "iana", + "extensions": ["kon"] + }, + "application/vnd.kde.kpresenter": { + "source": "iana", + "extensions": ["kpr","kpt"] + }, + "application/vnd.kde.kspread": { + "source": "iana", + "extensions": ["ksp"] + }, + "application/vnd.kde.kword": { + "source": "iana", + "extensions": ["kwd","kwt"] + }, + "application/vnd.kenameaapp": { + "source": "iana", + "extensions": ["htke"] + }, + "application/vnd.kidspiration": { + "source": "iana", + "extensions": ["kia"] + }, + "application/vnd.kinar": { + "source": "iana", + "extensions": ["kne","knp"] + }, + "application/vnd.koan": { + "source": "iana", + "extensions": ["skp","skd","skt","skm"] + }, + "application/vnd.kodak-descriptor": { + "source": "iana", + "extensions": ["sse"] + }, + "application/vnd.las.las+xml": { + "source": "iana", + "extensions": ["lasxml"] + }, + "application/vnd.liberty-request+xml": { + "source": "iana" + }, + "application/vnd.llamagraphics.life-balance.desktop": { + "source": "iana", + "extensions": ["lbd"] + }, + "application/vnd.llamagraphics.life-balance.exchange+xml": { + "source": "iana", + "extensions": ["lbe"] + }, + "application/vnd.lotus-1-2-3": { + "source": "iana", + "extensions": ["123"] + }, + "application/vnd.lotus-approach": { + "source": "iana", + "extensions": ["apr"] + }, + "application/vnd.lotus-freelance": { + "source": "iana", + "extensions": ["pre"] + }, + "application/vnd.lotus-notes": { + "source": "iana", + "extensions": ["nsf"] + }, + "application/vnd.lotus-organizer": { + "source": "iana", + "extensions": ["org"] + }, + "application/vnd.lotus-screencam": { + "source": "iana", + "extensions": ["scm"] + }, + "application/vnd.lotus-wordpro": { + "source": "iana", + "extensions": ["lwp"] + }, + "application/vnd.macports.portpkg": { + "source": "iana", + "extensions": ["portpkg"] + }, + "application/vnd.marlin.drm.actiontoken+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.conftoken+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.license+xml": { + "source": "iana" + }, + "application/vnd.marlin.drm.mdcf": { + "source": "iana" + }, + "application/vnd.mason+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.maxmind.maxmind-db": { + "source": "iana" + }, + "application/vnd.mcd": { + "source": "iana", + "extensions": ["mcd"] + }, + "application/vnd.medcalcdata": { + "source": "iana", + "extensions": ["mc1"] + }, + "application/vnd.mediastation.cdkey": { + "source": "iana", + "extensions": ["cdkey"] + }, + "application/vnd.meridian-slingshot": { + "source": "iana" + }, + "application/vnd.mfer": { + "source": "iana", + "extensions": ["mwf"] + }, + "application/vnd.mfmp": { + "source": "iana", + "extensions": ["mfm"] + }, + "application/vnd.micro+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.micrografx.flo": { + "source": "iana", + "extensions": ["flo"] + }, + "application/vnd.micrografx.igx": { + "source": "iana", + "extensions": ["igx"] + }, + "application/vnd.microsoft.portable-executable": { + "source": "iana" + }, + "application/vnd.miele+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.mif": { + "source": "iana", + "extensions": ["mif"] + }, + "application/vnd.minisoft-hp3000-save": { + "source": "iana" + }, + "application/vnd.mitsubishi.misty-guard.trustweb": { + "source": "iana" + }, + "application/vnd.mobius.daf": { + "source": "iana", + "extensions": ["daf"] + }, + "application/vnd.mobius.dis": { + "source": "iana", + "extensions": ["dis"] + }, + "application/vnd.mobius.mbk": { + "source": "iana", + "extensions": ["mbk"] + }, + "application/vnd.mobius.mqy": { + "source": "iana", + "extensions": ["mqy"] + }, + "application/vnd.mobius.msl": { + "source": "iana", + "extensions": ["msl"] + }, + "application/vnd.mobius.plc": { + "source": "iana", + "extensions": ["plc"] + }, + "application/vnd.mobius.txf": { + "source": "iana", + "extensions": ["txf"] + }, + "application/vnd.mophun.application": { + "source": "iana", + "extensions": ["mpn"] + }, + "application/vnd.mophun.certificate": { + "source": "iana", + "extensions": ["mpc"] + }, + "application/vnd.motorola.flexsuite": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.adsi": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.fis": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.gotap": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.kmr": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.ttc": { + "source": "iana" + }, + "application/vnd.motorola.flexsuite.wem": { + "source": "iana" + }, + "application/vnd.motorola.iprm": { + "source": "iana" + }, + "application/vnd.mozilla.xul+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xul"] + }, + "application/vnd.ms-3mfdocument": { + "source": "iana" + }, + "application/vnd.ms-artgalry": { + "source": "iana", + "extensions": ["cil"] + }, + "application/vnd.ms-asf": { + "source": "iana" + }, + "application/vnd.ms-cab-compressed": { + "source": "iana", + "extensions": ["cab"] + }, + "application/vnd.ms-color.iccprofile": { + "source": "apache" + }, + "application/vnd.ms-excel": { + "source": "iana", + "compressible": false, + "extensions": ["xls","xlm","xla","xlc","xlt","xlw"] + }, + "application/vnd.ms-excel.addin.macroenabled.12": { + "source": "iana", + "extensions": ["xlam"] + }, + "application/vnd.ms-excel.sheet.binary.macroenabled.12": { + "source": "iana", + "extensions": ["xlsb"] + }, + "application/vnd.ms-excel.sheet.macroenabled.12": { + "source": "iana", + "extensions": ["xlsm"] + }, + "application/vnd.ms-excel.template.macroenabled.12": { + "source": "iana", + "extensions": ["xltm"] + }, + "application/vnd.ms-fontobject": { + "source": "iana", + "compressible": true, + "extensions": ["eot"] + }, + "application/vnd.ms-htmlhelp": { + "source": "iana", + "extensions": ["chm"] + }, + "application/vnd.ms-ims": { + "source": "iana", + "extensions": ["ims"] + }, + "application/vnd.ms-lrm": { + "source": "iana", + "extensions": ["lrm"] + }, + "application/vnd.ms-office.activex+xml": { + "source": "iana" + }, + "application/vnd.ms-officetheme": { + "source": "iana", + "extensions": ["thmx"] + }, + "application/vnd.ms-opentype": { + "source": "apache", + "compressible": true + }, + "application/vnd.ms-package.obfuscated-opentype": { + "source": "apache" + }, + "application/vnd.ms-pki.seccat": { + "source": "apache", + "extensions": ["cat"] + }, + "application/vnd.ms-pki.stl": { + "source": "apache", + "extensions": ["stl"] + }, + "application/vnd.ms-playready.initiator+xml": { + "source": "iana" + }, + "application/vnd.ms-powerpoint": { + "source": "iana", + "compressible": false, + "extensions": ["ppt","pps","pot"] + }, + "application/vnd.ms-powerpoint.addin.macroenabled.12": { + "source": "iana", + "extensions": ["ppam"] + }, + "application/vnd.ms-powerpoint.presentation.macroenabled.12": { + "source": "iana", + "extensions": ["pptm"] + }, + "application/vnd.ms-powerpoint.slide.macroenabled.12": { + "source": "iana", + "extensions": ["sldm"] + }, + "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { + "source": "iana", + "extensions": ["ppsm"] + }, + "application/vnd.ms-powerpoint.template.macroenabled.12": { + "source": "iana", + "extensions": ["potm"] + }, + "application/vnd.ms-printing.printticket+xml": { + "source": "apache" + }, + "application/vnd.ms-project": { + "source": "iana", + "extensions": ["mpp","mpt"] + }, + "application/vnd.ms-tnef": { + "source": "iana" + }, + "application/vnd.ms-windows.printerpairing": { + "source": "iana" + }, + "application/vnd.ms-windows.wsd.oob": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.lic-resp": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-chlg-req": { + "source": "iana" + }, + "application/vnd.ms-wmdrm.meter-resp": { + "source": "iana" + }, + "application/vnd.ms-word.document.macroenabled.12": { + "source": "iana", + "extensions": ["docm"] + }, + "application/vnd.ms-word.template.macroenabled.12": { + "source": "iana", + "extensions": ["dotm"] + }, + "application/vnd.ms-works": { + "source": "iana", + "extensions": ["wps","wks","wcm","wdb"] + }, + "application/vnd.ms-wpl": { + "source": "iana", + "extensions": ["wpl"] + }, + "application/vnd.ms-xpsdocument": { + "source": "iana", + "compressible": false, + "extensions": ["xps"] + }, + "application/vnd.msa-disk-image": { + "source": "iana" + }, + "application/vnd.mseq": { + "source": "iana", + "extensions": ["mseq"] + }, + "application/vnd.msign": { + "source": "iana" + }, + "application/vnd.multiad.creator": { + "source": "iana" + }, + "application/vnd.multiad.creator.cif": { + "source": "iana" + }, + "application/vnd.music-niff": { + "source": "iana" + }, + "application/vnd.musician": { + "source": "iana", + "extensions": ["mus"] + }, + "application/vnd.muvee.style": { + "source": "iana", + "extensions": ["msty"] + }, + "application/vnd.mynfc": { + "source": "iana", + "extensions": ["taglet"] + }, + "application/vnd.ncd.control": { + "source": "iana" + }, + "application/vnd.ncd.reference": { + "source": "iana" + }, + "application/vnd.nervana": { + "source": "iana" + }, + "application/vnd.netfpx": { + "source": "iana" + }, + "application/vnd.neurolanguage.nlu": { + "source": "iana", + "extensions": ["nlu"] + }, + "application/vnd.nintendo.nitro.rom": { + "source": "iana" + }, + "application/vnd.nintendo.snes.rom": { + "source": "iana" + }, + "application/vnd.nitf": { + "source": "iana", + "extensions": ["ntf","nitf"] + }, + "application/vnd.noblenet-directory": { + "source": "iana", + "extensions": ["nnd"] + }, + "application/vnd.noblenet-sealer": { + "source": "iana", + "extensions": ["nns"] + }, + "application/vnd.noblenet-web": { + "source": "iana", + "extensions": ["nnw"] + }, + "application/vnd.nokia.catalogs": { + "source": "iana" + }, + "application/vnd.nokia.conml+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.conml+xml": { + "source": "iana" + }, + "application/vnd.nokia.iptv.config+xml": { + "source": "iana" + }, + "application/vnd.nokia.isds-radio-presets": { + "source": "iana" + }, + "application/vnd.nokia.landmark+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.landmark+xml": { + "source": "iana" + }, + "application/vnd.nokia.landmarkcollection+xml": { + "source": "iana" + }, + "application/vnd.nokia.n-gage.ac+xml": { + "source": "iana" + }, + "application/vnd.nokia.n-gage.data": { + "source": "iana", + "extensions": ["ngdat"] + }, + "application/vnd.nokia.n-gage.symbian.install": { + "source": "iana", + "extensions": ["n-gage"] + }, + "application/vnd.nokia.ncd": { + "source": "iana" + }, + "application/vnd.nokia.pcd+wbxml": { + "source": "iana" + }, + "application/vnd.nokia.pcd+xml": { + "source": "iana" + }, + "application/vnd.nokia.radio-preset": { + "source": "iana", + "extensions": ["rpst"] + }, + "application/vnd.nokia.radio-presets": { + "source": "iana", + "extensions": ["rpss"] + }, + "application/vnd.novadigm.edm": { + "source": "iana", + "extensions": ["edm"] + }, + "application/vnd.novadigm.edx": { + "source": "iana", + "extensions": ["edx"] + }, + "application/vnd.novadigm.ext": { + "source": "iana", + "extensions": ["ext"] + }, + "application/vnd.ntt-local.content-share": { + "source": "iana" + }, + "application/vnd.ntt-local.file-transfer": { + "source": "iana" + }, + "application/vnd.ntt-local.ogw_remote-access": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_remote": { + "source": "iana" + }, + "application/vnd.ntt-local.sip-ta_tcp_stream": { + "source": "iana" + }, + "application/vnd.oasis.opendocument.chart": { + "source": "iana", + "extensions": ["odc"] + }, + "application/vnd.oasis.opendocument.chart-template": { + "source": "iana", + "extensions": ["otc"] + }, + "application/vnd.oasis.opendocument.database": { + "source": "iana", + "extensions": ["odb"] + }, + "application/vnd.oasis.opendocument.formula": { + "source": "iana", + "extensions": ["odf"] + }, + "application/vnd.oasis.opendocument.formula-template": { + "source": "iana", + "extensions": ["odft"] + }, + "application/vnd.oasis.opendocument.graphics": { + "source": "iana", + "compressible": false, + "extensions": ["odg"] + }, + "application/vnd.oasis.opendocument.graphics-template": { + "source": "iana", + "extensions": ["otg"] + }, + "application/vnd.oasis.opendocument.image": { + "source": "iana", + "extensions": ["odi"] + }, + "application/vnd.oasis.opendocument.image-template": { + "source": "iana", + "extensions": ["oti"] + }, + "application/vnd.oasis.opendocument.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["odp"] + }, + "application/vnd.oasis.opendocument.presentation-template": { + "source": "iana", + "extensions": ["otp"] + }, + "application/vnd.oasis.opendocument.spreadsheet": { + "source": "iana", + "compressible": false, + "extensions": ["ods"] + }, + "application/vnd.oasis.opendocument.spreadsheet-template": { + "source": "iana", + "extensions": ["ots"] + }, + "application/vnd.oasis.opendocument.text": { + "source": "iana", + "compressible": false, + "extensions": ["odt"] + }, + "application/vnd.oasis.opendocument.text-master": { + "source": "iana", + "extensions": ["odm"] + }, + "application/vnd.oasis.opendocument.text-template": { + "source": "iana", + "extensions": ["ott"] + }, + "application/vnd.oasis.opendocument.text-web": { + "source": "iana", + "extensions": ["oth"] + }, + "application/vnd.obn": { + "source": "iana" + }, + "application/vnd.oftn.l10n+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.oipf.contentaccessdownload+xml": { + "source": "iana" + }, + "application/vnd.oipf.contentaccessstreaming+xml": { + "source": "iana" + }, + "application/vnd.oipf.cspg-hexbinary": { + "source": "iana" + }, + "application/vnd.oipf.dae.svg+xml": { + "source": "iana" + }, + "application/vnd.oipf.dae.xhtml+xml": { + "source": "iana" + }, + "application/vnd.oipf.mippvcontrolmessage+xml": { + "source": "iana" + }, + "application/vnd.oipf.pae.gem": { + "source": "iana" + }, + "application/vnd.oipf.spdiscovery+xml": { + "source": "iana" + }, + "application/vnd.oipf.spdlist+xml": { + "source": "iana" + }, + "application/vnd.oipf.ueprofile+xml": { + "source": "iana" + }, + "application/vnd.oipf.userprofile+xml": { + "source": "iana" + }, + "application/vnd.olpc-sugar": { + "source": "iana", + "extensions": ["xo"] + }, + "application/vnd.oma-scws-config": { + "source": "iana" + }, + "application/vnd.oma-scws-http-request": { + "source": "iana" + }, + "application/vnd.oma-scws-http-response": { + "source": "iana" + }, + "application/vnd.oma.bcast.associated-procedure-parameter+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.drm-trigger+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.imd+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.ltkm": { + "source": "iana" + }, + "application/vnd.oma.bcast.notification+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.provisioningtrigger": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgboot": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdd+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.sgdu": { + "source": "iana" + }, + "application/vnd.oma.bcast.simple-symbol-container": { + "source": "iana" + }, + "application/vnd.oma.bcast.smartcard-trigger+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.sprov+xml": { + "source": "iana" + }, + "application/vnd.oma.bcast.stkm": { + "source": "iana" + }, + "application/vnd.oma.cab-address-book+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-feature-handler+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-pcc+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-subs-invite+xml": { + "source": "iana" + }, + "application/vnd.oma.cab-user-prefs+xml": { + "source": "iana" + }, + "application/vnd.oma.dcd": { + "source": "iana" + }, + "application/vnd.oma.dcdc": { + "source": "iana" + }, + "application/vnd.oma.dd2+xml": { + "source": "iana", + "extensions": ["dd2"] + }, + "application/vnd.oma.drm.risd+xml": { + "source": "iana" + }, + "application/vnd.oma.group-usage-list+xml": { + "source": "iana" + }, + "application/vnd.oma.pal+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.detailed-progress-report+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.final-report+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.groups+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.invocation-descriptor+xml": { + "source": "iana" + }, + "application/vnd.oma.poc.optimized-progress-report+xml": { + "source": "iana" + }, + "application/vnd.oma.push": { + "source": "iana" + }, + "application/vnd.oma.scidm.messages+xml": { + "source": "iana" + }, + "application/vnd.oma.xcap-directory+xml": { + "source": "iana" + }, + "application/vnd.omads-email+xml": { + "source": "iana" + }, + "application/vnd.omads-file+xml": { + "source": "iana" + }, + "application/vnd.omads-folder+xml": { + "source": "iana" + }, + "application/vnd.omaloc-supl-init": { + "source": "iana" + }, + "application/vnd.openblox.game+xml": { + "source": "iana" + }, + "application/vnd.openblox.game-binary": { + "source": "iana" + }, + "application/vnd.openeye.oeb": { + "source": "iana" + }, + "application/vnd.openofficeorg.extension": { + "source": "apache", + "extensions": ["oxt"] + }, + "application/vnd.openxmlformats-officedocument.custom-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawing+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.extended-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation": { + "source": "iana", + "compressible": false, + "extensions": ["pptx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide": { + "source": "iana", + "extensions": ["sldx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { + "source": "iana", + "extensions": ["ppsx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.template": { + "source": "apache", + "extensions": ["potx"] + }, + "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { + "source": "iana", + "compressible": false, + "extensions": ["xlsx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { + "source": "apache", + "extensions": ["xltx"] + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.theme+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.themeoverride+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.vmldrawing": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml-template": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { + "source": "iana", + "compressible": false, + "extensions": ["docx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { + "source": "apache", + "extensions": ["dotx"] + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.core-properties+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { + "source": "iana" + }, + "application/vnd.openxmlformats-package.relationships+xml": { + "source": "iana" + }, + "application/vnd.oracle.resource+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.orange.indata": { + "source": "iana" + }, + "application/vnd.osa.netdeploy": { + "source": "iana" + }, + "application/vnd.osgeo.mapguide.package": { + "source": "iana", + "extensions": ["mgp"] + }, + "application/vnd.osgi.bundle": { + "source": "iana" + }, + "application/vnd.osgi.dp": { + "source": "iana", + "extensions": ["dp"] + }, + "application/vnd.osgi.subsystem": { + "source": "iana", + "extensions": ["esa"] + }, + "application/vnd.otps.ct-kip+xml": { + "source": "iana" + }, + "application/vnd.oxli.countgraph": { + "source": "iana" + }, + "application/vnd.pagerduty+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.palm": { + "source": "iana", + "extensions": ["pdb","pqa","oprc"] + }, + "application/vnd.panoply": { + "source": "iana" + }, + "application/vnd.paos+xml": { + "source": "iana" + }, + "application/vnd.paos.xml": { + "source": "apache" + }, + "application/vnd.pawaafile": { + "source": "iana", + "extensions": ["paw"] + }, + "application/vnd.pcos": { + "source": "iana" + }, + "application/vnd.pg.format": { + "source": "iana", + "extensions": ["str"] + }, + "application/vnd.pg.osasli": { + "source": "iana", + "extensions": ["ei6"] + }, + "application/vnd.piaccess.application-licence": { + "source": "iana" + }, + "application/vnd.picsel": { + "source": "iana", + "extensions": ["efif"] + }, + "application/vnd.pmi.widget": { + "source": "iana", + "extensions": ["wg"] + }, + "application/vnd.poc.group-advertisement+xml": { + "source": "iana" + }, + "application/vnd.pocketlearn": { + "source": "iana", + "extensions": ["plf"] + }, + "application/vnd.powerbuilder6": { + "source": "iana", + "extensions": ["pbd"] + }, + "application/vnd.powerbuilder6-s": { + "source": "iana" + }, + "application/vnd.powerbuilder7": { + "source": "iana" + }, + "application/vnd.powerbuilder7-s": { + "source": "iana" + }, + "application/vnd.powerbuilder75": { + "source": "iana" + }, + "application/vnd.powerbuilder75-s": { + "source": "iana" + }, + "application/vnd.preminet": { + "source": "iana" + }, + "application/vnd.previewsystems.box": { + "source": "iana", + "extensions": ["box"] + }, + "application/vnd.proteus.magazine": { + "source": "iana", + "extensions": ["mgz"] + }, + "application/vnd.publishare-delta-tree": { + "source": "iana", + "extensions": ["qps"] + }, + "application/vnd.pvi.ptid1": { + "source": "iana", + "extensions": ["ptid"] + }, + "application/vnd.pwg-multiplexed": { + "source": "iana" + }, + "application/vnd.pwg-xhtml-print+xml": { + "source": "iana" + }, + "application/vnd.qualcomm.brew-app-res": { + "source": "iana" + }, + "application/vnd.quark.quarkxpress": { + "source": "iana", + "extensions": ["qxd","qxt","qwd","qwt","qxl","qxb"] + }, + "application/vnd.quobject-quoxdocument": { + "source": "iana" + }, + "application/vnd.radisys.moml+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-conf+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-conn+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-dialog+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-audit-stream+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-conf+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-base+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-fax-detect+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-group+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-speech+xml": { + "source": "iana" + }, + "application/vnd.radisys.msml-dialog-transform+xml": { + "source": "iana" + }, + "application/vnd.rainstor.data": { + "source": "iana" + }, + "application/vnd.rapid": { + "source": "iana" + }, + "application/vnd.realvnc.bed": { + "source": "iana", + "extensions": ["bed"] + }, + "application/vnd.recordare.musicxml": { + "source": "iana", + "extensions": ["mxl"] + }, + "application/vnd.recordare.musicxml+xml": { + "source": "iana", + "extensions": ["musicxml"] + }, + "application/vnd.renlearn.rlprint": { + "source": "iana" + }, + "application/vnd.rig.cryptonote": { + "source": "iana", + "extensions": ["cryptonote"] + }, + "application/vnd.rim.cod": { + "source": "apache", + "extensions": ["cod"] + }, + "application/vnd.rn-realmedia": { + "source": "apache", + "extensions": ["rm"] + }, + "application/vnd.rn-realmedia-vbr": { + "source": "apache", + "extensions": ["rmvb"] + }, + "application/vnd.route66.link66+xml": { + "source": "iana", + "extensions": ["link66"] + }, + "application/vnd.rs-274x": { + "source": "iana" + }, + "application/vnd.ruckus.download": { + "source": "iana" + }, + "application/vnd.s3sms": { + "source": "iana" + }, + "application/vnd.sailingtracker.track": { + "source": "iana", + "extensions": ["st"] + }, + "application/vnd.sbm.cid": { + "source": "iana" + }, + "application/vnd.sbm.mid2": { + "source": "iana" + }, + "application/vnd.scribus": { + "source": "iana" + }, + "application/vnd.sealed.3df": { + "source": "iana" + }, + "application/vnd.sealed.csf": { + "source": "iana" + }, + "application/vnd.sealed.doc": { + "source": "iana" + }, + "application/vnd.sealed.eml": { + "source": "iana" + }, + "application/vnd.sealed.mht": { + "source": "iana" + }, + "application/vnd.sealed.net": { + "source": "iana" + }, + "application/vnd.sealed.ppt": { + "source": "iana" + }, + "application/vnd.sealed.tiff": { + "source": "iana" + }, + "application/vnd.sealed.xls": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.html": { + "source": "iana" + }, + "application/vnd.sealedmedia.softseal.pdf": { + "source": "iana" + }, + "application/vnd.seemail": { + "source": "iana", + "extensions": ["see"] + }, + "application/vnd.sema": { + "source": "iana", + "extensions": ["sema"] + }, + "application/vnd.semd": { + "source": "iana", + "extensions": ["semd"] + }, + "application/vnd.semf": { + "source": "iana", + "extensions": ["semf"] + }, + "application/vnd.shana.informed.formdata": { + "source": "iana", + "extensions": ["ifm"] + }, + "application/vnd.shana.informed.formtemplate": { + "source": "iana", + "extensions": ["itp"] + }, + "application/vnd.shana.informed.interchange": { + "source": "iana", + "extensions": ["iif"] + }, + "application/vnd.shana.informed.package": { + "source": "iana", + "extensions": ["ipk"] + }, + "application/vnd.simtech-mindmapper": { + "source": "iana", + "extensions": ["twd","twds"] + }, + "application/vnd.siren+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.smaf": { + "source": "iana", + "extensions": ["mmf"] + }, + "application/vnd.smart.notebook": { + "source": "iana" + }, + "application/vnd.smart.teacher": { + "source": "iana", + "extensions": ["teacher"] + }, + "application/vnd.software602.filler.form+xml": { + "source": "iana" + }, + "application/vnd.software602.filler.form-xml-zip": { + "source": "iana" + }, + "application/vnd.solent.sdkm+xml": { + "source": "iana", + "extensions": ["sdkm","sdkd"] + }, + "application/vnd.spotfire.dxp": { + "source": "iana", + "extensions": ["dxp"] + }, + "application/vnd.spotfire.sfs": { + "source": "iana", + "extensions": ["sfs"] + }, + "application/vnd.sss-cod": { + "source": "iana" + }, + "application/vnd.sss-dtf": { + "source": "iana" + }, + "application/vnd.sss-ntf": { + "source": "iana" + }, + "application/vnd.stardivision.calc": { + "source": "apache", + "extensions": ["sdc"] + }, + "application/vnd.stardivision.draw": { + "source": "apache", + "extensions": ["sda"] + }, + "application/vnd.stardivision.impress": { + "source": "apache", + "extensions": ["sdd"] + }, + "application/vnd.stardivision.math": { + "source": "apache", + "extensions": ["smf"] + }, + "application/vnd.stardivision.writer": { + "source": "apache", + "extensions": ["sdw","vor"] + }, + "application/vnd.stardivision.writer-global": { + "source": "apache", + "extensions": ["sgl"] + }, + "application/vnd.stepmania.package": { + "source": "iana", + "extensions": ["smzip"] + }, + "application/vnd.stepmania.stepchart": { + "source": "iana", + "extensions": ["sm"] + }, + "application/vnd.street-stream": { + "source": "iana" + }, + "application/vnd.sun.wadl+xml": { + "source": "iana" + }, + "application/vnd.sun.xml.calc": { + "source": "apache", + "extensions": ["sxc"] + }, + "application/vnd.sun.xml.calc.template": { + "source": "apache", + "extensions": ["stc"] + }, + "application/vnd.sun.xml.draw": { + "source": "apache", + "extensions": ["sxd"] + }, + "application/vnd.sun.xml.draw.template": { + "source": "apache", + "extensions": ["std"] + }, + "application/vnd.sun.xml.impress": { + "source": "apache", + "extensions": ["sxi"] + }, + "application/vnd.sun.xml.impress.template": { + "source": "apache", + "extensions": ["sti"] + }, + "application/vnd.sun.xml.math": { + "source": "apache", + "extensions": ["sxm"] + }, + "application/vnd.sun.xml.writer": { + "source": "apache", + "extensions": ["sxw"] + }, + "application/vnd.sun.xml.writer.global": { + "source": "apache", + "extensions": ["sxg"] + }, + "application/vnd.sun.xml.writer.template": { + "source": "apache", + "extensions": ["stw"] + }, + "application/vnd.sus-calendar": { + "source": "iana", + "extensions": ["sus","susp"] + }, + "application/vnd.svd": { + "source": "iana", + "extensions": ["svd"] + }, + "application/vnd.swiftview-ics": { + "source": "iana" + }, + "application/vnd.symbian.install": { + "source": "apache", + "extensions": ["sis","sisx"] + }, + "application/vnd.syncml+xml": { + "source": "iana", + "extensions": ["xsm"] + }, + "application/vnd.syncml.dm+wbxml": { + "source": "iana", + "extensions": ["bdm"] + }, + "application/vnd.syncml.dm+xml": { + "source": "iana", + "extensions": ["xdm"] + }, + "application/vnd.syncml.dm.notification": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmddf+xml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+wbxml": { + "source": "iana" + }, + "application/vnd.syncml.dmtnds+xml": { + "source": "iana" + }, + "application/vnd.syncml.ds.notification": { + "source": "iana" + }, + "application/vnd.tao.intent-module-archive": { + "source": "iana", + "extensions": ["tao"] + }, + "application/vnd.tcpdump.pcap": { + "source": "iana", + "extensions": ["pcap","cap","dmp"] + }, + "application/vnd.tmd.mediaflex.api+xml": { + "source": "iana" + }, + "application/vnd.tmobile-livetv": { + "source": "iana", + "extensions": ["tmo"] + }, + "application/vnd.trid.tpt": { + "source": "iana", + "extensions": ["tpt"] + }, + "application/vnd.triscape.mxs": { + "source": "iana", + "extensions": ["mxs"] + }, + "application/vnd.trueapp": { + "source": "iana", + "extensions": ["tra"] + }, + "application/vnd.truedoc": { + "source": "iana" + }, + "application/vnd.ubisoft.webplayer": { + "source": "iana" + }, + "application/vnd.ufdl": { + "source": "iana", + "extensions": ["ufd","ufdl"] + }, + "application/vnd.uiq.theme": { + "source": "iana", + "extensions": ["utz"] + }, + "application/vnd.umajin": { + "source": "iana", + "extensions": ["umj"] + }, + "application/vnd.unity": { + "source": "iana", + "extensions": ["unityweb"] + }, + "application/vnd.uoml+xml": { + "source": "iana", + "extensions": ["uoml"] + }, + "application/vnd.uplanet.alert": { + "source": "iana" + }, + "application/vnd.uplanet.alert-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice": { + "source": "iana" + }, + "application/vnd.uplanet.bearer-choice-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop": { + "source": "iana" + }, + "application/vnd.uplanet.cacheop-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.channel": { + "source": "iana" + }, + "application/vnd.uplanet.channel-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.list": { + "source": "iana" + }, + "application/vnd.uplanet.list-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd": { + "source": "iana" + }, + "application/vnd.uplanet.listcmd-wbxml": { + "source": "iana" + }, + "application/vnd.uplanet.signal": { + "source": "iana" + }, + "application/vnd.uri-map": { + "source": "iana" + }, + "application/vnd.valve.source.material": { + "source": "iana" + }, + "application/vnd.vcx": { + "source": "iana", + "extensions": ["vcx"] + }, + "application/vnd.vd-study": { + "source": "iana" + }, + "application/vnd.vectorworks": { + "source": "iana" + }, + "application/vnd.verimatrix.vcas": { + "source": "iana" + }, + "application/vnd.vidsoft.vidconference": { + "source": "iana" + }, + "application/vnd.visio": { + "source": "iana", + "extensions": ["vsd","vst","vss","vsw"] + }, + "application/vnd.visionary": { + "source": "iana", + "extensions": ["vis"] + }, + "application/vnd.vividence.scriptfile": { + "source": "iana" + }, + "application/vnd.vsf": { + "source": "iana", + "extensions": ["vsf"] + }, + "application/vnd.wap.sic": { + "source": "iana" + }, + "application/vnd.wap.slc": { + "source": "iana" + }, + "application/vnd.wap.wbxml": { + "source": "iana", + "extensions": ["wbxml"] + }, + "application/vnd.wap.wmlc": { + "source": "iana", + "extensions": ["wmlc"] + }, + "application/vnd.wap.wmlscriptc": { + "source": "iana", + "extensions": ["wmlsc"] + }, + "application/vnd.webturbo": { + "source": "iana", + "extensions": ["wtb"] + }, + "application/vnd.wfa.p2p": { + "source": "iana" + }, + "application/vnd.wfa.wsc": { + "source": "iana" + }, + "application/vnd.windows.devicepairing": { + "source": "iana" + }, + "application/vnd.wmc": { + "source": "iana" + }, + "application/vnd.wmf.bootstrap": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica": { + "source": "iana" + }, + "application/vnd.wolfram.mathematica.package": { + "source": "iana" + }, + "application/vnd.wolfram.player": { + "source": "iana", + "extensions": ["nbp"] + }, + "application/vnd.wordperfect": { + "source": "iana", + "extensions": ["wpd"] + }, + "application/vnd.wqd": { + "source": "iana", + "extensions": ["wqd"] + }, + "application/vnd.wrq-hp3000-labelled": { + "source": "iana" + }, + "application/vnd.wt.stf": { + "source": "iana", + "extensions": ["stf"] + }, + "application/vnd.wv.csp+wbxml": { + "source": "iana" + }, + "application/vnd.wv.csp+xml": { + "source": "iana" + }, + "application/vnd.wv.ssp+xml": { + "source": "iana" + }, + "application/vnd.xacml+json": { + "source": "iana", + "compressible": true + }, + "application/vnd.xara": { + "source": "iana", + "extensions": ["xar"] + }, + "application/vnd.xfdl": { + "source": "iana", + "extensions": ["xfdl"] + }, + "application/vnd.xfdl.webform": { + "source": "iana" + }, + "application/vnd.xmi+xml": { + "source": "iana" + }, + "application/vnd.xmpie.cpkg": { + "source": "iana" + }, + "application/vnd.xmpie.dpkg": { + "source": "iana" + }, + "application/vnd.xmpie.plan": { + "source": "iana" + }, + "application/vnd.xmpie.ppkg": { + "source": "iana" + }, + "application/vnd.xmpie.xlim": { + "source": "iana" + }, + "application/vnd.yamaha.hv-dic": { + "source": "iana", + "extensions": ["hvd"] + }, + "application/vnd.yamaha.hv-script": { + "source": "iana", + "extensions": ["hvs"] + }, + "application/vnd.yamaha.hv-voice": { + "source": "iana", + "extensions": ["hvp"] + }, + "application/vnd.yamaha.openscoreformat": { + "source": "iana", + "extensions": ["osf"] + }, + "application/vnd.yamaha.openscoreformat.osfpvg+xml": { + "source": "iana", + "extensions": ["osfpvg"] + }, + "application/vnd.yamaha.remote-setup": { + "source": "iana" + }, + "application/vnd.yamaha.smaf-audio": { + "source": "iana", + "extensions": ["saf"] + }, + "application/vnd.yamaha.smaf-phrase": { + "source": "iana", + "extensions": ["spf"] + }, + "application/vnd.yamaha.through-ngn": { + "source": "iana" + }, + "application/vnd.yamaha.tunnel-udpencap": { + "source": "iana" + }, + "application/vnd.yaoweme": { + "source": "iana" + }, + "application/vnd.yellowriver-custom-menu": { + "source": "iana", + "extensions": ["cmp"] + }, + "application/vnd.zul": { + "source": "iana", + "extensions": ["zir","zirz"] + }, + "application/vnd.zzazz.deck+xml": { + "source": "iana", + "extensions": ["zaz"] + }, + "application/voicexml+xml": { + "source": "iana", + "extensions": ["vxml"] + }, + "application/vq-rtcpxr": { + "source": "iana" + }, + "application/watcherinfo+xml": { + "source": "iana" + }, + "application/whoispp-query": { + "source": "iana" + }, + "application/whoispp-response": { + "source": "iana" + }, + "application/widget": { + "source": "iana", + "extensions": ["wgt"] + }, + "application/winhlp": { + "source": "apache", + "extensions": ["hlp"] + }, + "application/wita": { + "source": "iana" + }, + "application/wordperfect5.1": { + "source": "iana" + }, + "application/wsdl+xml": { + "source": "iana", + "extensions": ["wsdl"] + }, + "application/wspolicy+xml": { + "source": "iana", + "extensions": ["wspolicy"] + }, + "application/x-7z-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["7z"] + }, + "application/x-abiword": { + "source": "apache", + "extensions": ["abw"] + }, + "application/x-ace-compressed": { + "source": "apache", + "extensions": ["ace"] + }, + "application/x-amf": { + "source": "apache" + }, + "application/x-apple-diskimage": { + "source": "apache", + "extensions": ["dmg"] + }, + "application/x-authorware-bin": { + "source": "apache", + "extensions": ["aab","x32","u32","vox"] + }, + "application/x-authorware-map": { + "source": "apache", + "extensions": ["aam"] + }, + "application/x-authorware-seg": { + "source": "apache", + "extensions": ["aas"] + }, + "application/x-bcpio": { + "source": "apache", + "extensions": ["bcpio"] + }, + "application/x-bdoc": { + "compressible": false, + "extensions": ["bdoc"] + }, + "application/x-bittorrent": { + "source": "apache", + "extensions": ["torrent"] + }, + "application/x-blorb": { + "source": "apache", + "extensions": ["blb","blorb"] + }, + "application/x-bzip": { + "source": "apache", + "compressible": false, + "extensions": ["bz"] + }, + "application/x-bzip2": { + "source": "apache", + "compressible": false, + "extensions": ["bz2","boz"] + }, + "application/x-cbr": { + "source": "apache", + "extensions": ["cbr","cba","cbt","cbz","cb7"] + }, + "application/x-cdlink": { + "source": "apache", + "extensions": ["vcd"] + }, + "application/x-cfs-compressed": { + "source": "apache", + "extensions": ["cfs"] + }, + "application/x-chat": { + "source": "apache", + "extensions": ["chat"] + }, + "application/x-chess-pgn": { + "source": "apache", + "extensions": ["pgn"] + }, + "application/x-chrome-extension": { + "extensions": ["crx"] + }, + "application/x-cocoa": { + "source": "nginx", + "extensions": ["cco"] + }, + "application/x-compress": { + "source": "apache" + }, + "application/x-conference": { + "source": "apache", + "extensions": ["nsc"] + }, + "application/x-cpio": { + "source": "apache", + "extensions": ["cpio"] + }, + "application/x-csh": { + "source": "apache", + "extensions": ["csh"] + }, + "application/x-deb": { + "compressible": false + }, + "application/x-debian-package": { + "source": "apache", + "extensions": ["deb","udeb"] + }, + "application/x-dgc-compressed": { + "source": "apache", + "extensions": ["dgc"] + }, + "application/x-director": { + "source": "apache", + "extensions": ["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"] + }, + "application/x-doom": { + "source": "apache", + "extensions": ["wad"] + }, + "application/x-dtbncx+xml": { + "source": "apache", + "extensions": ["ncx"] + }, + "application/x-dtbook+xml": { + "source": "apache", + "extensions": ["dtb"] + }, + "application/x-dtbresource+xml": { + "source": "apache", + "extensions": ["res"] + }, + "application/x-dvi": { + "source": "apache", + "compressible": false, + "extensions": ["dvi"] + }, + "application/x-envoy": { + "source": "apache", + "extensions": ["evy"] + }, + "application/x-eva": { + "source": "apache", + "extensions": ["eva"] + }, + "application/x-font-bdf": { + "source": "apache", + "extensions": ["bdf"] + }, + "application/x-font-dos": { + "source": "apache" + }, + "application/x-font-framemaker": { + "source": "apache" + }, + "application/x-font-ghostscript": { + "source": "apache", + "extensions": ["gsf"] + }, + "application/x-font-libgrx": { + "source": "apache" + }, + "application/x-font-linux-psf": { + "source": "apache", + "extensions": ["psf"] + }, + "application/x-font-otf": { + "source": "apache", + "compressible": true, + "extensions": ["otf"] + }, + "application/x-font-pcf": { + "source": "apache", + "extensions": ["pcf"] + }, + "application/x-font-snf": { + "source": "apache", + "extensions": ["snf"] + }, + "application/x-font-speedo": { + "source": "apache" + }, + "application/x-font-sunos-news": { + "source": "apache" + }, + "application/x-font-ttf": { + "source": "apache", + "compressible": true, + "extensions": ["ttf","ttc"] + }, + "application/x-font-type1": { + "source": "apache", + "extensions": ["pfa","pfb","pfm","afm"] + }, + "application/x-font-vfont": { + "source": "apache" + }, + "application/x-freearc": { + "source": "apache", + "extensions": ["arc"] + }, + "application/x-futuresplash": { + "source": "apache", + "extensions": ["spl"] + }, + "application/x-gca-compressed": { + "source": "apache", + "extensions": ["gca"] + }, + "application/x-glulx": { + "source": "apache", + "extensions": ["ulx"] + }, + "application/x-gnumeric": { + "source": "apache", + "extensions": ["gnumeric"] + }, + "application/x-gramps-xml": { + "source": "apache", + "extensions": ["gramps"] + }, + "application/x-gtar": { + "source": "apache", + "extensions": ["gtar"] + }, + "application/x-gzip": { + "source": "apache" + }, + "application/x-hdf": { + "source": "apache", + "extensions": ["hdf"] + }, + "application/x-httpd-php": { + "compressible": true, + "extensions": ["php"] + }, + "application/x-install-instructions": { + "source": "apache", + "extensions": ["install"] + }, + "application/x-iso9660-image": { + "source": "apache", + "extensions": ["iso"] + }, + "application/x-java-archive-diff": { + "source": "nginx", + "extensions": ["jardiff"] + }, + "application/x-java-jnlp-file": { + "source": "apache", + "compressible": false, + "extensions": ["jnlp"] + }, + "application/x-javascript": { + "compressible": true + }, + "application/x-latex": { + "source": "apache", + "compressible": false, + "extensions": ["latex"] + }, + "application/x-lua-bytecode": { + "extensions": ["luac"] + }, + "application/x-lzh-compressed": { + "source": "apache", + "extensions": ["lzh","lha"] + }, + "application/x-makeself": { + "source": "nginx", + "extensions": ["run"] + }, + "application/x-mie": { + "source": "apache", + "extensions": ["mie"] + }, + "application/x-mobipocket-ebook": { + "source": "apache", + "extensions": ["prc","mobi"] + }, + "application/x-mpegurl": { + "compressible": false + }, + "application/x-ms-application": { + "source": "apache", + "extensions": ["application"] + }, + "application/x-ms-shortcut": { + "source": "apache", + "extensions": ["lnk"] + }, + "application/x-ms-wmd": { + "source": "apache", + "extensions": ["wmd"] + }, + "application/x-ms-wmz": { + "source": "apache", + "extensions": ["wmz"] + }, + "application/x-ms-xbap": { + "source": "apache", + "extensions": ["xbap"] + }, + "application/x-msaccess": { + "source": "apache", + "extensions": ["mdb"] + }, + "application/x-msbinder": { + "source": "apache", + "extensions": ["obd"] + }, + "application/x-mscardfile": { + "source": "apache", + "extensions": ["crd"] + }, + "application/x-msclip": { + "source": "apache", + "extensions": ["clp"] + }, + "application/x-msdos-program": { + "extensions": ["exe"] + }, + "application/x-msdownload": { + "source": "apache", + "extensions": ["exe","dll","com","bat","msi"] + }, + "application/x-msmediaview": { + "source": "apache", + "extensions": ["mvb","m13","m14"] + }, + "application/x-msmetafile": { + "source": "apache", + "extensions": ["wmf","wmz","emf","emz"] + }, + "application/x-msmoney": { + "source": "apache", + "extensions": ["mny"] + }, + "application/x-mspublisher": { + "source": "apache", + "extensions": ["pub"] + }, + "application/x-msschedule": { + "source": "apache", + "extensions": ["scd"] + }, + "application/x-msterminal": { + "source": "apache", + "extensions": ["trm"] + }, + "application/x-mswrite": { + "source": "apache", + "extensions": ["wri"] + }, + "application/x-netcdf": { + "source": "apache", + "extensions": ["nc","cdf"] + }, + "application/x-ns-proxy-autoconfig": { + "compressible": true, + "extensions": ["pac"] + }, + "application/x-nzb": { + "source": "apache", + "extensions": ["nzb"] + }, + "application/x-perl": { + "source": "nginx", + "extensions": ["pl","pm"] + }, + "application/x-pilot": { + "source": "nginx", + "extensions": ["prc","pdb"] + }, + "application/x-pkcs12": { + "source": "apache", + "compressible": false, + "extensions": ["p12","pfx"] + }, + "application/x-pkcs7-certificates": { + "source": "apache", + "extensions": ["p7b","spc"] + }, + "application/x-pkcs7-certreqresp": { + "source": "apache", + "extensions": ["p7r"] + }, + "application/x-rar-compressed": { + "source": "apache", + "compressible": false, + "extensions": ["rar"] + }, + "application/x-redhat-package-manager": { + "source": "nginx", + "extensions": ["rpm"] + }, + "application/x-research-info-systems": { + "source": "apache", + "extensions": ["ris"] + }, + "application/x-sea": { + "source": "nginx", + "extensions": ["sea"] + }, + "application/x-sh": { + "source": "apache", + "compressible": true, + "extensions": ["sh"] + }, + "application/x-shar": { + "source": "apache", + "extensions": ["shar"] + }, + "application/x-shockwave-flash": { + "source": "apache", + "compressible": false, + "extensions": ["swf"] + }, + "application/x-silverlight-app": { + "source": "apache", + "extensions": ["xap"] + }, + "application/x-sql": { + "source": "apache", + "extensions": ["sql"] + }, + "application/x-stuffit": { + "source": "apache", + "compressible": false, + "extensions": ["sit"] + }, + "application/x-stuffitx": { + "source": "apache", + "extensions": ["sitx"] + }, + "application/x-subrip": { + "source": "apache", + "extensions": ["srt"] + }, + "application/x-sv4cpio": { + "source": "apache", + "extensions": ["sv4cpio"] + }, + "application/x-sv4crc": { + "source": "apache", + "extensions": ["sv4crc"] + }, + "application/x-t3vm-image": { + "source": "apache", + "extensions": ["t3"] + }, + "application/x-tads": { + "source": "apache", + "extensions": ["gam"] + }, + "application/x-tar": { + "source": "apache", + "compressible": true, + "extensions": ["tar"] + }, + "application/x-tcl": { + "source": "apache", + "extensions": ["tcl","tk"] + }, + "application/x-tex": { + "source": "apache", + "extensions": ["tex"] + }, + "application/x-tex-tfm": { + "source": "apache", + "extensions": ["tfm"] + }, + "application/x-texinfo": { + "source": "apache", + "extensions": ["texinfo","texi"] + }, + "application/x-tgif": { + "source": "apache", + "extensions": ["obj"] + }, + "application/x-ustar": { + "source": "apache", + "extensions": ["ustar"] + }, + "application/x-wais-source": { + "source": "apache", + "extensions": ["src"] + }, + "application/x-web-app-manifest+json": { + "compressible": true, + "extensions": ["webapp"] + }, + "application/x-www-form-urlencoded": { + "source": "iana", + "compressible": true + }, + "application/x-x509-ca-cert": { + "source": "apache", + "extensions": ["der","crt","pem"] + }, + "application/x-xfig": { + "source": "apache", + "extensions": ["fig"] + }, + "application/x-xliff+xml": { + "source": "apache", + "extensions": ["xlf"] + }, + "application/x-xpinstall": { + "source": "apache", + "compressible": false, + "extensions": ["xpi"] + }, + "application/x-xz": { + "source": "apache", + "extensions": ["xz"] + }, + "application/x-zmachine": { + "source": "apache", + "extensions": ["z1","z2","z3","z4","z5","z6","z7","z8"] + }, + "application/x400-bp": { + "source": "iana" + }, + "application/xacml+xml": { + "source": "iana" + }, + "application/xaml+xml": { + "source": "apache", + "extensions": ["xaml"] + }, + "application/xcap-att+xml": { + "source": "iana" + }, + "application/xcap-caps+xml": { + "source": "iana" + }, + "application/xcap-diff+xml": { + "source": "iana", + "extensions": ["xdf"] + }, + "application/xcap-el+xml": { + "source": "iana" + }, + "application/xcap-error+xml": { + "source": "iana" + }, + "application/xcap-ns+xml": { + "source": "iana" + }, + "application/xcon-conference-info+xml": { + "source": "iana" + }, + "application/xcon-conference-info-diff+xml": { + "source": "iana" + }, + "application/xenc+xml": { + "source": "iana", + "extensions": ["xenc"] + }, + "application/xhtml+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xhtml","xht"] + }, + "application/xhtml-voice+xml": { + "source": "apache" + }, + "application/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml","xsl","xsd"] + }, + "application/xml-dtd": { + "source": "iana", + "compressible": true, + "extensions": ["dtd"] + }, + "application/xml-external-parsed-entity": { + "source": "iana" + }, + "application/xml-patch+xml": { + "source": "iana" + }, + "application/xmpp+xml": { + "source": "iana" + }, + "application/xop+xml": { + "source": "iana", + "compressible": true, + "extensions": ["xop"] + }, + "application/xproc+xml": { + "source": "apache", + "extensions": ["xpl"] + }, + "application/xslt+xml": { + "source": "iana", + "extensions": ["xslt"] + }, + "application/xspf+xml": { + "source": "apache", + "extensions": ["xspf"] + }, + "application/xv+xml": { + "source": "iana", + "extensions": ["mxml","xhvml","xvml","xvm"] + }, + "application/yang": { + "source": "iana", + "extensions": ["yang"] + }, + "application/yin+xml": { + "source": "iana", + "extensions": ["yin"] + }, + "application/zip": { + "source": "iana", + "compressible": false, + "extensions": ["zip"] + }, + "application/zlib": { + "source": "iana" + }, + "audio/1d-interleaved-parityfec": { + "source": "iana" + }, + "audio/32kadpcm": { + "source": "iana" + }, + "audio/3gpp": { + "source": "iana" + }, + "audio/3gpp2": { + "source": "iana" + }, + "audio/ac3": { + "source": "iana" + }, + "audio/adpcm": { + "source": "apache", + "extensions": ["adp"] + }, + "audio/amr": { + "source": "iana" + }, + "audio/amr-wb": { + "source": "iana" + }, + "audio/amr-wb+": { + "source": "iana" + }, + "audio/aptx": { + "source": "iana" + }, + "audio/asc": { + "source": "iana" + }, + "audio/atrac-advanced-lossless": { + "source": "iana" + }, + "audio/atrac-x": { + "source": "iana" + }, + "audio/atrac3": { + "source": "iana" + }, + "audio/basic": { + "source": "iana", + "compressible": false, + "extensions": ["au","snd"] + }, + "audio/bv16": { + "source": "iana" + }, + "audio/bv32": { + "source": "iana" + }, + "audio/clearmode": { + "source": "iana" + }, + "audio/cn": { + "source": "iana" + }, + "audio/dat12": { + "source": "iana" + }, + "audio/dls": { + "source": "iana" + }, + "audio/dsr-es201108": { + "source": "iana" + }, + "audio/dsr-es202050": { + "source": "iana" + }, + "audio/dsr-es202211": { + "source": "iana" + }, + "audio/dsr-es202212": { + "source": "iana" + }, + "audio/dv": { + "source": "iana" + }, + "audio/dvi4": { + "source": "iana" + }, + "audio/eac3": { + "source": "iana" + }, + "audio/encaprtp": { + "source": "iana" + }, + "audio/evrc": { + "source": "iana" + }, + "audio/evrc-qcp": { + "source": "iana" + }, + "audio/evrc0": { + "source": "iana" + }, + "audio/evrc1": { + "source": "iana" + }, + "audio/evrcb": { + "source": "iana" + }, + "audio/evrcb0": { + "source": "iana" + }, + "audio/evrcb1": { + "source": "iana" + }, + "audio/evrcnw": { + "source": "iana" + }, + "audio/evrcnw0": { + "source": "iana" + }, + "audio/evrcnw1": { + "source": "iana" + }, + "audio/evrcwb": { + "source": "iana" + }, + "audio/evrcwb0": { + "source": "iana" + }, + "audio/evrcwb1": { + "source": "iana" + }, + "audio/fwdred": { + "source": "iana" + }, + "audio/g711-0": { + "source": "iana" + }, + "audio/g719": { + "source": "iana" + }, + "audio/g722": { + "source": "iana" + }, + "audio/g7221": { + "source": "iana" + }, + "audio/g723": { + "source": "iana" + }, + "audio/g726-16": { + "source": "iana" + }, + "audio/g726-24": { + "source": "iana" + }, + "audio/g726-32": { + "source": "iana" + }, + "audio/g726-40": { + "source": "iana" + }, + "audio/g728": { + "source": "iana" + }, + "audio/g729": { + "source": "iana" + }, + "audio/g7291": { + "source": "iana" + }, + "audio/g729d": { + "source": "iana" + }, + "audio/g729e": { + "source": "iana" + }, + "audio/gsm": { + "source": "iana" + }, + "audio/gsm-efr": { + "source": "iana" + }, + "audio/gsm-hr-08": { + "source": "iana" + }, + "audio/ilbc": { + "source": "iana" + }, + "audio/ip-mr_v2.5": { + "source": "iana" + }, + "audio/isac": { + "source": "apache" + }, + "audio/l16": { + "source": "iana" + }, + "audio/l20": { + "source": "iana" + }, + "audio/l24": { + "source": "iana", + "compressible": false + }, + "audio/l8": { + "source": "iana" + }, + "audio/lpc": { + "source": "iana" + }, + "audio/midi": { + "source": "apache", + "extensions": ["mid","midi","kar","rmi"] + }, + "audio/mobile-xmf": { + "source": "iana" + }, + "audio/mp4": { + "source": "iana", + "compressible": false, + "extensions": ["mp4a","m4a"] + }, + "audio/mp4a-latm": { + "source": "iana" + }, + "audio/mpa": { + "source": "iana" + }, + "audio/mpa-robust": { + "source": "iana" + }, + "audio/mpeg": { + "source": "iana", + "compressible": false, + "extensions": ["mpga","mp2","mp2a","mp3","m2a","m3a"] + }, + "audio/mpeg4-generic": { + "source": "iana" + }, + "audio/musepack": { + "source": "apache" + }, + "audio/ogg": { + "source": "iana", + "compressible": false, + "extensions": ["oga","ogg","spx"] + }, + "audio/opus": { + "source": "iana" + }, + "audio/parityfec": { + "source": "iana" + }, + "audio/pcma": { + "source": "iana" + }, + "audio/pcma-wb": { + "source": "iana" + }, + "audio/pcmu": { + "source": "iana" + }, + "audio/pcmu-wb": { + "source": "iana" + }, + "audio/prs.sid": { + "source": "iana" + }, + "audio/qcelp": { + "source": "iana" + }, + "audio/raptorfec": { + "source": "iana" + }, + "audio/red": { + "source": "iana" + }, + "audio/rtp-enc-aescm128": { + "source": "iana" + }, + "audio/rtp-midi": { + "source": "iana" + }, + "audio/rtploopback": { + "source": "iana" + }, + "audio/rtx": { + "source": "iana" + }, + "audio/s3m": { + "source": "apache", + "extensions": ["s3m"] + }, + "audio/silk": { + "source": "apache", + "extensions": ["sil"] + }, + "audio/smv": { + "source": "iana" + }, + "audio/smv-qcp": { + "source": "iana" + }, + "audio/smv0": { + "source": "iana" + }, + "audio/sp-midi": { + "source": "iana" + }, + "audio/speex": { + "source": "iana" + }, + "audio/t140c": { + "source": "iana" + }, + "audio/t38": { + "source": "iana" + }, + "audio/telephone-event": { + "source": "iana" + }, + "audio/tone": { + "source": "iana" + }, + "audio/uemclip": { + "source": "iana" + }, + "audio/ulpfec": { + "source": "iana" + }, + "audio/vdvi": { + "source": "iana" + }, + "audio/vmr-wb": { + "source": "iana" + }, + "audio/vnd.3gpp.iufp": { + "source": "iana" + }, + "audio/vnd.4sb": { + "source": "iana" + }, + "audio/vnd.audiokoz": { + "source": "iana" + }, + "audio/vnd.celp": { + "source": "iana" + }, + "audio/vnd.cisco.nse": { + "source": "iana" + }, + "audio/vnd.cmles.radio-events": { + "source": "iana" + }, + "audio/vnd.cns.anp1": { + "source": "iana" + }, + "audio/vnd.cns.inf1": { + "source": "iana" + }, + "audio/vnd.dece.audio": { + "source": "iana", + "extensions": ["uva","uvva"] + }, + "audio/vnd.digital-winds": { + "source": "iana", + "extensions": ["eol"] + }, + "audio/vnd.dlna.adts": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.1": { + "source": "iana" + }, + "audio/vnd.dolby.heaac.2": { + "source": "iana" + }, + "audio/vnd.dolby.mlp": { + "source": "iana" + }, + "audio/vnd.dolby.mps": { + "source": "iana" + }, + "audio/vnd.dolby.pl2": { + "source": "iana" + }, + "audio/vnd.dolby.pl2x": { + "source": "iana" + }, + "audio/vnd.dolby.pl2z": { + "source": "iana" + }, + "audio/vnd.dolby.pulse.1": { + "source": "iana" + }, + "audio/vnd.dra": { + "source": "iana", + "extensions": ["dra"] + }, + "audio/vnd.dts": { + "source": "iana", + "extensions": ["dts"] + }, + "audio/vnd.dts.hd": { + "source": "iana", + "extensions": ["dtshd"] + }, + "audio/vnd.dvb.file": { + "source": "iana" + }, + "audio/vnd.everad.plj": { + "source": "iana" + }, + "audio/vnd.hns.audio": { + "source": "iana" + }, + "audio/vnd.lucent.voice": { + "source": "iana", + "extensions": ["lvp"] + }, + "audio/vnd.ms-playready.media.pya": { + "source": "iana", + "extensions": ["pya"] + }, + "audio/vnd.nokia.mobile-xmf": { + "source": "iana" + }, + "audio/vnd.nortel.vbk": { + "source": "iana" + }, + "audio/vnd.nuera.ecelp4800": { + "source": "iana", + "extensions": ["ecelp4800"] + }, + "audio/vnd.nuera.ecelp7470": { + "source": "iana", + "extensions": ["ecelp7470"] + }, + "audio/vnd.nuera.ecelp9600": { + "source": "iana", + "extensions": ["ecelp9600"] + }, + "audio/vnd.octel.sbc": { + "source": "iana" + }, + "audio/vnd.qcelp": { + "source": "iana" + }, + "audio/vnd.rhetorex.32kadpcm": { + "source": "iana" + }, + "audio/vnd.rip": { + "source": "iana", + "extensions": ["rip"] + }, + "audio/vnd.rn-realaudio": { + "compressible": false + }, + "audio/vnd.sealedmedia.softseal.mpeg": { + "source": "iana" + }, + "audio/vnd.vmx.cvsd": { + "source": "iana" + }, + "audio/vnd.wave": { + "compressible": false + }, + "audio/vorbis": { + "source": "iana", + "compressible": false + }, + "audio/vorbis-config": { + "source": "iana" + }, + "audio/wav": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/wave": { + "compressible": false, + "extensions": ["wav"] + }, + "audio/webm": { + "source": "apache", + "compressible": false, + "extensions": ["weba"] + }, + "audio/x-aac": { + "source": "apache", + "compressible": false, + "extensions": ["aac"] + }, + "audio/x-aiff": { + "source": "apache", + "extensions": ["aif","aiff","aifc"] + }, + "audio/x-caf": { + "source": "apache", + "compressible": false, + "extensions": ["caf"] + }, + "audio/x-flac": { + "source": "apache", + "extensions": ["flac"] + }, + "audio/x-m4a": { + "source": "nginx", + "extensions": ["m4a"] + }, + "audio/x-matroska": { + "source": "apache", + "extensions": ["mka"] + }, + "audio/x-mpegurl": { + "source": "apache", + "extensions": ["m3u"] + }, + "audio/x-ms-wax": { + "source": "apache", + "extensions": ["wax"] + }, + "audio/x-ms-wma": { + "source": "apache", + "extensions": ["wma"] + }, + "audio/x-pn-realaudio": { + "source": "apache", + "extensions": ["ram","ra"] + }, + "audio/x-pn-realaudio-plugin": { + "source": "apache", + "extensions": ["rmp"] + }, + "audio/x-realaudio": { + "source": "nginx", + "extensions": ["ra"] + }, + "audio/x-tta": { + "source": "apache" + }, + "audio/x-wav": { + "source": "apache", + "extensions": ["wav"] + }, + "audio/xm": { + "source": "apache", + "extensions": ["xm"] + }, + "chemical/x-cdx": { + "source": "apache", + "extensions": ["cdx"] + }, + "chemical/x-cif": { + "source": "apache", + "extensions": ["cif"] + }, + "chemical/x-cmdf": { + "source": "apache", + "extensions": ["cmdf"] + }, + "chemical/x-cml": { + "source": "apache", + "extensions": ["cml"] + }, + "chemical/x-csml": { + "source": "apache", + "extensions": ["csml"] + }, + "chemical/x-pdb": { + "source": "apache" + }, + "chemical/x-xyz": { + "source": "apache", + "extensions": ["xyz"] + }, + "font/opentype": { + "compressible": true, + "extensions": ["otf"] + }, + "image/bmp": { + "source": "apache", + "compressible": true, + "extensions": ["bmp"] + }, + "image/cgm": { + "source": "iana", + "extensions": ["cgm"] + }, + "image/fits": { + "source": "iana" + }, + "image/g3fax": { + "source": "iana", + "extensions": ["g3"] + }, + "image/gif": { + "source": "iana", + "compressible": false, + "extensions": ["gif"] + }, + "image/ief": { + "source": "iana", + "extensions": ["ief"] + }, + "image/jp2": { + "source": "iana" + }, + "image/jpeg": { + "source": "iana", + "compressible": false, + "extensions": ["jpeg","jpg","jpe"] + }, + "image/jpm": { + "source": "iana" + }, + "image/jpx": { + "source": "iana" + }, + "image/ktx": { + "source": "iana", + "extensions": ["ktx"] + }, + "image/naplps": { + "source": "iana" + }, + "image/pjpeg": { + "compressible": false + }, + "image/png": { + "source": "iana", + "compressible": false, + "extensions": ["png"] + }, + "image/prs.btif": { + "source": "iana", + "extensions": ["btif"] + }, + "image/prs.pti": { + "source": "iana" + }, + "image/pwg-raster": { + "source": "iana" + }, + "image/sgi": { + "source": "apache", + "extensions": ["sgi"] + }, + "image/svg+xml": { + "source": "iana", + "compressible": true, + "extensions": ["svg","svgz"] + }, + "image/t38": { + "source": "iana" + }, + "image/tiff": { + "source": "iana", + "compressible": false, + "extensions": ["tiff","tif"] + }, + "image/tiff-fx": { + "source": "iana" + }, + "image/vnd.adobe.photoshop": { + "source": "iana", + "compressible": true, + "extensions": ["psd"] + }, + "image/vnd.airzip.accelerator.azv": { + "source": "iana" + }, + "image/vnd.cns.inf2": { + "source": "iana" + }, + "image/vnd.dece.graphic": { + "source": "iana", + "extensions": ["uvi","uvvi","uvg","uvvg"] + }, + "image/vnd.djvu": { + "source": "iana", + "extensions": ["djvu","djv"] + }, + "image/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "image/vnd.dwg": { + "source": "iana", + "extensions": ["dwg"] + }, + "image/vnd.dxf": { + "source": "iana", + "extensions": ["dxf"] + }, + "image/vnd.fastbidsheet": { + "source": "iana", + "extensions": ["fbs"] + }, + "image/vnd.fpx": { + "source": "iana", + "extensions": ["fpx"] + }, + "image/vnd.fst": { + "source": "iana", + "extensions": ["fst"] + }, + "image/vnd.fujixerox.edmics-mmr": { + "source": "iana", + "extensions": ["mmr"] + }, + "image/vnd.fujixerox.edmics-rlc": { + "source": "iana", + "extensions": ["rlc"] + }, + "image/vnd.globalgraphics.pgb": { + "source": "iana" + }, + "image/vnd.microsoft.icon": { + "source": "iana" + }, + "image/vnd.mix": { + "source": "iana" + }, + "image/vnd.mozilla.apng": { + "source": "iana" + }, + "image/vnd.ms-modi": { + "source": "iana", + "extensions": ["mdi"] + }, + "image/vnd.ms-photo": { + "source": "apache", + "extensions": ["wdp"] + }, + "image/vnd.net-fpx": { + "source": "iana", + "extensions": ["npx"] + }, + "image/vnd.radiance": { + "source": "iana" + }, + "image/vnd.sealed.png": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.gif": { + "source": "iana" + }, + "image/vnd.sealedmedia.softseal.jpg": { + "source": "iana" + }, + "image/vnd.svf": { + "source": "iana" + }, + "image/vnd.tencent.tap": { + "source": "iana" + }, + "image/vnd.valve.source.texture": { + "source": "iana" + }, + "image/vnd.wap.wbmp": { + "source": "iana", + "extensions": ["wbmp"] + }, + "image/vnd.xiff": { + "source": "iana", + "extensions": ["xif"] + }, + "image/vnd.zbrush.pcx": { + "source": "iana" + }, + "image/webp": { + "source": "apache", + "extensions": ["webp"] + }, + "image/x-3ds": { + "source": "apache", + "extensions": ["3ds"] + }, + "image/x-cmu-raster": { + "source": "apache", + "extensions": ["ras"] + }, + "image/x-cmx": { + "source": "apache", + "extensions": ["cmx"] + }, + "image/x-freehand": { + "source": "apache", + "extensions": ["fh","fhc","fh4","fh5","fh7"] + }, + "image/x-icon": { + "source": "apache", + "compressible": true, + "extensions": ["ico"] + }, + "image/x-jng": { + "source": "nginx", + "extensions": ["jng"] + }, + "image/x-mrsid-image": { + "source": "apache", + "extensions": ["sid"] + }, + "image/x-ms-bmp": { + "source": "nginx", + "compressible": true, + "extensions": ["bmp"] + }, + "image/x-pcx": { + "source": "apache", + "extensions": ["pcx"] + }, + "image/x-pict": { + "source": "apache", + "extensions": ["pic","pct"] + }, + "image/x-portable-anymap": { + "source": "apache", + "extensions": ["pnm"] + }, + "image/x-portable-bitmap": { + "source": "apache", + "extensions": ["pbm"] + }, + "image/x-portable-graymap": { + "source": "apache", + "extensions": ["pgm"] + }, + "image/x-portable-pixmap": { + "source": "apache", + "extensions": ["ppm"] + }, + "image/x-rgb": { + "source": "apache", + "extensions": ["rgb"] + }, + "image/x-tga": { + "source": "apache", + "extensions": ["tga"] + }, + "image/x-xbitmap": { + "source": "apache", + "extensions": ["xbm"] + }, + "image/x-xcf": { + "compressible": false + }, + "image/x-xpixmap": { + "source": "apache", + "extensions": ["xpm"] + }, + "image/x-xwindowdump": { + "source": "apache", + "extensions": ["xwd"] + }, + "message/cpim": { + "source": "iana" + }, + "message/delivery-status": { + "source": "iana" + }, + "message/disposition-notification": { + "source": "iana" + }, + "message/external-body": { + "source": "iana" + }, + "message/feedback-report": { + "source": "iana" + }, + "message/global": { + "source": "iana" + }, + "message/global-delivery-status": { + "source": "iana" + }, + "message/global-disposition-notification": { + "source": "iana" + }, + "message/global-headers": { + "source": "iana" + }, + "message/http": { + "source": "iana", + "compressible": false + }, + "message/imdn+xml": { + "source": "iana", + "compressible": true + }, + "message/news": { + "source": "iana" + }, + "message/partial": { + "source": "iana", + "compressible": false + }, + "message/rfc822": { + "source": "iana", + "compressible": true, + "extensions": ["eml","mime"] + }, + "message/s-http": { + "source": "iana" + }, + "message/sip": { + "source": "iana" + }, + "message/sipfrag": { + "source": "iana" + }, + "message/tracking-status": { + "source": "iana" + }, + "message/vnd.si.simp": { + "source": "iana" + }, + "message/vnd.wfa.wsc": { + "source": "iana" + }, + "model/iges": { + "source": "iana", + "compressible": false, + "extensions": ["igs","iges"] + }, + "model/mesh": { + "source": "iana", + "compressible": false, + "extensions": ["msh","mesh","silo"] + }, + "model/vnd.collada+xml": { + "source": "iana", + "extensions": ["dae"] + }, + "model/vnd.dwf": { + "source": "iana", + "extensions": ["dwf"] + }, + "model/vnd.flatland.3dml": { + "source": "iana" + }, + "model/vnd.gdl": { + "source": "iana", + "extensions": ["gdl"] + }, + "model/vnd.gs-gdl": { + "source": "apache" + }, + "model/vnd.gs.gdl": { + "source": "iana" + }, + "model/vnd.gtw": { + "source": "iana", + "extensions": ["gtw"] + }, + "model/vnd.moml+xml": { + "source": "iana" + }, + "model/vnd.mts": { + "source": "iana", + "extensions": ["mts"] + }, + "model/vnd.opengex": { + "source": "iana" + }, + "model/vnd.parasolid.transmit.binary": { + "source": "iana" + }, + "model/vnd.parasolid.transmit.text": { + "source": "iana" + }, + "model/vnd.valve.source.compiled-map": { + "source": "iana" + }, + "model/vnd.vtu": { + "source": "iana", + "extensions": ["vtu"] + }, + "model/vrml": { + "source": "iana", + "compressible": false, + "extensions": ["wrl","vrml"] + }, + "model/x3d+binary": { + "source": "apache", + "compressible": false, + "extensions": ["x3db","x3dbz"] + }, + "model/x3d+fastinfoset": { + "source": "iana" + }, + "model/x3d+vrml": { + "source": "apache", + "compressible": false, + "extensions": ["x3dv","x3dvz"] + }, + "model/x3d+xml": { + "source": "iana", + "compressible": true, + "extensions": ["x3d","x3dz"] + }, + "model/x3d-vrml": { + "source": "iana" + }, + "multipart/alternative": { + "source": "iana", + "compressible": false + }, + "multipart/appledouble": { + "source": "iana" + }, + "multipart/byteranges": { + "source": "iana" + }, + "multipart/digest": { + "source": "iana" + }, + "multipart/encrypted": { + "source": "iana", + "compressible": false + }, + "multipart/form-data": { + "source": "iana", + "compressible": false + }, + "multipart/header-set": { + "source": "iana" + }, + "multipart/mixed": { + "source": "iana", + "compressible": false + }, + "multipart/parallel": { + "source": "iana" + }, + "multipart/related": { + "source": "iana", + "compressible": false + }, + "multipart/report": { + "source": "iana" + }, + "multipart/signed": { + "source": "iana", + "compressible": false + }, + "multipart/voice-message": { + "source": "iana" + }, + "multipart/x-mixed-replace": { + "source": "iana" + }, + "text/1d-interleaved-parityfec": { + "source": "iana" + }, + "text/cache-manifest": { + "source": "iana", + "compressible": true, + "extensions": ["appcache","manifest"] + }, + "text/calendar": { + "source": "iana", + "extensions": ["ics","ifb"] + }, + "text/calender": { + "compressible": true + }, + "text/cmd": { + "compressible": true + }, + "text/coffeescript": { + "extensions": ["coffee","litcoffee"] + }, + "text/css": { + "source": "iana", + "compressible": true, + "extensions": ["css"] + }, + "text/csv": { + "source": "iana", + "compressible": true, + "extensions": ["csv"] + }, + "text/csv-schema": { + "source": "iana" + }, + "text/directory": { + "source": "iana" + }, + "text/dns": { + "source": "iana" + }, + "text/ecmascript": { + "source": "iana" + }, + "text/encaprtp": { + "source": "iana" + }, + "text/enriched": { + "source": "iana" + }, + "text/fwdred": { + "source": "iana" + }, + "text/grammar-ref-list": { + "source": "iana" + }, + "text/hjson": { + "extensions": ["hjson"] + }, + "text/html": { + "source": "iana", + "compressible": true, + "extensions": ["html","htm","shtml"] + }, + "text/jade": { + "extensions": ["jade"] + }, + "text/javascript": { + "source": "iana", + "compressible": true + }, + "text/jcr-cnd": { + "source": "iana" + }, + "text/jsx": { + "compressible": true, + "extensions": ["jsx"] + }, + "text/less": { + "extensions": ["less"] + }, + "text/markdown": { + "source": "iana" + }, + "text/mathml": { + "source": "nginx", + "extensions": ["mml"] + }, + "text/mizar": { + "source": "iana" + }, + "text/n3": { + "source": "iana", + "compressible": true, + "extensions": ["n3"] + }, + "text/parameters": { + "source": "iana" + }, + "text/parityfec": { + "source": "iana" + }, + "text/plain": { + "source": "iana", + "compressible": true, + "extensions": ["txt","text","conf","def","list","log","in","ini"] + }, + "text/provenance-notation": { + "source": "iana" + }, + "text/prs.fallenstein.rst": { + "source": "iana" + }, + "text/prs.lines.tag": { + "source": "iana", + "extensions": ["dsc"] + }, + "text/raptorfec": { + "source": "iana" + }, + "text/red": { + "source": "iana" + }, + "text/rfc822-headers": { + "source": "iana" + }, + "text/richtext": { + "source": "iana", + "compressible": true, + "extensions": ["rtx"] + }, + "text/rtf": { + "source": "iana", + "compressible": true, + "extensions": ["rtf"] + }, + "text/rtp-enc-aescm128": { + "source": "iana" + }, + "text/rtploopback": { + "source": "iana" + }, + "text/rtx": { + "source": "iana" + }, + "text/sgml": { + "source": "iana", + "extensions": ["sgml","sgm"] + }, + "text/stylus": { + "extensions": ["stylus","styl"] + }, + "text/t140": { + "source": "iana" + }, + "text/tab-separated-values": { + "source": "iana", + "compressible": true, + "extensions": ["tsv"] + }, + "text/troff": { + "source": "iana", + "extensions": ["t","tr","roff","man","me","ms"] + }, + "text/turtle": { + "source": "iana", + "extensions": ["ttl"] + }, + "text/ulpfec": { + "source": "iana" + }, + "text/uri-list": { + "source": "iana", + "compressible": true, + "extensions": ["uri","uris","urls"] + }, + "text/vcard": { + "source": "iana", + "compressible": true, + "extensions": ["vcard"] + }, + "text/vnd.a": { + "source": "iana" + }, + "text/vnd.abc": { + "source": "iana" + }, + "text/vnd.curl": { + "source": "iana", + "extensions": ["curl"] + }, + "text/vnd.curl.dcurl": { + "source": "apache", + "extensions": ["dcurl"] + }, + "text/vnd.curl.mcurl": { + "source": "apache", + "extensions": ["mcurl"] + }, + "text/vnd.curl.scurl": { + "source": "apache", + "extensions": ["scurl"] + }, + "text/vnd.debian.copyright": { + "source": "iana" + }, + "text/vnd.dmclientscript": { + "source": "iana" + }, + "text/vnd.dvb.subtitle": { + "source": "iana", + "extensions": ["sub"] + }, + "text/vnd.esmertec.theme-descriptor": { + "source": "iana" + }, + "text/vnd.fly": { + "source": "iana", + "extensions": ["fly"] + }, + "text/vnd.fmi.flexstor": { + "source": "iana", + "extensions": ["flx"] + }, + "text/vnd.graphviz": { + "source": "iana", + "extensions": ["gv"] + }, + "text/vnd.in3d.3dml": { + "source": "iana", + "extensions": ["3dml"] + }, + "text/vnd.in3d.spot": { + "source": "iana", + "extensions": ["spot"] + }, + "text/vnd.iptc.newsml": { + "source": "iana" + }, + "text/vnd.iptc.nitf": { + "source": "iana" + }, + "text/vnd.latex-z": { + "source": "iana" + }, + "text/vnd.motorola.reflex": { + "source": "iana" + }, + "text/vnd.ms-mediapackage": { + "source": "iana" + }, + "text/vnd.net2phone.commcenter.command": { + "source": "iana" + }, + "text/vnd.radisys.msml-basic-layout": { + "source": "iana" + }, + "text/vnd.si.uricatalogue": { + "source": "iana" + }, + "text/vnd.sun.j2me.app-descriptor": { + "source": "iana", + "extensions": ["jad"] + }, + "text/vnd.trolltech.linguist": { + "source": "iana" + }, + "text/vnd.wap.si": { + "source": "iana" + }, + "text/vnd.wap.sl": { + "source": "iana" + }, + "text/vnd.wap.wml": { + "source": "iana", + "extensions": ["wml"] + }, + "text/vnd.wap.wmlscript": { + "source": "iana", + "extensions": ["wmls"] + }, + "text/vtt": { + "charset": "UTF-8", + "compressible": true, + "extensions": ["vtt"] + }, + "text/x-asm": { + "source": "apache", + "extensions": ["s","asm"] + }, + "text/x-c": { + "source": "apache", + "extensions": ["c","cc","cxx","cpp","h","hh","dic"] + }, + "text/x-component": { + "source": "nginx", + "extensions": ["htc"] + }, + "text/x-fortran": { + "source": "apache", + "extensions": ["f","for","f77","f90"] + }, + "text/x-gwt-rpc": { + "compressible": true + }, + "text/x-handlebars-template": { + "extensions": ["hbs"] + }, + "text/x-java-source": { + "source": "apache", + "extensions": ["java"] + }, + "text/x-jquery-tmpl": { + "compressible": true + }, + "text/x-lua": { + "extensions": ["lua"] + }, + "text/x-markdown": { + "compressible": true, + "extensions": ["markdown","md","mkd"] + }, + "text/x-nfo": { + "source": "apache", + "extensions": ["nfo"] + }, + "text/x-opml": { + "source": "apache", + "extensions": ["opml"] + }, + "text/x-pascal": { + "source": "apache", + "extensions": ["p","pas"] + }, + "text/x-processing": { + "compressible": true, + "extensions": ["pde"] + }, + "text/x-sass": { + "extensions": ["sass"] + }, + "text/x-scss": { + "extensions": ["scss"] + }, + "text/x-setext": { + "source": "apache", + "extensions": ["etx"] + }, + "text/x-sfv": { + "source": "apache", + "extensions": ["sfv"] + }, + "text/x-suse-ymp": { + "compressible": true, + "extensions": ["ymp"] + }, + "text/x-uuencode": { + "source": "apache", + "extensions": ["uu"] + }, + "text/x-vcalendar": { + "source": "apache", + "extensions": ["vcs"] + }, + "text/x-vcard": { + "source": "apache", + "extensions": ["vcf"] + }, + "text/xml": { + "source": "iana", + "compressible": true, + "extensions": ["xml"] + }, + "text/xml-external-parsed-entity": { + "source": "iana" + }, + "text/yaml": { + "extensions": ["yaml","yml"] + }, + "video/1d-interleaved-parityfec": { + "source": "apache" + }, + "video/3gpp": { + "source": "apache", + "extensions": ["3gp","3gpp"] + }, + "video/3gpp-tt": { + "source": "apache" + }, + "video/3gpp2": { + "source": "apache", + "extensions": ["3g2"] + }, + "video/bmpeg": { + "source": "apache" + }, + "video/bt656": { + "source": "apache" + }, + "video/celb": { + "source": "apache" + }, + "video/dv": { + "source": "apache" + }, + "video/h261": { + "source": "apache", + "extensions": ["h261"] + }, + "video/h263": { + "source": "apache", + "extensions": ["h263"] + }, + "video/h263-1998": { + "source": "apache" + }, + "video/h263-2000": { + "source": "apache" + }, + "video/h264": { + "source": "apache", + "extensions": ["h264"] + }, + "video/h264-rcdo": { + "source": "apache" + }, + "video/h264-svc": { + "source": "apache" + }, + "video/jpeg": { + "source": "apache", + "extensions": ["jpgv"] + }, + "video/jpeg2000": { + "source": "apache" + }, + "video/jpm": { + "source": "apache", + "extensions": ["jpm","jpgm"] + }, + "video/mj2": { + "source": "apache", + "extensions": ["mj2","mjp2"] + }, + "video/mp1s": { + "source": "apache" + }, + "video/mp2p": { + "source": "apache" + }, + "video/mp2t": { + "source": "apache", + "extensions": ["ts"] + }, + "video/mp4": { + "source": "apache", + "compressible": false, + "extensions": ["mp4","mp4v","mpg4"] + }, + "video/mp4v-es": { + "source": "apache" + }, + "video/mpeg": { + "source": "apache", + "compressible": false, + "extensions": ["mpeg","mpg","mpe","m1v","m2v"] + }, + "video/mpeg4-generic": { + "source": "apache" + }, + "video/mpv": { + "source": "apache" + }, + "video/nv": { + "source": "apache" + }, + "video/ogg": { + "source": "apache", + "compressible": false, + "extensions": ["ogv"] + }, + "video/parityfec": { + "source": "apache" + }, + "video/pointer": { + "source": "apache" + }, + "video/quicktime": { + "source": "apache", + "compressible": false, + "extensions": ["qt","mov"] + }, + "video/raw": { + "source": "apache" + }, + "video/rtp-enc-aescm128": { + "source": "apache" + }, + "video/rtx": { + "source": "apache" + }, + "video/smpte292m": { + "source": "apache" + }, + "video/ulpfec": { + "source": "apache" + }, + "video/vc1": { + "source": "apache" + }, + "video/vnd.cctv": { + "source": "apache" + }, + "video/vnd.dece.hd": { + "source": "apache", + "extensions": ["uvh","uvvh"] + }, + "video/vnd.dece.mobile": { + "source": "apache", + "extensions": ["uvm","uvvm"] + }, + "video/vnd.dece.mp4": { + "source": "apache" + }, + "video/vnd.dece.pd": { + "source": "apache", + "extensions": ["uvp","uvvp"] + }, + "video/vnd.dece.sd": { + "source": "apache", + "extensions": ["uvs","uvvs"] + }, + "video/vnd.dece.video": { + "source": "apache", + "extensions": ["uvv","uvvv"] + }, + "video/vnd.directv.mpeg": { + "source": "apache" + }, + "video/vnd.directv.mpeg-tts": { + "source": "apache" + }, + "video/vnd.dlna.mpeg-tts": { + "source": "apache" + }, + "video/vnd.dvb.file": { + "source": "apache", + "extensions": ["dvb"] + }, + "video/vnd.fvt": { + "source": "apache", + "extensions": ["fvt"] + }, + "video/vnd.hns.video": { + "source": "apache" + }, + "video/vnd.iptvforum.1dparityfec-1010": { + "source": "apache" + }, + "video/vnd.iptvforum.1dparityfec-2005": { + "source": "apache" + }, + "video/vnd.iptvforum.2dparityfec-1010": { + "source": "apache" + }, + "video/vnd.iptvforum.2dparityfec-2005": { + "source": "apache" + }, + "video/vnd.iptvforum.ttsavc": { + "source": "apache" + }, + "video/vnd.iptvforum.ttsmpeg2": { + "source": "apache" + }, + "video/vnd.motorola.video": { + "source": "apache" + }, + "video/vnd.motorola.videop": { + "source": "apache" + }, + "video/vnd.mpegurl": { + "source": "apache", + "extensions": ["mxu","m4u"] + }, + "video/vnd.ms-playready.media.pyv": { + "source": "apache", + "extensions": ["pyv"] + }, + "video/vnd.nokia.interleaved-multimedia": { + "source": "apache" + }, + "video/vnd.nokia.videovoip": { + "source": "apache" + }, + "video/vnd.objectvideo": { + "source": "apache" + }, + "video/vnd.sealed.mpeg1": { + "source": "apache" + }, + "video/vnd.sealed.mpeg4": { + "source": "apache" + }, + "video/vnd.sealed.swf": { + "source": "apache" + }, + "video/vnd.sealedmedia.softseal.mov": { + "source": "apache" + }, + "video/vnd.uvvu.mp4": { + "source": "apache", + "extensions": ["uvu","uvvu"] + }, + "video/vnd.vivo": { + "source": "apache", + "extensions": ["viv"] + }, + "video/webm": { + "source": "apache", + "compressible": false, + "extensions": ["webm"] + }, + "video/x-f4v": { + "source": "apache", + "extensions": ["f4v"] + }, + "video/x-fli": { + "source": "apache", + "extensions": ["fli"] + }, + "video/x-flv": { + "source": "apache", + "compressible": false, + "extensions": ["flv"] + }, + "video/x-m4v": { + "source": "apache", + "extensions": ["m4v"] + }, + "video/x-matroska": { + "source": "apache", + "compressible": false, + "extensions": ["mkv","mk3d","mks"] + }, + "video/x-mng": { + "source": "apache", + "extensions": ["mng"] + }, + "video/x-ms-asf": { + "source": "apache", + "extensions": ["asf","asx"] + }, + "video/x-ms-vob": { + "source": "apache", + "extensions": ["vob"] + }, + "video/x-ms-wm": { + "source": "apache", + "extensions": ["wm"] + }, + "video/x-ms-wmv": { + "source": "apache", + "compressible": false, + "extensions": ["wmv"] + }, + "video/x-ms-wmx": { + "source": "apache", + "extensions": ["wmx"] + }, + "video/x-ms-wvx": { + "source": "apache", + "extensions": ["wvx"] + }, + "video/x-msvideo": { + "source": "apache", + "extensions": ["avi"] + }, + "video/x-sgi-movie": { + "source": "apache", + "extensions": ["movie"] + }, + "video/x-smv": { + "source": "apache", + "extensions": ["smv"] + }, + "x-conference/x-cooltalk": { + "source": "apache", + "extensions": ["ice"] + }, + "x-shader/x-fragment": { + "compressible": true + }, + "x-shader/x-vertex": { + "compressible": true + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js new file mode 100644 index 00000000..551031f6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/index.js @@ -0,0 +1,11 @@ +/*! + * mime-db + * Copyright(c) 2014 Jonathan Ong + * MIT Licensed + */ + +/** + * Module exports. + */ + +module.exports = require('./db.json') diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json new file mode 100644 index 00000000..9c2119a5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json @@ -0,0 +1,94 @@ +{ + "name": "mime-db", + "description": "Media Type Database", + "version": "1.20.0", + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + }, + { + "name": "Robert Kieffer", + "email": "robert@broofa.com", + "url": "http://github.com/broofa" + } + ], + "license": "MIT", + "keywords": [ + "mime", + "db", + "type", + "types", + "database", + "charset", + "charsets" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/mime-db.git" + }, + "devDependencies": { + "bluebird": "2.10.0", + "co": "4.6.0", + "cogent": "1.0.1", + "csv-parse": "1.0.0", + "gnode": "0.1.1", + "istanbul": "0.4.0", + "mocha": "1.21.5", + "raw-body": "2.1.4", + "stream-to-array": "2.2.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "db.json", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "build": "node scripts/build", + "fetch": "gnode scripts/fetch-apache && gnode scripts/fetch-iana && gnode scripts/fetch-nginx", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", + "update": "npm run fetch && npm run build" + }, + "gitHead": "20c99312645c05ab8466701ede01bd5cd3ac7bc4", + "bugs": { + "url": "https://github.com/jshttp/mime-db/issues" + }, + "homepage": "https://github.com/jshttp/mime-db", + "_id": "mime-db@1.20.0", + "_shasum": "496f90fd01fe0e031c8823ec3aa9450ffda18ed8", + "_from": "mime-db@>=1.20.0 <1.21.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "496f90fd01fe0e031c8823ec3aa9450ffda18ed8", + "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.20.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.20.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/package.json new file mode 100644 index 00000000..ffd49249 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/mime-types/package.json @@ -0,0 +1,84 @@ +{ + "name": "mime-types", + "description": "The ultimate javascript content-type utility.", + "version": "2.1.8", + "contributors": [ + { + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" + }, + { + "name": "Jeremiah Senkpiel", + "email": "fishrock123@rocketmail.com", + "url": "https://searchbeam.jit.su" + }, + { + "name": "Jonathan Ong", + "email": "me@jongleberry.com", + "url": "http://jongleberry.com" + } + ], + "license": "MIT", + "keywords": [ + "mime", + "types" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/jshttp/mime-types.git" + }, + "dependencies": { + "mime-db": "~1.20.0" + }, + "devDependencies": { + "istanbul": "0.4.1", + "mocha": "~1.21.5" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "index.js" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "test": "mocha --reporter spec test/test.js", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" + }, + "gitHead": "100876a23fab896d8cf0d904fc9778dbdfc1695b", + "bugs": { + "url": "https://github.com/jshttp/mime-types/issues" + }, + "homepage": "https://github.com/jshttp/mime-types", + "_id": "mime-types@2.1.8", + "_shasum": "faf57823de04bc7cbff4ee82c6b63946e812ae72", + "_from": "mime-types@>=2.1.7 <2.2.0", + "_npmVersion": "1.4.28", + "_npmUser": { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + }, + "maintainers": [ + { + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" + }, + { + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" + }, + { + "name": "dougwilson", + "email": "doug@somethingdoug.com" + } + ], + "dist": { + "shasum": "faf57823de04bc7cbff4ee82c6b63946e812ae72", + "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.8.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/.npmignore new file mode 100644 index 00000000..88861393 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/.npmignore @@ -0,0 +1,4 @@ +node_modules +.DS_Store +.nyc_output +coverage diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/LICENSE.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/LICENSE.md new file mode 100644 index 00000000..652609b3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010-2012 Robert Kieffer + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/README.md new file mode 100644 index 00000000..5cd85550 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/README.md @@ -0,0 +1,254 @@ +# node-uuid + +Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS. + +Features: + +* Generate RFC4122 version 1 or version 4 UUIDs +* Runs in node.js and all browsers. +* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid'). +* Cryptographically strong random # generation + * `crypto.randomBytes(n)` in node.js + * `window.crypto.getRandomValues(ta)` in [supported browsers](https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues#Browser_Compatibility) +* 1.1K minified and gzip'ed (Want something smaller? Check this [crazy shit](https://gist.github.com/982883) out! ) +* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html) +* Comes with a Command Line Interface for generating uuids on the command line + +## Getting Started + +Install it in your browser: + +```html + +``` + +Or in node.js: + +``` +npm install node-uuid +``` + +```javascript +var uuid = require('node-uuid'); +``` + +Then create some ids ... + +```javascript +// Generate a v1 (time-based) id +uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' + +// Generate a v4 (random) id +uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' +``` + +## API + +### uuid.v1([`options` [, `buffer` [, `offset`]]]) + +Generate and return a RFC4122 v1 (timestamp-based) UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + + * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID. See note 1. + * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. + * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. + * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. + +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Notes: + +1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) + +Example: Generate string UUID with fully-specified options + +```javascript +uuid.v1({ + node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678 +}); // -> "710b962e-041c-11e1-9234-0123456789ab" +``` + +Example: In-place generation of two binary IDs + +```javascript +// Generate two ids in an array +var arr = new Array(32); // -> [] +uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] +uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] + +// Optionally use uuid.unparse() to get stringify the ids +uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' +uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' +``` + +### uuid.v4([`options` [, `buffer` [, `offset`]]]) + +Generate and return a RFC4122 v4 UUID. + +* `options` - (Object) Optional uuid state to apply. Properties may include: + + * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values + * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. + +* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. +* `offset` - (Number) Starting index in `buffer` at which to begin writing. + +Returns `buffer`, if specified, otherwise the string form of the UUID + +Example: Generate string UUID with fully-specified options + +```javascript +uuid.v4({ + random: [ + 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, + 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 + ] +}); +// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" +``` + +Example: Generate two IDs in a single buffer + +```javascript +var buffer = new Array(32); // (or 'new Buffer' in node.js) +uuid.v4(null, buffer, 0); +uuid.v4(null, buffer, 16); +``` + +### uuid.parse(id[, buffer[, offset]]) +### uuid.unparse(buffer[, offset]) + +Parse and unparse UUIDs + + * `id` - (String) UUID(-like) string + * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used + * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 + +Example parsing and unparsing a UUID string + +```javascript +var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> +var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' +``` + +### uuid.noConflict() + +(Browsers only) Set `uuid` property back to it's previous value. + +Returns the node-uuid object. + +Example: + +```javascript +var myUuid = uuid.noConflict(); +myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' +``` + +## Deprecated APIs + +Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. + +### uuid([format [, buffer [, offset]]]) + +uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). + +### uuid.BufferClass + +The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. + +## Command Line Interface + +To use the executable, it's probably best to install this library globally. + +`npm install -g node-uuid` + +Usage: + +``` +USAGE: uuid [version] [options] + + +options: + +--help Display this message and exit +``` + +`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by "v1" and "v4", respectively). `version` defaults to version 4 when not supplied. + +### Examples + +``` +> uuid +3a91f950-dec8-4688-ba14-5b7bbfc7a563 +``` + +``` +> uuid v1 +9d0b43e0-7696-11e3-964b-250efa37a98e +``` + +``` +> uuid v4 +6790ac7c-24ac-4f98-8464-42f6d98a53ae +``` + +## Testing + +In node.js + +``` +npm test +``` + +In Browser + +``` +open test/test.html +``` + +### Benchmarking + +Requires node.js + +``` +npm install uuid uuid-js +node benchmark/benchmark.js +``` + +For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) + +For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). + +## Release notes + +### 1.4.6 + +* Properly detect node crypto and whatwg crypto +* Workaround phantomjs/browserify bug +* Explicit check for `window` rather implicit this-global +* Issue warning if Math.random() is being used +* "use strict"; +* A few jshint / stylistic updates (=== and such) + +### 1.4.0 + +* Improved module context detection +* Removed public RNG functions + +### 1.3.2 + +* Improve tests and handling of v1() options (Issue #24) +* Expose RNG option to allow for perf testing with different generators + +### 1.3.0 + +* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! +* Support for node.js crypto API +* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/README.md new file mode 100644 index 00000000..aaeb2ea0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/README.md @@ -0,0 +1,53 @@ +# node-uuid Benchmarks + +### Results + +To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark + +### Run them yourself + +node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`. + +To prepare and run the benchmark issue; + +``` +npm install uuid uuid-js +node benchmark/benchmark.js +``` + +You'll see an output like this one: + +``` +# v4 +nodeuuid.v4(): 854700 uuids/second +nodeuuid.v4('binary'): 788643 uuids/second +nodeuuid.v4('binary', buffer): 1336898 uuids/second +uuid(): 479386 uuids/second +uuid('binary'): 582072 uuids/second +uuidjs.create(4): 312304 uuids/second + +# v1 +nodeuuid.v1(): 938086 uuids/second +nodeuuid.v1('binary'): 683060 uuids/second +nodeuuid.v1('binary', buffer): 1644736 uuids/second +uuidjs.create(1): 190621 uuids/second +``` + +* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library. +* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK. + +If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file: + +``` +for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done; +``` + +If you're interested in how performance varies between different node versions, you can issue the above command multiple times. + +You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot: + +``` +(cd benchmark/ && ./bench.sh) +``` + +This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu new file mode 100644 index 00000000..a342fbbe --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu @@ -0,0 +1,174 @@ +#!/opt/local/bin/gnuplot -persist +# +# +# G N U P L O T +# Version 4.4 patchlevel 3 +# last modified March 2011 +# System: Darwin 10.8.0 +# +# Copyright (C) 1986-1993, 1998, 2004, 2007-2010 +# Thomas Williams, Colin Kelley and many others +# +# gnuplot home: http://www.gnuplot.info +# faq, bugs, etc: type "help seeking-assistance" +# immediate help: type "help" +# plot window: hit 'h' +set terminal postscript eps noenhanced defaultplex \ + leveldefault color colortext \ + solid linewidth 1.2 butt noclip \ + palfuncparam 2000,0.003 \ + "Helvetica" 14 +set output 'bench.eps' +unset clip points +set clip one +unset clip two +set bar 1.000000 front +set border 31 front linetype -1 linewidth 1.000 +set xdata +set ydata +set zdata +set x2data +set y2data +set timefmt x "%d/%m/%y,%H:%M" +set timefmt y "%d/%m/%y,%H:%M" +set timefmt z "%d/%m/%y,%H:%M" +set timefmt x2 "%d/%m/%y,%H:%M" +set timefmt y2 "%d/%m/%y,%H:%M" +set timefmt cb "%d/%m/%y,%H:%M" +set boxwidth +set style fill empty border +set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 +set style circle radius graph 0.02, first 0, 0 +set dummy x,y +set format x "% g" +set format y "% g" +set format x2 "% g" +set format y2 "% g" +set format z "% g" +set format cb "% g" +set angles radians +unset grid +set key title "" +set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox +set key noinvert samplen 4 spacing 1 width 0 height 0 +set key maxcolumns 2 maxrows 0 +unset label +unset arrow +set style increment default +unset style line +set style line 1 linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0 +unset style arrow +set style histogram clustered gap 2 title offset character 0, 0, 0 +unset logscale +set offsets graph 0.05, 0.15, 0, 0 +set pointsize 1.5 +set pointintervalbox 1 +set encoding default +unset polar +unset parametric +unset decimalsign +set view 60, 30, 1, 1 +set samples 100, 100 +set isosamples 10, 10 +set surface +unset contour +set clabel '%8.3g' +set mapping cartesian +set datafile separator whitespace +unset hidden3d +set cntrparam order 4 +set cntrparam linear +set cntrparam levels auto 5 +set cntrparam points 5 +set size ratio 0 1,1 +set origin 0,0 +set style data points +set style function lines +set xzeroaxis linetype -2 linewidth 1.000 +set yzeroaxis linetype -2 linewidth 1.000 +set zzeroaxis linetype -2 linewidth 1.000 +set x2zeroaxis linetype -2 linewidth 1.000 +set y2zeroaxis linetype -2 linewidth 1.000 +set ticslevel 0.5 +set mxtics default +set mytics default +set mztics default +set mx2tics default +set my2tics default +set mcbtics default +set xtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 +set xtics norangelimit +set xtics () +set ytics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 +set ytics autofreq norangelimit +set ztics border in scale 1,0.5 nomirror norotate offset character 0, 0, 0 +set ztics autofreq norangelimit +set nox2tics +set noy2tics +set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 +set cbtics autofreq norangelimit +set title "" +set title offset character 0, 0, 0 font "" norotate +set timestamp bottom +set timestamp "" +set timestamp offset character 0, 0, 0 font "" norotate +set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) +set autoscale rfixmin +set autoscale rfixmax +set trange [ * : * ] noreverse nowriteback # (currently [-5.00000:5.00000] ) +set autoscale tfixmin +set autoscale tfixmax +set urange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) +set autoscale ufixmin +set autoscale ufixmax +set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) +set autoscale vfixmin +set autoscale vfixmax +set xlabel "" +set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate +set x2label "" +set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate +set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) +set autoscale xfixmin +set autoscale xfixmax +set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) +set autoscale x2fixmin +set autoscale x2fixmax +set ylabel "" +set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 +set y2label "" +set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 +set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) +set autoscale yfixmin +set autoscale yfixmax +set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) +set autoscale y2fixmin +set autoscale y2fixmax +set zlabel "" +set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate +set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) +set autoscale zfixmin +set autoscale zfixmax +set cblabel "" +set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 +set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) +set autoscale cbfixmin +set autoscale cbfixmax +set zero 1e-08 +set lmargin -1 +set bmargin -1 +set rmargin -1 +set tmargin -1 +set pm3d explicit at s +set pm3d scansautomatic +set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean +set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB +set palette rgbformulae 7, 5, 15 +set colorbox default +set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault +set loadpath +set fontpath +set fit noerrorvariables +GNUTERM = "aqua" +plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 +# EOF diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/bench.sh b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/bench.sh new file mode 100755 index 00000000..d870a0cb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/bench.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +# for a given node version run: +# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done; + +PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte') +FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es) +INDICES=(2 3 2 3 2 2 2 2 2) +VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " ) +TMPJOIN="tmp_join" +OUTPUT="bench_results.txt" + +for I in ${!FILES[*]}; do + F=${FILES[$I]} + P=${PATTERNS[$I]} + INDEX=${INDICES[$I]} + echo "version $F" > $F + for V in $VERSIONS; do + (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F + done + if [ $I == 0 ]; then + cat $F > $TMPJOIN + else + join $TMPJOIN $F > $OUTPUT + cp $OUTPUT $TMPJOIN + fi + rm $F +done + +rm $TMPJOIN + +gnuplot bench.gnu +convert -density 200 -resize 800x560 -flatten bench.eps bench.png +rm bench.eps diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c new file mode 100644 index 00000000..dbfc75f6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c @@ -0,0 +1,34 @@ +/* +Test performance of native C UUID generation + +To Compile: cc -luuid benchmark-native.c -o benchmark-native +*/ + +#include +#include +#include +#include + +int main() { + uuid_t myid; + char buf[36+1]; + int i; + struct timeval t; + double start, finish; + + gettimeofday(&t, NULL); + start = t.tv_sec + t.tv_usec/1e6; + + int n = 2e5; + for (i = 0; i < n; i++) { + uuid_generate(myid); + uuid_unparse(myid, buf); + } + + gettimeofday(&t, NULL); + finish = t.tv_sec + t.tv_usec/1e6; + double dur = finish - start; + + printf("%d uuids/sec", (int)(n/dur)); + return 0; +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js new file mode 100644 index 00000000..40e6efbe --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js @@ -0,0 +1,84 @@ +try { + var nodeuuid = require('../uuid'); +} catch (e) { + console.error('node-uuid require failed - skipping tests'); +} + +try { + var uuid = require('uuid'); +} catch (e) { + console.error('uuid require failed - skipping tests'); +} + +try { + var uuidjs = require('uuid-js'); +} catch (e) { + console.error('uuid-js require failed - skipping tests'); +} + +var N = 5e5; + +function rate(msg, t) { + console.log(msg + ': ' + + (N / (Date.now() - t) * 1e3 | 0) + + ' uuids/second'); +} + +console.log('# v4'); + +// node-uuid - string form +if (nodeuuid) { + for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4(); + rate('nodeuuid.v4() - using node.js crypto RNG', t); + + for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG}); + rate('nodeuuid.v4() - using Math.random() RNG', t); + + for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary'); + rate('nodeuuid.v4(\'binary\')', t); + + var buffer = new nodeuuid.BufferClass(16); + for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer); + rate('nodeuuid.v4(\'binary\', buffer)', t); +} + +// libuuid - string form +if (uuid) { + for (var i = 0, t = Date.now(); i < N; i++) uuid(); + rate('uuid()', t); + + for (var i = 0, t = Date.now(); i < N; i++) uuid('binary'); + rate('uuid(\'binary\')', t); +} + +// uuid-js - string form +if (uuidjs) { + for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4); + rate('uuidjs.create(4)', t); +} + +// 140byte.es +for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)}); +rate('140byte.es_v4', t); + +console.log(''); +console.log('# v1'); + +// node-uuid - v1 string form +if (nodeuuid) { + for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1(); + rate('nodeuuid.v1()', t); + + for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary'); + rate('nodeuuid.v1(\'binary\')', t); + + var buffer = new nodeuuid.BufferClass(16); + for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer); + rate('nodeuuid.v1(\'binary\', buffer)', t); +} + +// uuid-js - v1 string form +if (uuidjs) { + for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1); + rate('uuidjs.create(1)', t); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/bin/uuid b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/bin/uuid new file mode 100755 index 00000000..f732e991 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/bin/uuid @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +var path = require('path'); +var uuid = require(path.join(__dirname, '..')); + +var arg = process.argv[2]; + +if ('--help' === arg) { + console.log('\n USAGE: uuid [version] [options]\n\n'); + console.log(' options:\n'); + console.log(' --help Display this message and exit\n'); + process.exit(0); +} + +if (null == arg) { + console.log(uuid()); + process.exit(0); +} + +if ('v1' !== arg && 'v4' !== arg) { + console.error('Version must be RFC4122 version 1 or version 4, denoted as "v1" or "v4"'); + process.exit(1); +} + +console.log(uuid[arg]()); +process.exit(0); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/bower.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/bower.json new file mode 100644 index 00000000..c0925e19 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/bower.json @@ -0,0 +1,23 @@ +{ + "name": "node-uuid", + "version": "1.4.7", + "homepage": "https://github.com/broofa/node-uuid", + "authors": [ + "Robert Kieffer " + ], + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "main": "uuid.js", + "keywords": [ + "uuid", + "gid", + "rfc4122" + ], + "license": "MIT", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/component.json new file mode 100644 index 00000000..3ff46336 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/component.json @@ -0,0 +1,25 @@ +{ + "name": "node-uuid", + "repo": "broofa/node-uuid", + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "version": "1.4.7", + "author": "Robert Kieffer ", + "contributors": [ + { + "name": "Christoph Tavan ", + "github": "https://github.com/ctavan" + } + ], + "keywords": [ + "uuid", + "guid", + "rfc4122" + ], + "dependencies": {}, + "development": {}, + "main": "uuid.js", + "scripts": [ + "uuid.js" + ], + "license": "MIT" +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/package.json new file mode 100644 index 00000000..473b25a8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/package.json @@ -0,0 +1,81 @@ +{ + "author": { + "name": "Robert Kieffer", + "email": "robert@broofa.com" + }, + "bin": { + "uuid": "./bin/uuid" + }, + "bugs": { + "url": "https://github.com/broofa/node-uuid/issues" + }, + "contributors": [ + { + "name": "AJ ONeal", + "email": "coolaj86@gmail.com" + }, + { + "name": "Christoph Tavan", + "email": "dev@tavan.de" + } + ], + "dependencies": {}, + "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", + "devDependencies": { + "nyc": "^2.2.0" + }, + "directories": {}, + "homepage": "https://github.com/broofa/node-uuid", + "installable": true, + "keywords": [ + "guid", + "rfc4122", + "uuid" + ], + "lib": ".", + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/broofa/node-uuid/master/LICENSE.md" + } + ], + "main": "./uuid.js", + "maintainers": [ + { + "name": "broofa", + "email": "robert@broofa.com" + }, + { + "name": "coolaj86", + "email": "coolaj86@gmail.com" + } + ], + "name": "node-uuid", + "optionalDependencies": {}, + "repository": { + "type": "git", + "url": "git+https://github.com/broofa/node-uuid.git" + }, + "scripts": { + "coverage": "nyc npm test && nyc report", + "test": "node test/test.js" + }, + "url": "http://github.com/broofa/node-uuid", + "version": "1.4.7", + "gitHead": "309512573ec1c60143c257157479a20f7f1f51cd", + "_id": "node-uuid@1.4.7", + "_shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", + "_from": "node-uuid@>=1.4.7 <1.5.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "coolaj86", + "email": "coolaj86@gmail.com" + }, + "dist": { + "shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", + "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" + }, + "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/compare_v1.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/compare_v1.js new file mode 100644 index 00000000..05af8221 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/compare_v1.js @@ -0,0 +1,63 @@ +var assert = require('assert'), + nodeuuid = require('../uuid'), + uuidjs = require('uuid-js'), + libuuid = require('uuid').generate, + util = require('util'), + exec = require('child_process').exec, + os = require('os'); + +// On Mac Os X / macports there's only the ossp-uuid package that provides uuid +// On Linux there's uuid-runtime which provides uuidgen +var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t'; + +function compare(ids) { + console.log(ids); + for (var i = 0; i < ids.length; i++) { + var id = ids[i].split('-'); + id = [id[2], id[1], id[0]].join(''); + ids[i] = id; + } + var sorted = ([].concat(ids)).sort(); + + if (sorted.toString() !== ids.toString()) { + console.log('Warning: sorted !== ids'); + } else { + console.log('everything in order!'); + } +} + +// Test time order of v1 uuids +var ids = []; +while (ids.length < 10e3) ids.push(nodeuuid.v1()); + +var max = 10; +console.log('node-uuid:'); +ids = []; +for (var i = 0; i < max; i++) ids.push(nodeuuid.v1()); +compare(ids); + +console.log(''); +console.log('uuidjs:'); +ids = []; +for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString()); +compare(ids); + +console.log(''); +console.log('libuuid:'); +ids = []; +var count = 0; +var last = function() { + compare(ids); +} +var cb = function(err, stdout, stderr) { + ids.push(stdout.substring(0, stdout.length-1)); + count++; + if (count < max) { + return next(); + } + last(); +}; +var next = function() { + exec(uuidCmd, cb); +}; +next(); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/test.html b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/test.html new file mode 100644 index 00000000..d80326ec --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/test.html @@ -0,0 +1,17 @@ + + + + + + + + + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/test.js new file mode 100644 index 00000000..5f1113d8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/test/test.js @@ -0,0 +1,231 @@ +if (!this.uuid) { + // node.js + uuid = require('../uuid'); + if (!/_rb/.test(uuid._rng.toString())) { + throw new Error("should use crypto for node.js"); + } +} + +// +// x-platform log/assert shims +// + +function _log(msg, type) { + type = type || 'log'; + + if (typeof(document) != 'undefined') { + document.write('
' + msg.replace(/\n/g, '
') + '
'); + } + if (typeof(console) != 'undefined') { + var color = { + log: '\033[39m', + warn: '\033[33m', + error: '\033[31m' + }; + console[type](color[type] + msg + color.log); + } +} + +function log(msg) {_log(msg, 'log');} +function warn(msg) {_log(msg, 'warn');} +function error(msg) {_log(msg, 'error');} + +function assert(res, msg) { + if (!res) { + error('FAIL: ' + msg); + } else { + log('Pass: ' + msg); + } +} + +// +// Unit tests +// + +// Verify ordering of v1 ids created with explicit times +var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00 + +function compare(name, ids) { + ids = ids.map(function(id) { + return id.split('-').reverse().join('-'); + }).sort(); + var sorted = ([].concat(ids)).sort(); + + assert(sorted.toString() == ids.toString(), name + ' have expected order'); +} + +// Verify ordering of v1 ids created using default behavior +compare('uuids with current time', [ + uuid.v1(), + uuid.v1(), + uuid.v1(), + uuid.v1(), + uuid.v1() +]); + +// Verify ordering of v1 ids created with explicit times +compare('uuids with time option', [ + uuid.v1({msecs: TIME - 10*3600*1000}), + uuid.v1({msecs: TIME - 1}), + uuid.v1({msecs: TIME}), + uuid.v1({msecs: TIME + 1}), + uuid.v1({msecs: TIME + 28*24*3600*1000}) +]); + +assert( + uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}), + 'IDs created at same msec are different' +); + +// Verify throw if too many ids created +var thrown = false; +try { + uuid.v1({msecs: TIME, nsecs: 10000}); +} catch (e) { + thrown = true; +} +assert(thrown, 'Exception thrown when > 10K ids created in 1 ms'); + +// Verify clock regression bumps clockseq +var uidt = uuid.v1({msecs: TIME}); +var uidtb = uuid.v1({msecs: TIME - 1}); +assert( + parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1, + 'Clock regression by msec increments the clockseq' +); + +// Verify clock regression bumps clockseq +var uidtn = uuid.v1({msecs: TIME, nsecs: 10}); +var uidtnb = uuid.v1({msecs: TIME, nsecs: 9}); +assert( + parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1, + 'Clock regression by nsec increments the clockseq' +); + +// Verify explicit options produce expected id +var id = uuid.v1({ + msecs: 1321651533573, + nsecs: 5432, + clockseq: 0x385c, + node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ] +}); +assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id'); + +// Verify adjacent ids across a msec boundary are 1 time unit apart +var u0 = uuid.v1({msecs: TIME, nsecs: 9999}); +var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0}); + +var before = u0.split('-')[0], after = u1.split('-')[0]; +var dt = parseInt(after, 16) - parseInt(before, 16); +assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart'); + +// +// Test parse/unparse +// + +id = '00112233445566778899aabbccddeeff'; +assert(uuid.unparse(uuid.parse(id.substr(0,10))) == + '00112233-4400-0000-0000-000000000000', 'Short parse'); +assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) == + '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse'); + +// +// Perf tests +// + +var generators = { + v1: uuid.v1, + v4: uuid.v4 +}; + +var UUID_FORMAT = { + v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i, + v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i +}; + +var N = 1e4; + +// Get %'age an actual value differs from the ideal value +function divergence(actual, ideal) { + return Math.round(100*100*(actual - ideal)/ideal)/100; +} + +function rate(msg, t) { + log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second'); +} + +for (var version in generators) { + var counts = {}, max = 0; + var generator = generators[version]; + var format = UUID_FORMAT[version]; + + log('\nSanity check ' + N + ' ' + version + ' uuids'); + for (var i = 0, ok = 0; i < N; i++) { + id = generator(); + if (!format.test(id)) { + throw Error(id + ' is not a valid UUID string'); + } + + if (id != uuid.unparse(uuid.parse(id))) { + assert(fail, id + ' is not a valid id'); + } + + // Count digits for our randomness check + if (version == 'v4') { + var digits = id.replace(/-/g, '').split(''); + for (var j = digits.length-1; j >= 0; j--) { + var c = digits[j]; + max = Math.max(max, counts[c] = (counts[c] || 0) + 1); + } + } + } + + // Check randomness for v4 UUIDs + if (version == 'v4') { + // Limit that we get worried about randomness. (Purely empirical choice, this!) + var limit = 2*100*Math.sqrt(1/N); + + log('\nChecking v4 randomness. Distribution of Hex Digits (% deviation from ideal)'); + + for (var i = 0; i < 16; i++) { + var c = i.toString(16); + var bar = '', n = counts[c], p = Math.round(n/max*100|0); + + // 1-3,5-8, and D-F: 1:16 odds over 30 digits + var ideal = N*30/16; + if (i == 4) { + // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1 + 30/16); + } else if (i >= 8 && i <= 11) { + // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits + ideal = N*(1/4 + 30/16); + } else { + // Otherwise: 1:16 odds on 30 digits + ideal = N*30/16; + } + var d = divergence(n, ideal); + + // Draw bar using UTF squares (just for grins) + var s = n/max*50 | 0; + while (s--) bar += '='; + + assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)'); + } + } +} + +// Perf tests +for (var version in generators) { + log('\nPerformance testing ' + version + ' UUIDs'); + var generator = generators[version]; + var buf = new uuid.BufferClass(16); + + for (var i = 0, t = Date.now(); i < N; i++) generator(); + rate('uuid.' + version + '()', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary'); + rate('uuid.' + version + '(\'binary\')', t); + + for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf); + rate('uuid.' + version + '(\'binary\', buffer)', t); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/uuid.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/uuid.js new file mode 100644 index 00000000..89c5b8fb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/node-uuid/uuid.js @@ -0,0 +1,272 @@ +// uuid.js +// +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + +/*global window, require, define */ +(function(_window) { + 'use strict'; + + // Unique ID creation requires a high quality random # generator. We feature + // detect to determine the best RNG source, normalizing to a function that + // returns 128-bits of randomness, since that's what's usually required + var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot; + + function setupBrowser() { + // Allow for MSIE11 msCrypto + var _crypto = _window.crypto || _window.msCrypto; + + if (!_rng && _crypto && _crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // + // Moderately fast, high quality + try { + var _rnds8 = new Uint8Array(16); + _whatwgRNG = _rng = function whatwgRNG() { + _crypto.getRandomValues(_rnds8); + return _rnds8; + }; + _rng(); + } catch(e) {} + } + + if (!_rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + _mathRNG = _rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; } + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + if ('undefined' !== typeof console && console.warn) { + console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()"); + } + } + } + + function setupNode() { + // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html + // + // Moderately fast, high quality + if ('function' === typeof require) { + try { + var _rb = require('crypto').randomBytes; + _nodeRNG = _rng = _rb && function() {return _rb(16);}; + _rng(); + } catch(e) {} + } + } + + if (_window) { + setupBrowser(); + } else { + setupNode(); + } + + // Buffer class to use + var BufferClass = ('function' === typeof Buffer) ? Buffer : Array; + + // Maps for number <-> hex string conversion + var _byteToHex = []; + var _hexToByte = {}; + for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; + } + + // **`parse()` - Parse a UUID into it's component bytes** + function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; + } + + // **`unparse()` - Convert UUID byte array (ala parse()) into a string** + function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + + // random #'s we need to init node and clockseq + var _seedBytes = _rng(); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + + // Previous uuid creation time + var _lastMSecs = 0, _lastNSecs = 0; + + // See https://github.com/broofa/node-uuid for API details + function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = (options.msecs != null) ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq == null) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); + } + + // **`v4()` - Generate random UUID** + + // See https://github.com/broofa/node-uuid for API details + function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) === 'string') { + buf = (options === 'binary') ? new BufferClass(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); + } + + // Export public API + var uuid = v4; + uuid.v1 = v1; + uuid.v4 = v4; + uuid.parse = parse; + uuid.unparse = unparse; + uuid.BufferClass = BufferClass; + uuid._rng = _rng; + uuid._mathRNG = _mathRNG; + uuid._nodeRNG = _nodeRNG; + uuid._whatwgRNG = _whatwgRNG; + + if (('undefined' !== typeof module) && module.exports) { + // Publish as node.js module + module.exports = uuid; + } else if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + + + } else { + // Publish as global (in browsers) + _previousRoot = _window.uuid; + + // **`noConflict()` - (browser only) to reset global 'uuid' var** + uuid.noConflict = function() { + _window.uuid = _previousRoot; + return uuid; + }; + + _window.uuid = uuid; + } +})('undefined' !== typeof window ? window : null); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/README.md new file mode 100644 index 00000000..34c4a85d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/README.md @@ -0,0 +1,4 @@ +oauth-sign +========== + +OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/index.js new file mode 100644 index 00000000..a587541d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/index.js @@ -0,0 +1,134 @@ +var crypto = require('crypto') + , qs = require('querystring') + ; + +function sha1 (key, body) { + return crypto.createHmac('sha1', key).update(body).digest('base64') +} + +function rsa (key, body) { + return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64'); +} + +function rfc3986 (str) { + return encodeURIComponent(str) + .replace(/!/g,'%21') + .replace(/\*/g,'%2A') + .replace(/\(/g,'%28') + .replace(/\)/g,'%29') + .replace(/'/g,'%27') + ; +} + +// Maps object to bi-dimensional array +// Converts { foo: 'A', bar: [ 'b', 'B' ]} to +// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ] +function map (obj) { + var key, val, arr = [] + for (key in obj) { + val = obj[key] + if (Array.isArray(val)) + for (var i = 0; i < val.length; i++) + arr.push([key, val[i]]) + else if (typeof val === "object") + for (var prop in val) + arr.push([key + '[' + prop + ']', val[prop]]); + else + arr.push([key, val]) + } + return arr +} + +// Compare function for sort +function compare (a, b) { + return a > b ? 1 : a < b ? -1 : 0 +} + +function generateBase (httpMethod, base_uri, params) { + // adapted from https://dev.twitter.com/docs/auth/oauth and + // https://dev.twitter.com/docs/auth/creating-signature + + // Parameter normalization + // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2 + var normalized = map(params) + // 1. First, the name and value of each parameter are encoded + .map(function (p) { + return [ rfc3986(p[0]), rfc3986(p[1] || '') ] + }) + // 2. The parameters are sorted by name, using ascending byte value + // ordering. If two or more parameters share the same name, they + // are sorted by their value. + .sort(function (a, b) { + return compare(a[0], b[0]) || compare(a[1], b[1]) + }) + // 3. The name of each parameter is concatenated to its corresponding + // value using an "=" character (ASCII code 61) as a separator, even + // if the value is empty. + .map(function (p) { return p.join('=') }) + // 4. The sorted name/value pairs are concatenated together into a + // single string by using an "&" character (ASCII code 38) as + // separator. + .join('&') + + var base = [ + rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'), + rfc3986(base_uri), + rfc3986(normalized) + ].join('&') + + return base +} + +function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) { + var base = generateBase(httpMethod, base_uri, params) + var key = [ + consumer_secret || '', + token_secret || '' + ].map(rfc3986).join('&') + + return sha1(key, base) +} + +function rsasign (httpMethod, base_uri, params, private_key, token_secret) { + var base = generateBase(httpMethod, base_uri, params) + var key = private_key || '' + + return rsa(key, base) +} + +function plaintext (consumer_secret, token_secret) { + var key = [ + consumer_secret || '', + token_secret || '' + ].map(rfc3986).join('&') + + return key +} + +function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) { + var method + var skipArgs = 1 + + switch (signMethod) { + case 'RSA-SHA1': + method = rsasign + break + case 'HMAC-SHA1': + method = hmacsign + break + case 'PLAINTEXT': + method = plaintext + skipArgs = 4 + break + default: + throw new Error("Signature method not supported: " + signMethod) + } + + return method.apply(null, [].slice.call(arguments, skipArgs)) +} + +exports.hmacsign = hmacsign +exports.rsasign = rsasign +exports.plaintext = plaintext +exports.sign = sign +exports.rfc3986 = rfc3986 diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/package.json new file mode 100644 index 00000000..eeaaa68d --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/package.json @@ -0,0 +1,59 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "oauth-sign", + "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.", + "version": "0.8.0", + "license": "Apache-2.0", + "repository": { + "url": "git+https://github.com/mikeal/oauth-sign.git" + }, + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "scripts": { + "test": "node test.js" + }, + "gitHead": "e1f2b42ff039901ce977f8e81918767d97d496b5", + "bugs": { + "url": "https://github.com/mikeal/oauth-sign/issues" + }, + "homepage": "https://github.com/mikeal/oauth-sign#readme", + "_id": "oauth-sign@0.8.0", + "_shasum": "938fdc875765ba527137d8aec9d178e24debc553", + "_from": "oauth-sign@>=0.8.0 <0.9.0", + "_npmVersion": "2.10.1", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "dist": { + "shasum": "938fdc875765ba527137d8aec9d178e24debc553", + "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/test.js new file mode 100644 index 00000000..a8847270 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/oauth-sign/test.js @@ -0,0 +1,89 @@ +var oauth = require('./index') + , hmacsign = oauth.hmacsign + , assert = require('assert') + , qs = require('querystring') + ; + +// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth + +var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', + { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' + , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' + , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' + , oauth_signature_method: 'HMAC-SHA1' + , oauth_timestamp: '1272323042' + , oauth_version: '1.0' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") + +console.log(reqsign) +console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') +assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') + +var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', + { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' + , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' + , oauth_signature_method: 'HMAC-SHA1' + , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' + , oauth_timestamp: '1272323047' + , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' + , oauth_version: '1.0' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") + +console.log(accsign) +console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') +assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') + +var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', + { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" + , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" + , oauth_signature_method: "HMAC-SHA1" + , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" + , oauth_timestamp: "1272325550" + , oauth_version: "1.0" + , status: 'setting up my twitter 私のさえずりを設定する' + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") + +console.log(upsign) +console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') +assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') + +// handle objects in params (useful for Wordpress REST API) +var upsign = hmacsign('POST', 'http://wordpress.com/wp-json', + { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" + , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" + , oauth_signature_method: "HMAC-SHA1" + , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" + , oauth_timestamp: "1272325550" + , oauth_version: "1.0" + , filter: { number: "-1" } + }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") + +console.log(upsign) +console.log('YrJFBdwnjuIitGpKrxLUplcuuUQ=') +assert.equal(upsign, 'YrJFBdwnjuIitGpKrxLUplcuuUQ=') + +// example in rfc5849 +var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q') +params.oauth_consumer_key = '9djdj82h48djs9d2' +params.oauth_token = 'kkk9d7dh3k39sjv7' +params.oauth_nonce = '7d8f3e4a' +params.oauth_signature_method = 'HMAC-SHA1' +params.oauth_timestamp = '137131201' + +var rfc5849sign = hmacsign('POST', 'http://example.com/request', + params, "j49sk3j29djd", "dh893hdasih9") + +console.log(rfc5849sign) +console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=') +assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=') + + +// PLAINTEXT + +var plainSign = oauth.sign('PLAINTEXT', 'GET', 'http://dummy.com', {}, 'consumer_secret', 'token_secret') +console.log(plainSign) +assert.equal(plainSign, 'consumer_secret&token_secret') + +plainSign = oauth.plaintext('consumer_secret', 'token_secret') +console.log(plainSign) +assert.equal(plainSign, 'consumer_secret&token_secret') diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.eslintignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.eslintignore new file mode 100644 index 00000000..1521c8b7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.eslintignore @@ -0,0 +1 @@ +dist diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.npmignore new file mode 100644 index 00000000..7e1574dc --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.npmignore @@ -0,0 +1,18 @@ +.idea +*.iml +npm-debug.log +dump.rdb +node_modules +results.tap +results.xml +npm-shrinkwrap.json +config.json +.DS_Store +*/.DS_Store +*/*/.DS_Store +._* +*/._* +*/*/._* +coverage.* +lib-cov +complexity.md diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.travis.yml new file mode 100644 index 00000000..335fded1 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/.travis.yml @@ -0,0 +1,8 @@ +language: node_js + +node_js: + - 0.10 + - 4.0 + - 4 + +sudo: false diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/CHANGELOG.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/CHANGELOG.md new file mode 100644 index 00000000..e43b1ace --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/CHANGELOG.md @@ -0,0 +1,99 @@ + +## [**5.1.0**](https://github.com/hapijs/qs/issues?milestone=29&state=open) +- [**#117**](https://github.com/hapijs/qs/issues/117) make URI encoding stringified results optional +- [**#106**](https://github.com/hapijs/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify + +## [**5.0.0**](https://github.com/hapijs/qs/issues?milestone=28&state=closed) +- [**#114**](https://github.com/hapijs/qs/issues/114) default allowDots to false +- [**#100**](https://github.com/hapijs/qs/issues/100) include dist to npm + +## [**4.0.0**](https://github.com/hapijs/qs/issues?milestone=26&state=closed) +- [**#98**](https://github.com/hapijs/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional + +## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=closed) +- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation" + +## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed) +- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties +- [**#77**](https://github.com/hapijs/qs/issues/77) Perf boost +- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing +- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object +- [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option +- [**#68**](https://github.com/hapijs/qs/issues/68) Fixed issue with recursion and passing strings into objects. +- [**#66**](https://github.com/hapijs/qs/issues/66) Add mixed array and object dot notation support Closes: #47 +- [**#76**](https://github.com/hapijs/qs/issues/76) RFC 3986 +- [**#85**](https://github.com/hapijs/qs/issues/85) No equal sign +- [**#84**](https://github.com/hapijs/qs/issues/84) update license attribute + +## [**2.4.1**](https://github.com/hapijs/qs/issues?milestone=20&state=closed) +- [**#73**](https://github.com/hapijs/qs/issues/73) Property 'hasOwnProperty' of object # is not a function + +## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed) +- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option + +## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=closed) +- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57 +- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader + +## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed) +- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object + +## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed) +- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError". + +## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed) +- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46 + +## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed) +- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer? +- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45 +- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39 + +## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed) +- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number + +## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed) +- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array +- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x + +## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed) +- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value +- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty +- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver? + +## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed) +- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31 +- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects + +## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed) +- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present +- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays +- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge +- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters? + +## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed) +- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter + +## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed) +- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit? +- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit +- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20 + +## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed) +- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values + +## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed) +- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters +- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block + +## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed) +- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument +- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed + +## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed) +- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted +- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null +- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README + +## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed) +- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/CONTRIBUTING.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/CONTRIBUTING.md new file mode 100644 index 00000000..89283615 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/CONTRIBUTING.md @@ -0,0 +1 @@ +Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/LICENSE new file mode 100644 index 00000000..d4569487 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014 Nathan LaFreniere and other contributors. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * The names of any contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * * * + +The complete list of contributors can be found at: https://github.com/hapijs/qs/graphs/contributors diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/README.md new file mode 100644 index 00000000..3c61db31 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/README.md @@ -0,0 +1,331 @@ +# qs + +A querystring parsing and stringifying library with some added security. + +[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs) + +Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf) + +The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring). + +## Usage + +```javascript +var Qs = require('qs'); + +var obj = Qs.parse('a=c'); // { a: 'c' } +var str = Qs.stringify(obj); // 'a=c' +``` + +### Parsing Objects + +```javascript +Qs.parse(string, [options]); +``` + +**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`. +For example, the string `'foo[bar]=baz'` converts to: + +```javascript +{ + foo: { + bar: 'baz' + } +} +``` + +When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like: + +```javascript +Qs.parse('a.hasOwnProperty=b', { plainObjects: true }); +// { a: { hasOwnProperty: 'b' } } +``` + +By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option. + +```javascript +Qs.parse('a.hasOwnProperty=b', { allowPrototypes: true }); +// { a: { hasOwnProperty: 'b' } } +``` + +URI encoded strings work too: + +```javascript +Qs.parse('a%5Bb%5D=c'); +// { a: { b: 'c' } } +``` + +You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`: + +```javascript +{ + foo: { + bar: { + baz: 'foobarbaz' + } + } +} +``` + +By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like +`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be: + +```javascript +{ + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } +} +``` + +This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`: + +```javascript +Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); +// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } } +``` + +The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number. + +For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option: + +```javascript +Qs.parse('a=b&c=d', { parameterLimit: 1 }); +// { a: 'b' } +``` + +An optional delimiter can also be passed: + +```javascript +Qs.parse('a=b;c=d', { delimiter: ';' }); +// { a: 'b', c: 'd' } +``` + +Delimiters can be a regular expression too: + +```javascript +Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); +// { a: 'b', c: 'd', e: 'f' } +``` + +Option `allowDots` can be used to enable dot notation: + +```javascript +Qs.parse('a.b=c', { allowDots: true }); +// { a: { b: 'c' } } +``` + +### Parsing Arrays + +**qs** can also parse arrays using a similar `[]` notation: + +```javascript +Qs.parse('a[]=b&a[]=c'); +// { a: ['b', 'c'] } +``` + +You may specify an index as well: + +```javascript +Qs.parse('a[1]=c&a[0]=b'); +// { a: ['b', 'c'] } +``` + +Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number +to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving +their order: + +```javascript +Qs.parse('a[1]=b&a[15]=c'); +// { a: ['b', 'c'] } +``` + +Note that an empty string is also a value, and will be preserved: + +```javascript +Qs.parse('a[]=&a[]=b'); +// { a: ['', 'b'] } +Qs.parse('a[0]=b&a[1]=&a[2]=c'); +// { a: ['b', '', 'c'] } +``` + +**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will +instead be converted to an object with the index as the key: + +```javascript +Qs.parse('a[100]=b'); +// { a: { '100': 'b' } } +``` + +This limit can be overridden by passing an `arrayLimit` option: + +```javascript +Qs.parse('a[1]=b', { arrayLimit: 0 }); +// { a: { '1': 'b' } } +``` + +To disable array parsing entirely, set `parseArrays` to `false`. + +```javascript +Qs.parse('a[]=b', { parseArrays: false }); +// { a: { '0': 'b' } } +``` + +If you mix notations, **qs** will merge the two items into an object: + +```javascript +Qs.parse('a[0]=b&a[b]=c'); +// { a: { '0': 'b', b: 'c' } } +``` + +You can also create arrays of objects: + +```javascript +Qs.parse('a[][b]=c'); +// { a: [{ b: 'c' }] } +``` + +### Stringifying + +```javascript +Qs.stringify(object, [options]); +``` + +When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect: + +```javascript +Qs.stringify({ a: 'b' }); +// 'a=b' +Qs.stringify({ a: { b: 'c' } }); +// 'a%5Bb%5D=c' +``` + +This encoding can be disabled by setting the `encode` option to `false`: + +```javascript +Qs.stringify({ a: { b: 'c' } }, { encode: false }); +// 'a[b]=c' +``` + +Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. + +When arrays are stringified, by default they are given explicit indices: + +```javascript +Qs.stringify({ a: ['b', 'c', 'd'] }); +// 'a[0]=b&a[1]=c&a[2]=d' +``` + +You may override this by setting the `indices` option to `false`: + +```javascript +Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); +// 'a=b&a=c&a=d' +``` + +You may use the `arrayFormat` option to specify the format of the output array + +```javascript +Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) +// 'a[0]=b&a[1]=c' +Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) +// 'a[]=b&a[]=c' +Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) +// 'a=b&a=c' +``` + +Empty strings and null values will omit the value, but the equals sign (=) remains in place: + +```javascript +Qs.stringify({ a: '' }); +// 'a=' +``` + +Properties that are set to `undefined` will be omitted entirely: + +```javascript +Qs.stringify({ a: null, b: undefined }); +// 'a=' +``` + +The delimiter may be overridden with stringify as well: + +```javascript +Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }); +// 'a=b;c=d' +``` + +Finally, you can use the `filter` option to restrict which keys will be included in the stringified output. +If you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you +pass an array, it will be used to select properties and array indices for stringification: + +```javascript +function filterFunc(prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; +} +Qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc }) +// 'a=b&c=d&e[f]=123&e[g][0]=4' +Qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }) +// 'a=b&e=f' +Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }) +// 'a[0]=b&a[2]=d' +``` + +### Handling of `null` values + +By default, `null` values are treated like empty strings: + +```javascript +Qs.stringify({ a: null, b: '' }); +// 'a=&b=' +``` + +Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings. + +```javascript +Qs.parse('a&b=') +// { a: '', b: '' } +``` + +To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null` +values have no `=` sign: + +```javascript +Qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); +// 'a&b=' +``` + +To parse values without `=` back to `null` use the `strictNullHandling` flag: + +```javascript +Qs.parse('a&b=', { strictNullHandling: true }); +// { a: null, b: '' } + +``` + +To completely skip rendering keys with `null` values, use the `skipNulls` flag: + +```javascript +qs.stringify({ a: 'b', c: null}, { skipNulls: true }) +// 'a=b' +``` diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/bower.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/bower.json new file mode 100644 index 00000000..53a70d0c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/bower.json @@ -0,0 +1,22 @@ +{ + "name": "qs", + "main": "dist/qs.js", + "version": "5.1.0", + "homepage": "https://github.com/hapijs/qs", + "authors": [ + "Nathan LaFreniere " + ], + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "keywords": [ + "querystring", + "qs" + ], + "license": "BSD-3-Clause", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/component.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/component.json new file mode 100644 index 00000000..1a1f72c7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/component.json @@ -0,0 +1,15 @@ +{ + "name": "qs", + "repository": "hapijs/qs", + "description": "query-string parser / stringifier with nesting support", + "version": "5.1.0", + "keywords": ["querystring", "query", "parser"], + "main": "lib/index.js", + "scripts": [ + "lib/index.js", + "lib/parse.js", + "lib/stringify.js", + "lib/utils.js" + ], + "license": "BSD-3-Clause" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/dist/qs.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/dist/qs.js new file mode 100644 index 00000000..b72e9768 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/dist/qs.js @@ -0,0 +1,544 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0 && + (options.parseArrays && + index <= options.arrayLimit)) { + + obj = []; + obj[index] = internals.parseObject(chain, val, options); + } + else { + obj[cleanRoot] = internals.parseObject(chain, val, options); + } + } + + return obj; +}; + + +internals.parseKeys = function (key, val, options) { + + if (!key) { + return; + } + + // Transform dot notation to bracket notation + + if (options.allowDots) { + key = key.replace(/\.([^\.\[]+)/g, '[$1]'); + } + + // The regex chunks + + var parent = /^([^\[\]]*)/; + var child = /(\[[^\[\]]*\])/g; + + // Get the parent + + var segment = parent.exec(key); + + // Stash the parent if it exists + + var keys = []; + if (segment[1]) { + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties + if (!options.plainObjects && + Object.prototype.hasOwnProperty(segment[1])) { + + if (!options.allowPrototypes) { + return; + } + } + + keys.push(segment[1]); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + + ++i; + if (!options.plainObjects && + Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + + if (!options.allowPrototypes) { + continue; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return internals.parseObject(keys, val, options); +}; + + +module.exports = function (str, options) { + + options = options || {}; + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; + + if (str === '' || + str === null || + typeof str === 'undefined') { + + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + var newObj = internals.parseKeys(key, tempObj[key], options); + obj = Utils.merge(obj, newObj, options); + } + + return Utils.compact(obj); +}; + +},{"./utils":4}],3:[function(require,module,exports){ +// Load modules + +var Utils = require('./utils'); + + +// Declare internals + +var internals = { + delimiter: '&', + arrayPrefixGenerators: { + brackets: function (prefix, key) { + + return prefix + '[]'; + }, + indices: function (prefix, key) { + + return prefix + '[' + key + ']'; + }, + repeat: function (prefix, key) { + + return prefix; + } + }, + strictNullHandling: false, + skipNulls: false, + encode: true +}; + + +internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter) { + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } + else if (Utils.isBuffer(obj)) { + obj = obj.toString(); + } + else if (obj instanceof Date) { + obj = obj.toISOString(); + } + else if (obj === null) { + if (strictNullHandling) { + return encode ? Utils.encode(prefix) : prefix; + } + + obj = ''; + } + + if (typeof obj === 'string' || + typeof obj === 'number' || + typeof obj === 'boolean') { + + if (encode) { + return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + } + return [prefix + '=' + obj]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys = Array.isArray(filter) ? filter : Object.keys(obj); + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + + if (skipNulls && + obj[key] === null) { + + continue; + } + + if (Array.isArray(obj)) { + values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + } + else { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + } + } + + return values; +}; + + +module.exports = function (obj, options) { + + options = options || {}; + var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var objKeys; + var filter; + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } + else if (Array.isArray(options.filter)) { + objKeys = filter = options.filter; + } + + var keys = []; + + if (typeof obj !== 'object' || + obj === null) { + + return ''; + } + + var arrayFormat; + if (options.arrayFormat in internals.arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } + else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; + } + else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + + if (skipNulls && + obj[key] === null) { + + continue; + } + + keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + } + + return keys.join(delimiter); +}; + +},{"./utils":4}],4:[function(require,module,exports){ +// Load modules + + +// Declare internals + +var internals = {}; +internals.hexTable = new Array(256); +for (var h = 0; h < 256; ++h) { + internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase(); +} + + +exports.arrayToObject = function (source, options) { + + var obj = options.plainObjects ? Object.create(null) : {}; + for (var i = 0, il = source.length; i < il; ++i) { + if (typeof source[i] !== 'undefined') { + + obj[i] = source[i]; + } + } + + return obj; +}; + + +exports.merge = function (target, source, options) { + + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } + else if (typeof target === 'object') { + target[source] = true; + } + else { + target = [target, source]; + } + + return target; + } + + if (typeof target !== 'object') { + target = [target].concat(source); + return target; + } + + if (Array.isArray(target) && + !Array.isArray(source)) { + + target = exports.arrayToObject(target, options); + } + + var keys = Object.keys(source); + for (var k = 0, kl = keys.length; k < kl; ++k) { + var key = keys[k]; + var value = source[key]; + + if (!Object.prototype.hasOwnProperty.call(target, key)) { + target[key] = value; + } + else { + target[key] = exports.merge(target[key], value, options); + } + } + + return target; +}; + + +exports.decode = function (str) { + + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } +}; + +exports.encode = function (str) { + + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + if (typeof str !== 'string') { + str = '' + str; + } + + var out = ''; + for (var i = 0, il = str.length; i < il; ++i) { + var c = str.charCodeAt(i); + + if (c === 0x2D || // - + c === 0x2E || // . + c === 0x5F || // _ + c === 0x7E || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5A) || // a-z + (c >= 0x61 && c <= 0x7A)) { // A-Z + + out += str[i]; + continue; + } + + if (c < 0x80) { + out += internals.hexTable[c]; + continue; + } + + if (c < 0x800) { + out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + continue; + } + + ++i; + c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF)); + out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + } + + return out; +}; + +exports.compact = function (obj, refs) { + + if (typeof obj !== 'object' || + obj === null) { + + return obj; + } + + refs = refs || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0, il = obj.length; i < il; ++i) { + if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + for (i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + obj[key] = exports.compact(obj[key], refs); + } + + return obj; +}; + + +exports.isRegExp = function (obj) { + + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + + +exports.isBuffer = function (obj) { + + if (obj === null || + typeof obj === 'undefined') { + + return false; + } + + return !!(obj.constructor && + obj.constructor.isBuffer && + obj.constructor.isBuffer(obj)); +}; + +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/index.js new file mode 100644 index 00000000..0e094933 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/index.js @@ -0,0 +1,15 @@ +// Load modules + +var Stringify = require('./stringify'); +var Parse = require('./parse'); + + +// Declare internals + +var internals = {}; + + +module.exports = { + stringify: Stringify, + parse: Parse +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/parse.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/parse.js new file mode 100644 index 00000000..4a2137ef --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/parse.js @@ -0,0 +1,187 @@ +// Load modules + +var Utils = require('./utils'); + + +// Declare internals + +var internals = { + delimiter: '&', + depth: 5, + arrayLimit: 20, + parameterLimit: 1000, + strictNullHandling: false, + plainObjects: false, + allowPrototypes: false, + allowDots: false +}; + + +internals.parseValues = function (str, options) { + + var obj = {}; + var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); + + for (var i = 0, il = parts.length; i < il; ++i) { + var part = parts[i]; + var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + + if (pos === -1) { + obj[Utils.decode(part)] = ''; + + if (options.strictNullHandling) { + obj[Utils.decode(part)] = null; + } + } + else { + var key = Utils.decode(part.slice(0, pos)); + var val = Utils.decode(part.slice(pos + 1)); + + if (!Object.prototype.hasOwnProperty.call(obj, key)) { + obj[key] = val; + } + else { + obj[key] = [].concat(obj[key]).concat(val); + } + } + } + + return obj; +}; + + +internals.parseObject = function (chain, val, options) { + + if (!chain.length) { + return val; + } + + var root = chain.shift(); + + var obj; + if (root === '[]') { + obj = []; + obj = obj.concat(internals.parseObject(chain, val, options)); + } + else { + obj = options.plainObjects ? Object.create(null) : {}; + var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; + var index = parseInt(cleanRoot, 10); + var indexString = '' + index; + if (!isNaN(index) && + root !== cleanRoot && + indexString === cleanRoot && + index >= 0 && + (options.parseArrays && + index <= options.arrayLimit)) { + + obj = []; + obj[index] = internals.parseObject(chain, val, options); + } + else { + obj[cleanRoot] = internals.parseObject(chain, val, options); + } + } + + return obj; +}; + + +internals.parseKeys = function (key, val, options) { + + if (!key) { + return; + } + + // Transform dot notation to bracket notation + + if (options.allowDots) { + key = key.replace(/\.([^\.\[]+)/g, '[$1]'); + } + + // The regex chunks + + var parent = /^([^\[\]]*)/; + var child = /(\[[^\[\]]*\])/g; + + // Get the parent + + var segment = parent.exec(key); + + // Stash the parent if it exists + + var keys = []; + if (segment[1]) { + // If we aren't using plain objects, optionally prefix keys + // that would overwrite object prototype properties + if (!options.plainObjects && + Object.prototype.hasOwnProperty(segment[1])) { + + if (!options.allowPrototypes) { + return; + } + } + + keys.push(segment[1]); + } + + // Loop through children appending to the array until we hit depth + + var i = 0; + while ((segment = child.exec(key)) !== null && i < options.depth) { + + ++i; + if (!options.plainObjects && + Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + + if (!options.allowPrototypes) { + continue; + } + } + keys.push(segment[1]); + } + + // If there's a remainder, just add whatever is left + + if (segment) { + keys.push('[' + key.slice(segment.index) + ']'); + } + + return internals.parseObject(keys, val, options); +}; + + +module.exports = function (str, options) { + + options = options || {}; + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + options.parseArrays = options.parseArrays !== false; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; + + if (str === '' || + str === null || + typeof str === 'undefined') { + + return options.plainObjects ? Object.create(null) : {}; + } + + var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var obj = options.plainObjects ? Object.create(null) : {}; + + // Iterate over the keys and setup the new object + + var keys = Object.keys(tempObj); + for (var i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + var newObj = internals.parseKeys(key, tempObj[key], options); + obj = Utils.merge(obj, newObj, options); + } + + return Utils.compact(obj); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/stringify.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/stringify.js new file mode 100644 index 00000000..d05aa875 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/stringify.js @@ -0,0 +1,154 @@ +// Load modules + +var Utils = require('./utils'); + + +// Declare internals + +var internals = { + delimiter: '&', + arrayPrefixGenerators: { + brackets: function (prefix, key) { + + return prefix + '[]'; + }, + indices: function (prefix, key) { + + return prefix + '[' + key + ']'; + }, + repeat: function (prefix, key) { + + return prefix; + } + }, + strictNullHandling: false, + skipNulls: false, + encode: true +}; + + +internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) { + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } + else if (Utils.isBuffer(obj)) { + obj = obj.toString(); + } + else if (obj instanceof Date) { + obj = obj.toISOString(); + } + else if (obj === null) { + if (strictNullHandling) { + return encode ? Utils.encode(prefix) : prefix; + } + + obj = ''; + } + + if (typeof obj === 'string' || + typeof obj === 'number' || + typeof obj === 'boolean') { + + if (encode) { + return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + } + return [prefix + '=' + obj]; + } + + var values = []; + + if (typeof obj === 'undefined') { + return values; + } + + var objKeys; + if (Array.isArray(filter)) { + objKeys = filter; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + + if (skipNulls && + obj[key] === null) { + + continue; + } + + if (Array.isArray(obj)) { + values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + } + else { + values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter)); + } + } + + return values; +}; + + +module.exports = function (obj, options) { + + options = options || {}; + var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var sort = typeof options.sort === 'function' ? options.sort : null; + var objKeys; + var filter; + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } + else if (Array.isArray(options.filter)) { + objKeys = filter = options.filter; + } + + var keys = []; + + if (typeof obj !== 'object' || + obj === null) { + + return ''; + } + + var arrayFormat; + if (options.arrayFormat in internals.arrayPrefixGenerators) { + arrayFormat = options.arrayFormat; + } + else if ('indices' in options) { + arrayFormat = options.indices ? 'indices' : 'repeat'; + } + else { + arrayFormat = 'indices'; + } + + var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; + + if (!objKeys) { + objKeys = Object.keys(obj); + } + + if (sort) { + objKeys.sort(sort); + } + + for (var i = 0, il = objKeys.length; i < il; ++i) { + var key = objKeys[i]; + + if (skipNulls && + obj[key] === null) { + + continue; + } + + keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort)); + } + + return keys.join(delimiter); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/utils.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/utils.js new file mode 100644 index 00000000..88f31473 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/lib/utils.js @@ -0,0 +1,190 @@ +// Load modules + + +// Declare internals + +var internals = {}; +internals.hexTable = new Array(256); +for (var h = 0; h < 256; ++h) { + internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase(); +} + + +exports.arrayToObject = function (source, options) { + + var obj = options.plainObjects ? Object.create(null) : {}; + for (var i = 0, il = source.length; i < il; ++i) { + if (typeof source[i] !== 'undefined') { + + obj[i] = source[i]; + } + } + + return obj; +}; + + +exports.merge = function (target, source, options) { + + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (Array.isArray(target)) { + target.push(source); + } + else if (typeof target === 'object') { + target[source] = true; + } + else { + target = [target, source]; + } + + return target; + } + + if (typeof target !== 'object') { + target = [target].concat(source); + return target; + } + + if (Array.isArray(target) && + !Array.isArray(source)) { + + target = exports.arrayToObject(target, options); + } + + var keys = Object.keys(source); + for (var k = 0, kl = keys.length; k < kl; ++k) { + var key = keys[k]; + var value = source[key]; + + if (!Object.prototype.hasOwnProperty.call(target, key)) { + target[key] = value; + } + else { + target[key] = exports.merge(target[key], value, options); + } + } + + return target; +}; + + +exports.decode = function (str) { + + try { + return decodeURIComponent(str.replace(/\+/g, ' ')); + } catch (e) { + return str; + } +}; + +exports.encode = function (str) { + + // This code was originally written by Brian White (mscdex) for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + if (typeof str !== 'string') { + str = '' + str; + } + + var out = ''; + for (var i = 0, il = str.length; i < il; ++i) { + var c = str.charCodeAt(i); + + if (c === 0x2D || // - + c === 0x2E || // . + c === 0x5F || // _ + c === 0x7E || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5A) || // a-z + (c >= 0x61 && c <= 0x7A)) { // A-Z + + out += str[i]; + continue; + } + + if (c < 0x80) { + out += internals.hexTable[c]; + continue; + } + + if (c < 0x800) { + out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)]; + continue; + } + + if (c < 0xD800 || c >= 0xE000) { + out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + continue; + } + + ++i; + c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF)); + out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)]; + } + + return out; +}; + +exports.compact = function (obj, refs) { + + if (typeof obj !== 'object' || + obj === null) { + + return obj; + } + + refs = refs || []; + var lookup = refs.indexOf(obj); + if (lookup !== -1) { + return refs[lookup]; + } + + refs.push(obj); + + if (Array.isArray(obj)) { + var compacted = []; + + for (var i = 0, il = obj.length; i < il; ++i) { + if (typeof obj[i] !== 'undefined') { + compacted.push(obj[i]); + } + } + + return compacted; + } + + var keys = Object.keys(obj); + for (i = 0, il = keys.length; i < il; ++i) { + var key = keys[i]; + obj[key] = exports.compact(obj[key], refs); + } + + return obj; +}; + + +exports.isRegExp = function (obj) { + + return Object.prototype.toString.call(obj) === '[object RegExp]'; +}; + + +exports.isBuffer = function (obj) { + + if (obj === null || + typeof obj === 'undefined') { + + return false; + } + + return !!(obj.constructor && + obj.constructor.isBuffer && + obj.constructor.isBuffer(obj)); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/package.json new file mode 100644 index 00000000..7e60df70 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/package.json @@ -0,0 +1,59 @@ +{ + "name": "qs", + "description": "A querystring parser that supports nesting and arrays, with a depth limit", + "homepage": "https://github.com/hapijs/qs", + "version": "5.2.0", + "repository": { + "type": "git", + "url": "git+https://github.com/hapijs/qs.git" + }, + "main": "lib/index.js", + "keywords": [ + "querystring", + "qs" + ], + "engines": ">=0.10.40", + "dependencies": {}, + "devDependencies": { + "browserify": "^10.2.1", + "code": "1.x.x", + "lab": "5.x.x" + }, + "scripts": { + "test": "lab -a code -t 100 -L", + "test-tap": "lab -a code -r tap -o tests.tap", + "test-cov-html": "lab -a code -r html -o coverage.html", + "dist": "browserify --standalone Qs lib/index.js > dist/qs.js" + }, + "license": "BSD-3-Clause", + "gitHead": "a341cdf2fadba5ede1ce6c95c7051f6f31f37b81", + "bugs": { + "url": "https://github.com/hapijs/qs/issues" + }, + "_id": "qs@5.2.0", + "_shasum": "a9f31142af468cb72b25b30136ba2456834916be", + "_from": "qs@>=5.2.0 <5.3.0", + "_npmVersion": "3.3.5", + "_nodeVersion": "0.10.40", + "_npmUser": { + "name": "nlf", + "email": "quitlahok@gmail.com" + }, + "dist": { + "shasum": "a9f31142af468cb72b25b30136ba2456834916be", + "tarball": "http://registry.npmjs.org/qs/-/qs-5.2.0.tgz" + }, + "maintainers": [ + { + "name": "nlf", + "email": "quitlahok@gmail.com" + }, + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/parse.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/parse.js new file mode 100644 index 00000000..679f1974 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/parse.js @@ -0,0 +1,478 @@ +/* eslint no-extend-native:0 */ +// Load modules + +var Code = require('code'); +var Lab = require('lab'); +var Qs = require('../'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var expect = Code.expect; +var describe = lab.experiment; +var it = lab.test; + + +describe('parse()', function () { + + it('parses a simple string', function (done) { + + expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' }); + expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c ' }); + expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } }); + expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } }); + expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } }); + expect(Qs.parse('foo', { strictNullHandling: true })).to.deep.equal({ foo: null }); + expect(Qs.parse('foo' )).to.deep.equal({ foo: '' }); + expect(Qs.parse('foo=')).to.deep.equal({ foo: '' }); + expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' }); + expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' }); + expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' }); + expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' }); + expect(Qs.parse('foo2=bar2&baz2=')).to.deep.equal({ foo2: 'bar2', baz2: '' }); + expect(Qs.parse('foo=bar&baz', { strictNullHandling: true })).to.deep.equal({ foo: 'bar', baz: null }); + expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' }); + expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({ + cht: 'p3', + chd: 't:60,40', + chs: '250x100', + chl: 'Hello|World' + }); + done(); + }); + + it('allows enabling dot notation', function (done) { + + expect(Qs.parse('a.b=c')).to.deep.equal({ 'a.b': 'c' }); + expect(Qs.parse('a.b=c', { allowDots: true })).to.deep.equal({ a: { b: 'c' } }); + done(); + }); + + it('parses a single nested string', function (done) { + + expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } }); + done(); + }); + + it('parses a double nested string', function (done) { + + expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } }); + done(); + }); + + it('defaults to a depth of 5', function (done) { + + expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } }); + done(); + }); + + it('only parses one level when depth = 1', function (done) { + + expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } }); + expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } }); + done(); + }); + + it('parses a simple array', function (done) { + + expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + done(); + }); + + it('parses an explicit array', function (done) { + + expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] }); + expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); + done(); + }); + + it('parses a mix of simple and explicit arrays', function (done) { + + expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] }); + done(); + }); + + it('parses a nested array', function (done) { + + expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } }); + expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } }); + done(); + }); + + it('allows to specify array indices', function (done) { + + expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] }); + expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] }); + expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] }); + done(); + }); + + it('limits specific array indices to 20', function (done) { + + expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] }); + expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } }); + done(); + }); + + it('supports keys that begin with a number', function (done) { + + expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } }); + done(); + }); + + it('supports encoded = signs', function (done) { + + expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' }); + done(); + }); + + it('is ok with url encoded strings', function (done) { + + expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } }); + expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } }); + done(); + }); + + it('allows brackets in the value', function (done) { + + expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' }); + expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' }); + done(); + }); + + it('allows empty values', function (done) { + + expect(Qs.parse('')).to.deep.equal({}); + expect(Qs.parse(null)).to.deep.equal({}); + expect(Qs.parse(undefined)).to.deep.equal({}); + done(); + }); + + it('transforms arrays to objects', function (done) { + + expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); + expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); + expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); + expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); + expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); + expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + expect(Qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c')).to.deep.equal({ a: { '0': 'b', t: 'u', c: true } }); + expect(Qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y')).to.deep.equal({ a: { '0': 'b', '1': 'c', x: 'y' } }); + done(); + }); + + it('transforms arrays to objects (dot notation)', function (done) { + + expect(Qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } }); + expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } }); + expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } }); + expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] }); + expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] }); + expect(Qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); + expect(Qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } }); + expect(Qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true })).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } }); + expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); + expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true })).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); + done(); + }); + + it('can add keys to objects', function (done) { + + expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } }); + done(); + }); + + it('correctly prunes undefined values when converting an array to an object', function (done) { + + expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } }); + done(); + }); + + it('supports malformed uri characters', function (done) { + + expect(Qs.parse('{%:%}', { strictNullHandling: true })).to.deep.equal({ '{%:%}': null }); + expect(Qs.parse('{%:%}=')).to.deep.equal({ '{%:%}': '' }); + expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' }); + done(); + }); + + it('doesn\'t produce empty keys', function (done) { + + expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' }); + done(); + }); + + it('cannot access Object prototype', function (done) { + + Qs.parse('constructor[prototype][bad]=bad'); + Qs.parse('bad[constructor][prototype][bad]=bad'); + expect(typeof Object.prototype.bad).to.equal('undefined'); + done(); + }); + + it('parses arrays of objects', function (done) { + + expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); + expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); + done(); + }); + + it('allows for empty strings in arrays', function (done) { + + expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] }); + expect(Qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true })).to.deep.equal({ a: ['b', null, 'c', ''] }); + expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true })).to.deep.equal({ a: ['b', '', 'c', null] }); + expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] }); + done(); + }); + + it('compacts sparse arrays', function (done) { + + expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] }); + done(); + }); + + it('parses semi-parsed strings', function (done) { + + expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } }); + expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } }); + done(); + }); + + it('parses buffers correctly', function (done) { + + var b = new Buffer('test'); + expect(Qs.parse({ a: b })).to.deep.equal({ a: b }); + done(); + }); + + it('continues parsing when no parent is found', function (done) { + + expect(Qs.parse('[]=&a=b')).to.deep.equal({ '0': '', a: 'b' }); + expect(Qs.parse('[]&a=b', { strictNullHandling: true })).to.deep.equal({ '0': null, a: 'b' }); + expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' }); + done(); + }); + + it('does not error when parsing a very long array', function (done) { + + var str = 'a[]=a'; + while (Buffer.byteLength(str) < 128 * 1024) { + str += '&' + str; + } + + expect(function () { + + Qs.parse(str); + }).to.not.throw(); + + done(); + }); + + it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) { + + Object.prototype.crash = ''; + Array.prototype.crash = ''; + expect(Qs.parse.bind(null, 'a=b')).to.not.throw(); + expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' }); + expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw(); + expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] }); + delete Object.prototype.crash; + delete Array.prototype.crash; + done(); + }); + + it('parses a string with an alternative string delimiter', function (done) { + + expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('parses a string with an alternative RegExp delimiter', function (done) { + + expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('does not use non-splittable objects as delimiters', function (done) { + + expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('allows overriding parameter limit', function (done) { + + expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' }); + done(); + }); + + it('allows setting the parameter limit to Infinity', function (done) { + + expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('allows overriding array limit', function (done) { + + expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } }); + expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } }); + expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); + done(); + }); + + it('allows disabling array parsing', function (done) { + + expect(Qs.parse('a[0]=b&a[1]=c', { parseArrays: false })).to.deep.equal({ a: { '0': 'b', '1': 'c' } }); + done(); + }); + + it('parses an object', function (done) { + + var input = { + 'user[name]': { 'pop[bob]': 3 }, + 'user[email]': null + }; + + var expected = { + 'user': { + 'name': { 'pop[bob]': 3 }, + 'email': null + } + }; + + var result = Qs.parse(input); + + expect(result).to.deep.equal(expected); + done(); + }); + + it('parses an object in dot notation', function (done) { + + var input = { + 'user.name': { 'pop[bob]': 3 }, + 'user.email.': null + }; + + var expected = { + 'user': { + 'name': { 'pop[bob]': 3 }, + 'email': null + } + }; + + var result = Qs.parse(input, { allowDots: true }); + + expect(result).to.deep.equal(expected); + done(); + }); + + it('parses an object and not child values', function (done) { + + var input = { + 'user[name]': { 'pop[bob]': { 'test': 3 } }, + 'user[email]': null + }; + + var expected = { + 'user': { + 'name': { 'pop[bob]': { 'test': 3 } }, + 'email': null + } + }; + + var result = Qs.parse(input); + + expect(result).to.deep.equal(expected); + done(); + }); + + it('does not blow up when Buffer global is missing', function (done) { + + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = Qs.parse('a=b&c=d'); + global.Buffer = tempBuffer; + expect(result).to.deep.equal({ a: 'b', c: 'd' }); + done(); + }); + + it('does not crash when parsing circular references', function (done) { + + var a = {}; + a.b = a; + + var parsed; + + expect(function () { + + parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a }); + }).to.not.throw(); + + expect(parsed).to.contain('foo'); + expect(parsed.foo).to.contain('bar', 'baz'); + expect(parsed.foo.bar).to.equal('baz'); + expect(parsed.foo.baz).to.deep.equal(a); + done(); + }); + + it('parses plain objects correctly', function (done) { + + var a = Object.create(null); + a.b = 'c'; + + expect(Qs.parse(a)).to.deep.equal({ b: 'c' }); + var result = Qs.parse({ a: a }); + expect(result).to.contain('a'); + expect(result.a).to.deep.equal(a); + done(); + }); + + it('parses dates correctly', function (done) { + + var now = new Date(); + expect(Qs.parse({ a: now })).to.deep.equal({ a: now }); + done(); + }); + + it('parses regular expressions correctly', function (done) { + + var re = /^test$/; + expect(Qs.parse({ a: re })).to.deep.equal({ a: re }); + done(); + }); + + it('can allow overwriting prototype properties', function (done) { + + expect(Qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true })).to.deep.equal({ a: { hasOwnProperty: 'b' } }, { prototype: false }); + expect(Qs.parse('hasOwnProperty=b', { allowPrototypes: true })).to.deep.equal({ hasOwnProperty: 'b' }, { prototype: false }); + done(); + }); + + it('can return plain objects', function (done) { + + var expected = Object.create(null); + expected.a = Object.create(null); + expected.a.b = 'c'; + expected.a.hasOwnProperty = 'd'; + expect(Qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true })).to.deep.equal(expected); + expect(Qs.parse(null, { plainObjects: true })).to.deep.equal(Object.create(null)); + var expectedArray = Object.create(null); + expectedArray.a = Object.create(null); + expectedArray.a['0'] = 'b'; + expectedArray.a.c = 'd'; + expect(Qs.parse('a[]=b&a[c]=d', { plainObjects: true })).to.deep.equal(expectedArray); + done(); + }); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/stringify.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/stringify.js new file mode 100644 index 00000000..53139ff9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/stringify.js @@ -0,0 +1,293 @@ +/* eslint no-extend-native:0 */ +// Load modules + +var Code = require('code'); +var Lab = require('lab'); +var Qs = require('../'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var expect = Code.expect; +var describe = lab.experiment; +var it = lab.test; + + +describe('stringify()', function () { + + it('stringifies a querystring object', function (done) { + + expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); + expect(Qs.stringify({ a: 1 })).to.equal('a=1'); + expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2'); + expect(Qs.stringify({ a: 'A_Z' })).to.equal('a=A_Z'); + expect(Qs.stringify({ a: '€' })).to.equal('a=%E2%82%AC'); + expect(Qs.stringify({ a: '' })).to.equal('a=%EE%80%80'); + expect(Qs.stringify({ a: 'א' })).to.equal('a=%D7%90'); + expect(Qs.stringify({ a: '𐐷' })).to.equal('a=%F0%90%90%B7'); + done(); + }); + + it('stringifies a nested object', function (done) { + + expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); + expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e'); + done(); + }); + + it('stringifies an array value', function (done) { + + expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d'); + done(); + }); + + it('omits nulls when asked', function (done) { + + expect(Qs.stringify({ a: 'b', c: null }, { skipNulls: true })).to.equal('a=b'); + done(); + }); + + + it('omits nested nulls when asked', function (done) { + + expect(Qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true })).to.equal('a%5Bb%5D=c'); + done(); + }); + + it('omits array indices when asked', function (done) { + + expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d'); + done(); + }); + + it('stringifies a nested array value', function (done) { + + expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d'); + done(); + }); + + it('stringifies an object inside an array', function (done) { + + expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c'); + expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1'); + done(); + }); + + it('does not omit object keys when indices = false', function (done) { + + expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c'); + done(); + }); + + it('uses indices notation for arrays when indices=true', function (done) { + + expect(Qs.stringify({ a: ['b', 'c'] }, { indices: true })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); + done(); + }); + + it('uses indices notation for arrays when no arrayFormat is specified', function (done) { + + expect(Qs.stringify({ a: ['b', 'c'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); + done(); + }); + + it('uses indices notation for arrays when no arrayFormat=indices', function (done) { + + expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).to.equal('a%5B0%5D=b&a%5B1%5D=c'); + done(); + }); + + it('uses repeat notation for arrays when no arrayFormat=repeat', function (done) { + + expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).to.equal('a=b&a=c'); + done(); + }); + + it('uses brackets notation for arrays when no arrayFormat=brackets', function (done) { + + expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).to.equal('a%5B%5D=b&a%5B%5D=c'); + done(); + }); + + it('stringifies a complicated object', function (done) { + + expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e'); + done(); + }); + + it('stringifies an empty value', function (done) { + + expect(Qs.stringify({ a: '' })).to.equal('a='); + expect(Qs.stringify({ a: null }, { strictNullHandling: true })).to.equal('a'); + + expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b='); + expect(Qs.stringify({ a: null, b: '' }, { strictNullHandling: true })).to.equal('a&b='); + + expect(Qs.stringify({ a: { b: '' } })).to.equal('a%5Bb%5D='); + expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: true })).to.equal('a%5Bb%5D'); + expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: false })).to.equal('a%5Bb%5D='); + + done(); + }); + + it('stringifies an empty object', function (done) { + + var obj = Object.create(null); + obj.a = 'b'; + expect(Qs.stringify(obj)).to.equal('a=b'); + done(); + }); + + it('returns an empty string for invalid input', function (done) { + + expect(Qs.stringify(undefined)).to.equal(''); + expect(Qs.stringify(false)).to.equal(''); + expect(Qs.stringify(null)).to.equal(''); + expect(Qs.stringify('')).to.equal(''); + done(); + }); + + it('stringifies an object with an empty object as a child', function (done) { + + var obj = { + a: Object.create(null) + }; + + obj.a.b = 'c'; + expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c'); + done(); + }); + + it('drops keys with a value of undefined', function (done) { + + expect(Qs.stringify({ a: undefined })).to.equal(''); + + expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).to.equal('a%5Bc%5D'); + expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).to.equal('a%5Bc%5D='); + expect(Qs.stringify({ a: { b: undefined, c: '' } })).to.equal('a%5Bc%5D='); + done(); + }); + + it('url encodes values', function (done) { + + expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c'); + done(); + }); + + it('stringifies a date', function (done) { + + var now = new Date(); + var str = 'a=' + encodeURIComponent(now.toISOString()); + expect(Qs.stringify({ a: now })).to.equal(str); + done(); + }); + + it('stringifies the weird object from qs', function (done) { + + expect(Qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F'); + done(); + }); + + it('skips properties that are part of the object prototype', function (done) { + + Object.prototype.crash = 'test'; + expect(Qs.stringify({ a: 'b' })).to.equal('a=b'); + expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c'); + delete Object.prototype.crash; + done(); + }); + + it('stringifies boolean values', function (done) { + + expect(Qs.stringify({ a: true })).to.equal('a=true'); + expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true'); + expect(Qs.stringify({ b: false })).to.equal('b=false'); + expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false'); + done(); + }); + + it('stringifies buffer values', function (done) { + + expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test'); + expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test'); + done(); + }); + + it('stringifies an object using an alternative delimiter', function (done) { + + expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d'); + done(); + }); + + it('doesn\'t blow up when Buffer global is missing', function (done) { + + var tempBuffer = global.Buffer; + delete global.Buffer; + var result = Qs.stringify({ a: 'b', c: 'd' }); + global.Buffer = tempBuffer; + expect(result).to.equal('a=b&c=d'); + done(); + }); + + it('selects properties when filter=array', function (done) { + + expect(Qs.stringify({ a: 'b' }, { filter: ['a'] })).to.equal('a=b'); + expect(Qs.stringify({ a: 1 }, { filter: [] })).to.equal(''); + expect(Qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).to.equal('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3'); + done(); + + }); + + it('supports custom representations when filter=function', function (done) { + + var calls = 0; + var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } }; + var filterFunc = function (prefix, value) { + + calls++; + if (calls === 1) { + expect(prefix).to.be.empty(); + expect(value).to.equal(obj); + } + else if (prefix === 'c') { + return; + } + else if (value instanceof Date) { + expect(prefix).to.equal('e[f]'); + return value.getTime(); + } + return value; + }; + + expect(Qs.stringify(obj, { filter: filterFunc })).to.equal('a=b&e%5Bf%5D=1257894000000'); + expect(calls).to.equal(5); + done(); + + }); + + it('can disable uri encoding', function (done) { + + expect(Qs.stringify({ a: 'b' }, { encode: false })).to.equal('a=b'); + expect(Qs.stringify({ a: { b: 'c' } }, { encode: false })).to.equal('a[b]=c'); + expect(Qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false })).to.equal('a=b&c'); + done(); + }); + + it('can sort the keys', function (done) { + + var sort = function alphabeticalSort (a, b) { + + return a.localeCompare(b); + }; + + expect(Qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort : sort })).to.equal('a=c&b=f&z=y'); + expect(Qs.stringify({ a: 'c', z: { j: 'a', i:'b' }, b : 'f' }, { sort : sort })).to.equal('a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a'); + done(); + }); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/utils.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/utils.js new file mode 100644 index 00000000..a9a6b520 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/qs/test/utils.js @@ -0,0 +1,28 @@ +// Load modules + +var Code = require('code'); +var Lab = require('lab'); +var Utils = require('../lib/utils'); + + +// Declare internals + +var internals = {}; + + +// Test shortcuts + +var lab = exports.lab = Lab.script(); +var expect = Code.expect; +var describe = lab.experiment; +var it = lab.test; + + +describe('merge()', function () { + + it('can merge two objects with the same key', function (done) { + + expect(Utils.merge({ a: 'b' }, { a: 'c' })).to.deep.equal({ a: ['b', 'c'] }); + done(); + }); +}); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/.npmignore new file mode 100644 index 00000000..7dccd970 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/.npmignore @@ -0,0 +1,15 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules +npm-debug.log \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/.travis.yml new file mode 100644 index 00000000..f1d0f13c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/.travis.yml @@ -0,0 +1,4 @@ +language: node_js +node_js: + - 0.4 + - 0.6 diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/LICENSE.txt b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/LICENSE.txt new file mode 100644 index 00000000..ab861acd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2012 Michael Hart (michael.hart.au@gmail.com) + +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/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/README.md new file mode 100644 index 00000000..32fc9825 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/README.md @@ -0,0 +1,38 @@ +# Decode streams into strings The Right Way(tm) + +```javascript +var fs = require('fs') +var zlib = require('zlib') +var strs = require('stringstream') + +var utf8Stream = fs.createReadStream('massiveLogFile.gz') + .pipe(zlib.createGunzip()) + .pipe(strs('utf8')) +``` + +No need to deal with `setEncoding()` weirdness, just compose streams +like they were supposed to be! + +Handles input and output encoding: + +```javascript +// Stream from utf8 to hex to base64... Why not, ay. +var hex64Stream = fs.createReadStream('myFile') + .pipe(strs('utf8', 'hex')) + .pipe(strs('hex', 'base64')) +``` + +Also deals with `base64` output correctly by aligning each emitted data +chunk so that there are no dangling `=` characters: + +```javascript +var stream = fs.createReadStream('myFile').pipe(strs('base64')) + +var base64Str = '' + +stream.on('data', function(data) { base64Str += data }) +stream.on('end', function() { + console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() + console.log('Original file is: ' + new Buffer(base64Str, 'base64')) +}) +``` diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/example.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/example.js new file mode 100644 index 00000000..f82b85ed --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/example.js @@ -0,0 +1,27 @@ +var fs = require('fs') +var zlib = require('zlib') +var strs = require('stringstream') + +var utf8Stream = fs.createReadStream('massiveLogFile.gz') + .pipe(zlib.createGunzip()) + .pipe(strs('utf8')) + +utf8Stream.pipe(process.stdout) + +// Stream from utf8 to hex to base64... Why not, ay. +var hex64Stream = fs.createReadStream('myFile') + .pipe(strs('utf8', 'hex')) + .pipe(strs('hex', 'base64')) + +hex64Stream.pipe(process.stdout) + +// Deals with base64 correctly by aligning chunks +var stream = fs.createReadStream('myFile').pipe(strs('base64')) + +var base64Str = '' + +stream.on('data', function(data) { base64Str += data }) +stream.on('end', function() { + console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding() + console.log('Original file is: ' + new Buffer(base64Str, 'base64')) +}) diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/package.json new file mode 100644 index 00000000..39474baa --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/package.json @@ -0,0 +1,50 @@ +{ + "name": "stringstream", + "version": "0.0.5", + "description": "Encode and decode streams into string streams", + "author": { + "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", + "url": "http://github.com/mhart" + }, + "main": "stringstream.js", + "keywords": [ + "string", + "stream", + "base64", + "gzip" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/mhart/StringStream.git" + }, + "license": "MIT", + "gitHead": "1efe3bf507bf3a1161f8473908b60e881d41422b", + "bugs": { + "url": "https://github.com/mhart/StringStream/issues" + }, + "homepage": "https://github.com/mhart/StringStream#readme", + "_id": "stringstream@0.0.5", + "scripts": {}, + "_shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "_from": "stringstream@>=0.0.4 <0.1.0", + "_npmVersion": "2.14.8", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + }, + "maintainers": [ + { + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" + } + ], + "dist": { + "shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", + "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/stringstream.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/stringstream.js new file mode 100644 index 00000000..4ece1275 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/stringstream/stringstream.js @@ -0,0 +1,102 @@ +var util = require('util') +var Stream = require('stream') +var StringDecoder = require('string_decoder').StringDecoder + +module.exports = StringStream +module.exports.AlignedStringDecoder = AlignedStringDecoder + +function StringStream(from, to) { + if (!(this instanceof StringStream)) return new StringStream(from, to) + + Stream.call(this) + + if (from == null) from = 'utf8' + + this.readable = this.writable = true + this.paused = false + this.toEncoding = (to == null ? from : to) + this.fromEncoding = (to == null ? '' : from) + this.decoder = new AlignedStringDecoder(this.toEncoding) +} +util.inherits(StringStream, Stream) + +StringStream.prototype.write = function(data) { + if (!this.writable) { + var err = new Error('stream not writable') + err.code = 'EPIPE' + this.emit('error', err) + return false + } + if (this.fromEncoding) { + if (Buffer.isBuffer(data)) data = data.toString() + data = new Buffer(data, this.fromEncoding) + } + var string = this.decoder.write(data) + if (string.length) this.emit('data', string) + return !this.paused +} + +StringStream.prototype.flush = function() { + if (this.decoder.flush) { + var string = this.decoder.flush() + if (string.length) this.emit('data', string) + } +} + +StringStream.prototype.end = function() { + if (!this.writable && !this.readable) return + this.flush() + this.emit('end') + this.writable = this.readable = false + this.destroy() +} + +StringStream.prototype.destroy = function() { + this.decoder = null + this.writable = this.readable = false + this.emit('close') +} + +StringStream.prototype.pause = function() { + this.paused = true +} + +StringStream.prototype.resume = function () { + if (this.paused) this.emit('drain') + this.paused = false +} + +function AlignedStringDecoder(encoding) { + StringDecoder.call(this, encoding) + + switch (this.encoding) { + case 'base64': + this.write = alignedWrite + this.alignedBuffer = new Buffer(3) + this.alignedBytes = 0 + break + } +} +util.inherits(AlignedStringDecoder, StringDecoder) + +AlignedStringDecoder.prototype.flush = function() { + if (!this.alignedBuffer || !this.alignedBytes) return '' + var leftover = this.alignedBuffer.toString(this.encoding, 0, this.alignedBytes) + this.alignedBytes = 0 + return leftover +} + +function alignedWrite(buffer) { + var rem = (this.alignedBytes + buffer.length) % this.alignedBuffer.length + if (!rem && !this.alignedBytes) return buffer.toString(this.encoding) + + var returnBuffer = new Buffer(this.alignedBytes + buffer.length - rem) + + this.alignedBuffer.copy(returnBuffer, 0, 0, this.alignedBytes) + buffer.copy(returnBuffer, this.alignedBytes, 0, buffer.length - rem) + + buffer.copy(this.alignedBuffer, 0, buffer.length - rem, buffer.length) + this.alignedBytes = rem + + return returnBuffer.toString(this.encoding) +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/LICENSE new file mode 100644 index 00000000..1bc286fb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2015, Salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +=== + +The following exceptions apply: + +=== + +`public_suffix_list.dat` was obtained from + via +. The license for this file is MPL/2.0. The header of +that file reads as follows: + + // This Source Code Form is subject to the terms of the Mozilla Public + // License, v. 2.0. If a copy of the MPL was not distributed with this + // file, You can obtain one at http://mozilla.org/MPL/2.0/. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/README.md new file mode 100644 index 00000000..9899dbf6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/README.md @@ -0,0 +1,492 @@ +[RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js + +[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie) + +[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie) +![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9) + +# Synopsis + +``` javascript +var tough = require('tough-cookie'); +var Cookie = tough.Cookie; +var cookie = Cookie.parse(header); +cookie.value = 'somethingdifferent'; +header = cookie.toString(); + +var cookiejar = new tough.CookieJar(); +cookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb); +// ... +cookiejar.getCookies('http://example.com/otherpath',function(err,cookies) { + res.headers['cookie'] = cookies.join('; '); +}); +``` + +# Installation + +It's _so_ easy! + +`npm install tough-cookie` + +Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken. + +# API + +## tough + +Functions on the module you get from `require('tough-cookie')`. All can be used as pure functions and don't need to be "bound". + +**Note**: prior to 1.0.x, several of these functions took a `strict` parameter. This has since been removed from the API as it was no longer necessary. + +### `parseDate(string)` + +Parse a cookie date string into a `Date`. Parses according to RFC6265 Section 5.1.1, not `Date.parse()`. + +### `formatDate(date)` + +Format a Date into a RFC1123 string (the RFC6265-recommended format). + +### `canonicalDomain(str)` + +Transforms a domain-name into a canonical domain-name. The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265). For the most part, this function is idempotent (can be run again on its output without ill effects). + +### `domainMatch(str,domStr[,canonicalize=true])` + +Answers "does this real domain match the domain in a cookie?". The `str` is the "current" domain-name and the `domStr` is the "cookie" domain-name. Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a "suffix match". + +The `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not. + +### `defaultPath(path)` + +Given a current request/response path, gives the Path apropriate for storing in a cookie. This is basically the "directory" of a "file" in the path, but is specified by Section 5.1.4 of the RFC. + +The `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.). This is the `.pathname` property of node's `uri.parse()` output. + +### `pathMatch(reqPath,cookiePath)` + +Answers "does the request-path path-match a given cookie-path?" as per RFC6265 Section 5.1.4. Returns a boolean. + +This is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`. + +### `parse(cookieString[, options])` + +alias for `Cookie.parse(cookieString[, options])` + +### `fromJSON(string)` + +alias for `Cookie.fromJSON(string)` + +### `getPublicSuffix(hostname)` + +Returns the public suffix of this hostname. The public suffix is the shortest domain-name upon which a cookie can be set. Returns `null` if the hostname cannot have cookies set for it. + +For example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`. + +For further information, see http://publicsuffix.org/. This module derives its list from that site. + +### `cookieCompare(a,b)` + +For use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). The sort algorithm is, in order of precedence: + +* Longest `.path` +* oldest `.creation` (which has a 1ms precision, same as `Date`) +* lowest `.creationIndex` (to get beyond the 1ms precision) + +``` javascript +var cookies = [ /* unsorted array of Cookie objects */ ]; +cookies = cookies.sort(cookieCompare); +``` + +**Note**: Since JavaScript's `Date` is limited to a 1ms precision, cookies within the same milisecond are entirely possible. This is especially true when using the `now` option to `.setCookie()`. The `.creationIndex` property is a per-process global counter, assigned during construction with `new Cookie()`. This preserves the spirit of the RFC sorting: older cookies go first. This works great for `MemoryCookieStore`, since `Set-Cookie` headers are parsed in order, but may not be so great for distributed systems. Sophisticated `Store`s may wish to set this to some other _logical clock_ such that if cookies A and B are created in the same millisecond, but cookie A is created before cookie B, then `A.creationIndex < B.creationIndex`. If you want to alter the global counter, which you probably _shouldn't_ do, it's stored in `Cookie.cookiesCreated`. + +### `permuteDomain(domain)` + +Generates a list of all possible domains that `domainMatch()` the parameter. May be handy for implementing cookie stores. + +### `permutePath(path)` + +Generates a list of all possible paths that `pathMatch()` the parameter. May be handy for implementing cookie stores. + + +## Cookie + +Exported via `tough.Cookie`. + +### `Cookie.parse(cookieString[, options])` + +Parses a single Cookie or Set-Cookie HTTP header into a `Cookie` object. Returns `undefined` if the string can't be parsed. + +The options parameter is not required and currently has only one property: + + * _loose_ - boolean - if `true` enable parsing of key-less cookies like `=abc` and `=`, which are not RFC-compliant. + +If options is not an object, it is ignored, which means you can use `Array#map` with it. + +Here's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response: + +``` javascript +if (res.headers['set-cookie'] instanceof Array) + cookies = res.headers['set-cookie'].map(Cookie.parse); +else + cookies = [Cookie.parse(res.headers['set-cookie'])]; +``` + +### Properties + +Cookie object properties: + + * _key_ - string - the name or key of the cookie (default "") + * _value_ - string - the value of the cookie (default "") + * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `"Infinity"`). See `setExpires()` + * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie. May also be set to strings `"Infinity"` and `"-Infinity"` for non-expiry and immediate-expiry, respectively. See `setMaxAge()` + * _domain_ - string - the `Domain=` attribute of the cookie + * _path_ - string - the `Path=` of the cookie + * _secure_ - boolean - the `Secure` cookie flag + * _httpOnly_ - boolean - the `HttpOnly` cookie flag + * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside) + * _creation_ - `Date` - when this cookie was constructed + * _creationIndex_ - number - set at construction, used to provide greater sort precision (please see `cookieCompare(a,b)` for a full explanation) + +After a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes: + + * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied) + * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one. + * _creation_ - `Date` - **modified** from construction to when the cookie was added to the jar + * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented. Using `cookiejar.getCookies(...)` will update this attribute. + +### `Cookie([{properties}])` + +Receives an options object that can contain any of the above Cookie properties, uses the default for unspecified properties. + +### `.toString()` + +encode to a Set-Cookie header value. The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`. + +### `.cookieString()` + +encode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '='). + +### `.setExpires(String)` + +sets the expiry based on a date-string passed through `parseDate()`. If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `"Infinity"` (a string) is set. + +### `.setMaxAge(number)` + +sets the maxAge in seconds. Coerces `-Infinity` to `"-Infinity"` and `Infinity` to `"Infinity"` so it JSON serializes correctly. + +### `.expiryTime([now=Date.now()])` + +### `.expiryDate([now=Date.now()])` + +expiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object. Note that in both cases the `now` parameter should be milliseconds. + +Max-Age takes precedence over Expires (as per the RFC). The `.creation` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute. + +If Expires (`.expires`) is set, that's returned. + +Otherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for "Tue, 19 Jan 2038 03:14:07 GMT" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents). + +### `.TTL([now=Date.now()])` + +compute the TTL relative to `now` (milliseconds). The same precedence rules as for `expiryTime`/`expiryDate` apply. + +The "number" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired. Otherwise a time-to-live in milliseconds is returned. + +### `.canonicalizedDoman()` + +### `.cdomain()` + +return the canonicalized `.domain` field. This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters. + +### `.toJSON()` + +For convenience in using `JSON.serialize(cookie)`. Returns a plain-old `Object` that can be JSON-serialized. + +Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are exported in ISO format (`.toISOString()`). + +**NOTE**: Custom `Cookie` properties will be discarded. In tough-cookie 1.x, since there was no `.toJSON` method explicitly defined, all enumerable properties were captured. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array. + +### `Cookie.fromJSON(strOrObj)` + +Does the reverse of `cookie.toJSON()`. If passed a string, will `JSON.parse()` that first. + +Any `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are parsed via `Date.parse()`, not the tough-cookie `parseDate`, since it's JavaScript/JSON-y timestamps being handled at this layer. + +Returns `null` upon JSON parsing error. + +### `.clone()` + +Does a deep clone of this cookie, exactly implemented as `Cookie.fromJSON(cookie.toJSON())`. + +### `.validate()` + +Status: *IN PROGRESS*. Works for a few things, but is by no means comprehensive. + +validates cookie attributes for semantic correctness. Useful for "lint" checking any Set-Cookie headers you generate. For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct: + +``` javascript +if (cookie.validate() === true) { + // it's tasty +} else { + // yuck! +} +``` + + +## CookieJar + +Exported via `tough.CookieJar`. + +### `CookieJar([store],[options])` + +Simply use `new CookieJar()`. If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used. + +The `options` object can be omitted and can have the following properties: + + * _rejectPublicSuffixes_ - boolean - default `true` - reject cookies with domains like "com" and "co.uk" + * _looseMode_ - boolean - default `false` - accept malformed cookies like `bar` and `=bar`, which have an implied empty name. + This is not in the standard, but is used sometimes on the web and is accepted by (most) browsers. + +Since eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods. + +### `.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))` + +Attempt to set the cookie in the cookie jar. If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through. The cookie will have updated `.creation`, `.lastAccessed` and `.hostOnly` properties. + +The `options` object can be omitted and can have the following properties: + + * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. + * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. + * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies + * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains. `Store` errors aren't ignored by this option. + +As per the RFC, the `.hostOnly` property is set if there was no "Domain=" parameter in the cookie string (or `.domain` was null on the Cookie object). The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual). + +### `.setCookieSync(cookieOrString, currentUrl, [{options}])` + +Synchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.getCookies(currentUrl, [{options},] cb(err,cookies))` + +Retrieve the list of cookies that can be sent in a Cookie header for the current url. + +If an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed. The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given. + +The `options` object can be omitted and can have the following properties: + + * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API. Affects HttpOnly cookies. + * _secure_ - boolean - autodetect from url - indicates if this is a "Secure" API. If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`. + * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies + * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store. Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially). + * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the underlying store (the default `MemoryCookieStore` supports it). + +The `.lastAccessed` property of the returned cookies will have been updated. + +### `.getCookiesSync(currentUrl, [{options}])` + +Synchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.getCookieString(...)` + +Accepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback. Simply maps the `Cookie` array via `.cookieString()`. + +### `.getCookieStringSync(...)` + +Synchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.getSetCookieStrings(...)` + +Returns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`. Simply maps the cookie array via `.toString()`. + +### `.getSetCookieStringsSync(...)` + +Synchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`). + +### `.serialize(cb(err,serializedObject))` + +Serialize the Jar if the underlying store supports `.getAllCookies`. + +**NOTE**: Custom `Cookie` properties will be discarded. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array. + +See [Serialization Format]. + +### `.serializeSync()` + +Sync version of .serialize + +### `.toJSON()` + +Alias of .serializeSync() for the convenience of `JSON.stringify(cookiejar)`. + +### `CookieJar.deserialize(serialized, [store], cb(err,object))` + +A new Jar is created and the serialized Cookies are added to the underlying store. Each `Cookie` is added via `store.putCookie` in the order in which they appear in the serialization. + +The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. + +As a convenience, if `serialized` is a string, it is passed through `JSON.parse` first. If that throws an error, this is passed to the callback. + +### `CookieJar.deserializeSync(serialized, [store])` + +Sync version of `.deserialize`. _Note_ that the `store` must be synchronous for this to work. + +### `CookieJar.fromJSON(string)` + +Alias of `.deserializeSync` to provide consistency with `Cookie.fromJSON()`. + +### `.clone([store,]cb(err,newJar))` + +Produces a deep clone of this jar. Modifications to the original won't affect the clone, and vice versa. + +The `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`. + +### `.cloneSync([store])` + +Synchronous version of `.clone`, returning a new `CookieJar` instance. + +The `store` argument is optional, but must be a _synchronous_ `Store` instance if specified. If not passed, a new instance of `MemoryCookieStore` is used. + +The _source_ and _destination_ must both be synchronous `Store`s. If one or both stores are asynchronous, use `.clone` instead. Recall that `MemoryCookieStore` supports both synchronous and asynchronous API calls. + +## Store + +Base class for CookieJar stores. Available as `tough.Store`. + +## Store API + +The storage model for each `CookieJar` instance can be replaced with a custom implementation. The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file. The API uses continuation-passing-style to allow for asynchronous stores. + +Stores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`. + +Stores are asynchronous by default, but if `store.synchronous` is set to `true`, then the `*Sync` methods on the of the containing `CookieJar` can be used (however, the continuation-passing style + +All `domain` parameters will have been normalized before calling. + +The Cookie store must have all of the following methods. + +### `store.findCookie(domain, path, key, cb(err,cookie))` + +Retrieve a cookie with the given domain, path and key (a.k.a. name). The RFC maintains that exactly one of these cookies should exist in a store. If the store is using versioning, this means that the latest/newest such cookie should be returned. + +Callback takes an error and the resulting `Cookie` object. If no cookie is found then `null` MUST be passed instead (i.e. not an error). + +### `store.findCookies(domain, path, cb(err,cookies))` + +Locates cookies matching the given domain and path. This is most often called in the context of `cookiejar.getCookies()` above. + +If no cookies are found, the callback MUST be passed an empty array. + +The resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method. However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done. + +As of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`. If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only). + +### `store.putCookie(cookie, cb(err))` + +Adds a new cookie to the store. The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur. + +The `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties. + +Pass an error if the cookie cannot be stored. + +### `store.updateCookie(oldCookie, newCookie, cb(err))` + +Update an existing cookie. The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`. The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store. + +The `.lastAccessed` property will always be different between the two objects (to the precision possible via JavaScript's clock). Both `.creation` and `.creationIndex` are guaranteed to be the same. Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are selected for automatic deletion (e.g., least-recently-used, which is up to the store to implement). + +Stores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie. If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object. + +The `newCookie` and `oldCookie` objects MUST NOT be modified. + +Pass an error if the newCookie cannot be stored. + +### `store.removeCookie(domain, path, key, cb(err))` + +Remove a cookie from the store (see notes on `findCookie` about the uniqueness constraint). + +The implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie. + +### `store.removeCookies(domain, path, cb(err))` + +Removes matching cookies from the store. The `path` parameter is optional, and if missing means all paths in a domain should be removed. + +Pass an error ONLY if removing any existing cookies failed. + +### `store.getAllCookies(cb(err, cookies))` + +Produces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure. + +Cookies SHOULD be returned in creation order to preserve sorting via `compareCookies()`. For reference, `MemoryCookieStore` will sort by `.creationIndex` since it uses true `Cookie` objects internally. If you don't return the cookies in creation order, they'll still be sorted by creation time, but this only has a precision of 1ms. See `compareCookies` for more detail. + +Pass an error if retrieval fails. + +## MemoryCookieStore + +Inherits from `Store`. + +A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API. + +# Serialization Format + +**NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`. + +```js + { + // The version of tough-cookie that serialized this jar. + version: 'tough-cookie@1.x.y', + + // add the store type, to make humans happy: + storeType: 'MemoryCookieStore', + + // CookieJar configuration: + rejectPublicSuffixes: true, + // ... future items go here + + // Gets filled from jar.store.getAllCookies(): + cookies: [ + { + key: 'string', + value: 'string', + // ... + /* other Cookie.serializableProperties go here */ + } + ] + } +``` + +# Copyright and License + +(tl;dr: BSD-3-Clause with some MPL/2.0) + +```text + Copyright (c) 2015, Salesforce.com, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + 3. Neither the name of Salesforce.com nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +``` + +Portions may be licensed under different licenses (in particular `public_suffix_list.dat` is MPL/2.0); please read that file and the LICENSE file for full details. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/lib/cookie.js new file mode 100644 index 00000000..0afe4a2a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/lib/cookie.js @@ -0,0 +1,1342 @@ +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +'use strict'; +var net = require('net'); +var urlParse = require('url').parse; +var pubsuffix = require('./pubsuffix'); +var Store = require('./store').Store; +var MemoryCookieStore = require('./memstore').MemoryCookieStore; +var pathMatch = require('./pathMatch').pathMatch; +var VERSION = require('../package.json').version; + +var punycode; +try { + punycode = require('punycode'); +} catch(e) { + console.warn("cookie: can't load punycode; won't use punycode for domain normalization"); +} + +var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/; + +// From RFC6265 S4.1.1 +// note that it excludes \x3B ";" +var COOKIE_OCTET = /[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]/; +var COOKIE_OCTETS = new RegExp('^'+COOKIE_OCTET.source+'+$'); + +var CONTROL_CHARS = /[\x00-\x1F]/; + +// Double quotes are part of the value (see: S4.1.1). +// '\r', '\n' and '\0' should be treated as a terminator in the "relaxed" mode +// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60) +// '=' and ';' are attribute/values separators +// (see: https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L64) +var COOKIE_PAIR = /^(([^=;]+))\s*=\s*(("?)[^\n\r\0]*\3)/ + +// Used to parse non-RFC-compliant cookies like '=abc' when given the `loose` +// option in Cookie.parse: +var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?(("?)[^\n\r\0]*\3)/; + +// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"' +// Note ';' is \x3B +var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; + +// Used for checking whether or not there is a trailing semi-colon +var TRAILING_SEMICOLON = /;+$/; + +var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/; +var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/; +var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i; + +var MONTH_TO_NUM = { + jan:0, feb:1, mar:2, apr:3, may:4, jun:5, + jul:6, aug:7, sep:8, oct:9, nov:10, dec:11 +}; +var NUM_TO_MONTH = [ + 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec' +]; +var NUM_TO_DAY = [ + 'Sun','Mon','Tue','Wed','Thu','Fri','Sat' +]; + +var YEAR = /^(\d{2}|\d{4})$/; // 2 to 4 digits + +var MAX_TIME = 2147483647000; // 31-bit max +var MIN_TIME = 0; // 31-bit min + + +// RFC6265 S5.1.1 date parser: +function parseDate(str) { + if (!str) { + return; + } + + /* RFC6265 S5.1.1: + * 2. Process each date-token sequentially in the order the date-tokens + * appear in the cookie-date + */ + var tokens = str.split(DATE_DELIM); + if (!tokens) { + return; + } + + var hour = null; + var minutes = null; + var seconds = null; + var day = null; + var month = null; + var year = null; + + for (var i=0; i 23 || minutes > 59 || seconds > 59) { + return; + } + + continue; + } + } + + /* 2.2. If the found-day-of-month flag is not set and the date-token matches + * the day-of-month production, set the found-day-of- month flag and set + * the day-of-month-value to the number denoted by the date-token. Skip + * the remaining sub-steps and continue to the next date-token. + */ + if (day === null) { + result = DAY_OF_MONTH.exec(token); + if (result) { + day = parseInt(result, 10); + /* RFC6265 S5.1.1.5: + * [fail if] the day-of-month-value is less than 1 or greater than 31 + */ + if(day < 1 || day > 31) { + return; + } + continue; + } + } + + /* 2.3. If the found-month flag is not set and the date-token matches the + * month production, set the found-month flag and set the month-value to + * the month denoted by the date-token. Skip the remaining sub-steps and + * continue to the next date-token. + */ + if (month === null) { + result = MONTH.exec(token); + if (result) { + month = MONTH_TO_NUM[result[1].toLowerCase()]; + continue; + } + } + + /* 2.4. If the found-year flag is not set and the date-token matches the year + * production, set the found-year flag and set the year-value to the number + * denoted by the date-token. Skip the remaining sub-steps and continue to + * the next date-token. + */ + if (year === null) { + result = YEAR.exec(token); + if (result) { + year = parseInt(result[0], 10); + /* From S5.1.1: + * 3. If the year-value is greater than or equal to 70 and less + * than or equal to 99, increment the year-value by 1900. + * 4. If the year-value is greater than or equal to 0 and less + * than or equal to 69, increment the year-value by 2000. + */ + if (70 <= year && year <= 99) { + year += 1900; + } else if (0 <= year && year <= 69) { + year += 2000; + } + + if (year < 1601) { + return; // 5. ... the year-value is less than 1601 + } + } + } + } + + if (seconds === null || day === null || month === null || year === null) { + return; // 5. ... at least one of the found-day-of-month, found-month, found- + // year, or found-time flags is not set, + } + + return new Date(Date.UTC(year, month, day, hour, minutes, seconds)); +} + +function formatDate(date) { + var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d; + var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h; + var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m; + var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s; + return NUM_TO_DAY[date.getUTCDay()] + ', ' + + d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+ + h+':'+m+':'+s+' GMT'; +} + +// S5.1.2 Canonicalized Host Names +function canonicalDomain(str) { + if (str == null) { + return null; + } + str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading . + + // convert to IDN if any non-ASCII characters + if (punycode && /[^\u0001-\u007f]/.test(str)) { + str = punycode.toASCII(str); + } + + return str.toLowerCase(); +} + +// S5.1.3 Domain Matching +function domainMatch(str, domStr, canonicalize) { + if (str == null || domStr == null) { + return null; + } + if (canonicalize !== false) { + str = canonicalDomain(str); + domStr = canonicalDomain(domStr); + } + + /* + * "The domain string and the string are identical. (Note that both the + * domain string and the string will have been canonicalized to lower case at + * this point)" + */ + if (str == domStr) { + return true; + } + + /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */ + + /* "* The string is a host name (i.e., not an IP address)." */ + if (net.isIP(str)) { + return false; + } + + /* "* The domain string is a suffix of the string" */ + var idx = str.indexOf(domStr); + if (idx <= 0) { + return false; // it's a non-match (-1) or prefix (0) + } + + // e.g "a.b.c".indexOf("b.c") === 2 + // 5 === 3+2 + if (str.length !== domStr.length + idx) { // it's not a suffix + return false; + } + + /* "* The last character of the string that is not included in the domain + * string is a %x2E (".") character." */ + if (str.substr(idx-1,1) !== '.') { + return false; + } + + return true; +} + + +// RFC6265 S5.1.4 Paths and Path-Match + +/* + * "The user agent MUST use an algorithm equivalent to the following algorithm + * to compute the default-path of a cookie:" + * + * Assumption: the path (and not query part or absolute uri) is passed in. + */ +function defaultPath(path) { + // "2. If the uri-path is empty or if the first character of the uri-path is not + // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps. + if (!path || path.substr(0,1) !== "/") { + return "/"; + } + + // "3. If the uri-path contains no more than one %x2F ("/") character, output + // %x2F ("/") and skip the remaining step." + if (path === "/") { + return path; + } + + var rightSlash = path.lastIndexOf("/"); + if (rightSlash === 0) { + return "/"; + } + + // "4. Output the characters of the uri-path from the first character up to, + // but not including, the right-most %x2F ("/")." + return path.slice(0, rightSlash); +} + + +function parse(str, options) { + if (!options || typeof options !== 'object') { + options = {}; + } + str = str.trim(); + + // S4.1.1 Trailing semi-colons are not part of the specification. + var semiColonCheck = TRAILING_SEMICOLON.exec(str); + if (semiColonCheck) { + str = str.slice(0, semiColonCheck.index); + } + + // We use a regex to parse the "name-value-pair" part of S5.2 + var firstSemi = str.indexOf(';'); // S5.2 step 1 + var pairRe = options.loose ? LOOSE_COOKIE_PAIR : COOKIE_PAIR; + var result = pairRe.exec(firstSemi === -1 ? str : str.substr(0,firstSemi)); + + // Rx satisfies the "the name string is empty" and "lacks a %x3D ("=")" + // constraints as well as trimming any whitespace. + if (!result) { + return; + } + + var c = new Cookie(); + if (result[1]) { + c.key = result[2].trim(); + } else { + c.key = ''; + } + c.value = result[3].trim(); + if (CONTROL_CHARS.test(c.key) || CONTROL_CHARS.test(c.value)) { + return; + } + + if (firstSemi === -1) { + return c; + } + + // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string + // (including the %x3B (";") in question)." plus later on in the same section + // "discard the first ";" and trim". + var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim(); + + // "If the unparsed-attributes string is empty, skip the rest of these + // steps." + if (unparsed.length === 0) { + return c; + } + + /* + * S5.2 says that when looping over the items "[p]rocess the attribute-name + * and attribute-value according to the requirements in the following + * subsections" for every item. Plus, for many of the individual attributes + * in S5.3 it says to use the "attribute-value of the last attribute in the + * cookie-attribute-list". Therefore, in this implementation, we overwrite + * the previous value. + */ + var cookie_avs = unparsed.split(/\s*;\s*/); + while (cookie_avs.length) { + var av = cookie_avs.shift(); + var av_sep = av.indexOf('='); + var av_key, av_value; + + if (av_sep === -1) { + av_key = av; + av_value = null; + } else { + av_key = av.substr(0,av_sep); + av_value = av.substr(av_sep+1); + } + + av_key = av_key.trim().toLowerCase(); + + if (av_value) { + av_value = av_value.trim(); + } + + switch(av_key) { + case 'expires': // S5.2.1 + if (av_value) { + var exp = parseDate(av_value); + // "If the attribute-value failed to parse as a cookie date, ignore the + // cookie-av." + if (exp) { + // over and underflow not realistically a concern: V8's getTime() seems to + // store something larger than a 32-bit time_t (even with 32-bit node) + c.expires = exp; + } + } + break; + + case 'max-age': // S5.2.2 + if (av_value) { + // "If the first character of the attribute-value is not a DIGIT or a "-" + // character ...[or]... If the remainder of attribute-value contains a + // non-DIGIT character, ignore the cookie-av." + if (/^-?[0-9]+$/.test(av_value)) { + var delta = parseInt(av_value, 10); + // "If delta-seconds is less than or equal to zero (0), let expiry-time + // be the earliest representable date and time." + c.setMaxAge(delta); + } + } + break; + + case 'domain': // S5.2.3 + // "If the attribute-value is empty, the behavior is undefined. However, + // the user agent SHOULD ignore the cookie-av entirely." + if (av_value) { + // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E + // (".") character." + var domain = av_value.trim().replace(/^\./, ''); + if (domain) { + // "Convert the cookie-domain to lower case." + c.domain = domain.toLowerCase(); + } + } + break; + + case 'path': // S5.2.4 + /* + * "If the attribute-value is empty or if the first character of the + * attribute-value is not %x2F ("/"): + * Let cookie-path be the default-path. + * Otherwise: + * Let cookie-path be the attribute-value." + * + * We'll represent the default-path as null since it depends on the + * context of the parsing. + */ + c.path = av_value && av_value[0] === "/" ? av_value : null; + break; + + case 'secure': // S5.2.5 + /* + * "If the attribute-name case-insensitively matches the string "Secure", + * the user agent MUST append an attribute to the cookie-attribute-list + * with an attribute-name of Secure and an empty attribute-value." + */ + c.secure = true; + break; + + case 'httponly': // S5.2.6 -- effectively the same as 'secure' + c.httpOnly = true; + break; + + default: + c.extensions = c.extensions || []; + c.extensions.push(av); + break; + } + } + + return c; +} + +// avoid the V8 deoptimization monster! +function jsonParse(str) { + var obj; + try { + obj = JSON.parse(str); + } catch (e) { + return e; + } + return obj; +} + +function fromJSON(str) { + if (!str) { + return null; + } + + var obj; + if (typeof str === 'string') { + obj = jsonParse(str); + if (obj instanceof Error) { + return null; + } + } else { + // assume it's an Object + obj = str; + } + + var c = new Cookie(); + for (var i=0; i 1) { + var lindex = path.lastIndexOf('/'); + if (lindex === 0) { + break; + } + path = path.substr(0,lindex); + permutations.push(path); + } + permutations.push('/'); + return permutations; +} + +function getCookieContext(url) { + if (url instanceof Object) { + return url; + } + // NOTE: decodeURI will throw on malformed URIs (see GH-32). + // Therefore, we will just skip decoding for such URIs. + try { + url = decodeURI(url); + } + catch(err) { + // Silently swallow error + } + + return urlParse(url); +} + +function Cookie(options) { + options = options || {}; + + Object.keys(options).forEach(function(prop) { + if (Cookie.prototype.hasOwnProperty(prop) && + Cookie.prototype[prop] !== options[prop] && + prop.substr(0,1) !== '_') + { + this[prop] = options[prop]; + } + }, this); + + this.creation = this.creation || new Date(); + + // used to break creation ties in cookieCompare(): + Object.defineProperty(this, 'creationIndex', { + configurable: false, + enumerable: false, // important for assert.deepEqual checks + writable: true, + value: ++Cookie.cookiesCreated + }); +} + +Cookie.cookiesCreated = 0; // incremented each time a cookie is created + +Cookie.parse = parse; +Cookie.fromJSON = fromJSON; + +Cookie.prototype.key = ""; +Cookie.prototype.value = ""; + +// the order in which the RFC has them: +Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity +Cookie.prototype.maxAge = null; // takes precedence over expires for TTL +Cookie.prototype.domain = null; +Cookie.prototype.path = null; +Cookie.prototype.secure = false; +Cookie.prototype.httpOnly = false; +Cookie.prototype.extensions = null; + +// set by the CookieJar: +Cookie.prototype.hostOnly = null; // boolean when set +Cookie.prototype.pathIsDefault = null; // boolean when set +Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse +Cookie.prototype.lastAccessed = null; // Date when set +Object.defineProperty(Cookie.prototype, 'creationIndex', { + configurable: true, + enumerable: false, + writable: true, + value: 0 +}); + +Cookie.serializableProperties = Object.keys(Cookie.prototype) + .filter(function(prop) { + return !( + Cookie.prototype[prop] instanceof Function || + prop === 'creationIndex' || + prop.substr(0,1) === '_' + ); + }); + +Cookie.prototype.inspect = function inspect() { + var now = Date.now(); + return 'Cookie="'+this.toString() + + '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') + + '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') + + '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') + + '"'; +}; + +Cookie.prototype.toJSON = function() { + var obj = {}; + + var props = Cookie.serializableProperties; + for (var i=0; i suffixLen) { + var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.'); + return converted ? punycode.toUnicode(publicSuffix) : publicSuffix; + } + + return null; +}; + +// The following generated structure is used under the MPL version 2.0 +// See public-suffix.txt for more information + +var index = module.exports.index = Object.freeze( +{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"marketplace.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"taxi.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"an":true,"com.an":true,"net.an":true,"org.an":true,"edu.an":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"org.ba":true,"net.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"unsa.ba":true,"unbi.ba":true,"co.ba":true,"com.ba":true,"rs.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gov.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"br":true,"adm.br":true,"adv.br":true,"agr.br":true,"am.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"coop.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"flog.br":true,"fm.br":true,"fnd.br":true,"fot.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"gov.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"mat.br":true,"med.br":true,"mil.br":true,"mp.br":true,"mus.br":true,"net.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"slg.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"vet.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"net.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"hitoyoshi.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kashima.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kosa.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"kesennuma.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"*.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"*.mz":true,"teledata.mz":false,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"gov.ng":true,"mil.ng":true,"mobi.ng":true,"*.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aca.pro":true,"bar.pro":true,"cpa.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"eng.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"com.re":true,"asso.re":true,"nom.re":true,"ro":true,"com.ro":true,"org.ro":true,"tm.ro":true,"nt.ro":true,"nom.ro":true,"info.ro":true,"rec.ro":true,"arts.ro":true,"firm.ro":true,"store.ro":true,"www.ro":true,"rs":true,"co.rs":true,"org.rs":true,"edu.rs":true,"ac.rs":true,"gov.rs":true,"in.rs":true,"ru":true,"ac.ru":true,"com.ru":true,"edu.ru":true,"int.ru":true,"net.ru":true,"org.ru":true,"pp.ru":true,"adygeya.ru":true,"altai.ru":true,"amur.ru":true,"arkhangelsk.ru":true,"astrakhan.ru":true,"bashkiria.ru":true,"belgorod.ru":true,"bir.ru":true,"bryansk.ru":true,"buryatia.ru":true,"cbg.ru":true,"chel.ru":true,"chelyabinsk.ru":true,"chita.ru":true,"chukotka.ru":true,"chuvashia.ru":true,"dagestan.ru":true,"dudinka.ru":true,"e-burg.ru":true,"grozny.ru":true,"irkutsk.ru":true,"ivanovo.ru":true,"izhevsk.ru":true,"jar.ru":true,"joshkar-ola.ru":true,"kalmykia.ru":true,"kaluga.ru":true,"kamchatka.ru":true,"karelia.ru":true,"kazan.ru":true,"kchr.ru":true,"kemerovo.ru":true,"khabarovsk.ru":true,"khakassia.ru":true,"khv.ru":true,"kirov.ru":true,"koenig.ru":true,"komi.ru":true,"kostroma.ru":true,"krasnoyarsk.ru":true,"kuban.ru":true,"kurgan.ru":true,"kursk.ru":true,"lipetsk.ru":true,"magadan.ru":true,"mari.ru":true,"mari-el.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"murmansk.ru":true,"nalchik.ru":true,"nnov.ru":true,"nov.ru":true,"novosibirsk.ru":true,"nsk.ru":true,"omsk.ru":true,"orenburg.ru":true,"oryol.ru":true,"palana.ru":true,"penza.ru":true,"perm.ru":true,"ptz.ru":true,"rnd.ru":true,"ryazan.ru":true,"sakhalin.ru":true,"samara.ru":true,"saratov.ru":true,"simbirsk.ru":true,"smolensk.ru":true,"spb.ru":true,"stavropol.ru":true,"stv.ru":true,"surgut.ru":true,"tambov.ru":true,"tatarstan.ru":true,"tom.ru":true,"tomsk.ru":true,"tsaritsyn.ru":true,"tsk.ru":true,"tula.ru":true,"tuva.ru":true,"tver.ru":true,"tyumen.ru":true,"udm.ru":true,"udmurtia.ru":true,"ulan-ude.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"vladivostok.ru":true,"volgograd.ru":true,"vologda.ru":true,"voronezh.ru":true,"vrn.ru":true,"vyatka.ru":true,"yakutia.ru":true,"yamal.ru":true,"yaroslavl.ru":true,"yekaterinburg.ru":true,"yuzhno-sakhalinsk.ru":true,"amursk.ru":true,"baikal.ru":true,"cmw.ru":true,"fareast.ru":true,"jamal.ru":true,"kms.ru":true,"k-uralsk.ru":true,"kustanai.ru":true,"kuzbass.ru":true,"magnitka.ru":true,"mytis.ru":true,"nakhodka.ru":true,"nkz.ru":true,"norilsk.ru":true,"oskol.ru":true,"pyatigorsk.ru":true,"rubtsovsk.ru":true,"snz.ru":true,"syzran.ru":true,"vdonsk.ru":true,"zgrad.ru":true,"gov.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"adygeya.su":true,"arkhangelsk.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"dagestan.su":true,"grozny.su":true,"ivanovo.su":true,"kalmykia.su":true,"kaluga.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"lenug.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"togliatti.su":true,"troitsk.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tp":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.de.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agrica.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"*.zm":true,"*.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"africamagic":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"aramco":true,"archi":true,"army":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"bot":true,"boutique":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"chloe":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"dnp":true,"docs":true,"dodge":true,"dog":true,"doha":true,"domains":true,"doosan":true,"dot":true,"download":true,"drive":true,"dstv":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dwg":true,"earth":true,"eat":true,"edeka":true,"education":true,"email":true,"emerck":true,"emerson":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"flsmidth":true,"fly":true,"foo":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"gotv":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"htc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"iinet":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyknet":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mcd":true,"mcdonalds":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mnet":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"montblanc":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"multichoice":true,"mutual":true,"mutuelle":true,"mzansimagic":true,"nab":true,"nadex":true,"nagoya":true,"naspers":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"orientexpress":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"pamperedchef":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"payu":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"philips":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"seat":true,"secure":true,"security":true,"seek":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"studio":true,"study":true,"style":true,"sucks":true,"supersport":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"theguardian":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--4gq48lf9j":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cloudfront.net":true,"ap-northeast-1.compute.amazonaws.com":true,"ap-southeast-1.compute.amazonaws.com":true,"ap-southeast-2.compute.amazonaws.com":true,"cn-north-1.compute.amazonaws.cn":true,"compute.amazonaws.cn":true,"compute.amazonaws.com":true,"compute-1.amazonaws.com":true,"eu-west-1.compute.amazonaws.com":true,"eu-central-1.compute.amazonaws.com":true,"sa-east-1.compute.amazonaws.com":true,"us-east-1.amazonaws.com":true,"us-gov-west-1.compute.amazonaws.com":true,"us-west-1.compute.amazonaws.com":true,"us-west-2.compute.amazonaws.com":true,"z-1.compute-1.amazonaws.com":true,"z-2.compute-1.amazonaws.com":true,"elasticbeanstalk.com":true,"elb.amazonaws.com":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-external-2.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.eu-central-1.amazonaws.com":true,"betainabox.com":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"co.nl":true,"co.no":true,"*.platform.sh":true,"cupcake.is":true,"dreamhosters.com":true,"duckdns.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"firebaseapp.com":true,"flynnhub.com":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"ro.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"withgoogle.com":true,"withyoutube.com":true,"herokuapp.com":true,"herokussl.com":true,"iki.fi":true,"biz.at":true,"info.at":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"bmoattachments.org":true,"4u.com":true,"nfshost.com":true,"nyc.mn":true,"nid.io":true,"operaunite.com":true,"outsystemscloud.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheon.io":true,"gotpantheon.com":true,"priv.at":true,"qa2.com":true,"rhcloud.com":true,"sandcats.io":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"sinaapp.com":true,"vipsinaapp.com":true,"1kapp.com":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"yolasite.com":true,"za.net":true,"za.org":true}); + +// END of automatically generated file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/lib/store.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/lib/store.js new file mode 100644 index 00000000..bce52925 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/lib/store.js @@ -0,0 +1,71 @@ +/*! + * Copyright (c) 2015, Salesforce.com, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of Salesforce.com nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +'use strict'; +/*jshint unused:false */ + +function Store() { +} +exports.Store = Store; + +// Stores may be synchronous, but are still required to use a +// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync" +// API that converts from synchronous-callbacks to imperative style. +Store.prototype.synchronous = false; + +Store.prototype.findCookie = function(domain, path, key, cb) { + throw new Error('findCookie is not implemented'); +}; + +Store.prototype.findCookies = function(domain, path, cb) { + throw new Error('findCookies is not implemented'); +}; + +Store.prototype.putCookie = function(cookie, cb) { + throw new Error('putCookie is not implemented'); +}; + +Store.prototype.updateCookie = function(oldCookie, newCookie, cb) { + // recommended default implementation: + // return this.putCookie(newCookie, cb); + throw new Error('updateCookie is not implemented'); +}; + +Store.prototype.removeCookie = function(domain, path, key, cb) { + throw new Error('removeCookie is not implemented'); +}; + +Store.prototype.removeCookies = function(domain, path, cb) { + throw new Error('removeCookies is not implemented'); +}; + +Store.prototype.getAllCookies = function(cb) { + throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)'); +}; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/package.json new file mode 100644 index 00000000..5fd5510a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tough-cookie/package.json @@ -0,0 +1,90 @@ +{ + "author": { + "name": "Jeremy Stashewsky", + "email": "jstashewsky@salesforce.com" + }, + "contributors": [ + { + "name": "Alexander Savin" + }, + { + "name": "Ian Livingstone" + }, + { + "name": "Ivan Nikulin" + }, + { + "name": "Lalit Kapoor" + }, + { + "name": "Sam Thompson" + }, + { + "name": "Sebastian Mayr" + } + ], + "license": "BSD-3-Clause", + "name": "tough-cookie", + "description": "RFC6265 Cookies and Cookie Jar for node.js", + "keywords": [ + "HTTP", + "cookie", + "cookies", + "set-cookie", + "cookiejar", + "jar", + "RFC6265", + "RFC2965" + ], + "version": "2.2.1", + "homepage": "https://github.com/SalesforceEng/tough-cookie", + "repository": { + "type": "git", + "url": "git://github.com/SalesforceEng/tough-cookie.git" + }, + "bugs": { + "url": "https://github.com/SalesforceEng/tough-cookie/issues" + }, + "main": "./lib/cookie", + "files": [ + "lib" + ], + "scripts": { + "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js", + "test": "vows test/*_test.js" + }, + "engines": { + "node": ">=0.10.0" + }, + "devDependencies": { + "async": "^1.4.2", + "vows": "^0.8.1" + }, + "gitHead": "f1055655ea56c85bd384aaf7d5b740b916700b6f", + "_id": "tough-cookie@2.2.1", + "_shasum": "3b0516b799e70e8164436a1446e7e5877fda118e", + "_from": "tough-cookie@>=2.2.0 <2.3.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "jstash", + "email": "jstash@gmail.com" + }, + "dist": { + "shasum": "3b0516b799e70e8164436a1446e7e5877fda118e", + "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz" + }, + "maintainers": [ + { + "name": "jstash", + "email": "jeremy@goinstant.com" + }, + { + "name": "goinstant", + "email": "services@goinstant.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/.jshintrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/.jshintrc new file mode 100644 index 00000000..4c1c8d49 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/.jshintrc @@ -0,0 +1,5 @@ +{ + "node": true, + "asi": true, + "laxcomma": true +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/LICENSE new file mode 100644 index 00000000..a4a9aee0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/LICENSE @@ -0,0 +1,55 @@ +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/README.md new file mode 100644 index 00000000..bb533d56 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/README.md @@ -0,0 +1,4 @@ +tunnel-agent +============ + +HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/index.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/index.js new file mode 100644 index 00000000..da516ec4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/index.js @@ -0,0 +1,241 @@ +'use strict' + +var net = require('net') + , tls = require('tls') + , http = require('http') + , https = require('https') + , events = require('events') + , assert = require('assert') + , util = require('util') + ; + +exports.httpOverHttp = httpOverHttp +exports.httpsOverHttp = httpsOverHttp +exports.httpOverHttps = httpOverHttps +exports.httpsOverHttps = httpsOverHttps + + +function httpOverHttp(options) { + var agent = new TunnelingAgent(options) + agent.request = http.request + return agent +} + +function httpsOverHttp(options) { + var agent = new TunnelingAgent(options) + agent.request = http.request + agent.createSocket = createSecureSocket + return agent +} + +function httpOverHttps(options) { + var agent = new TunnelingAgent(options) + agent.request = https.request + return agent +} + +function httpsOverHttps(options) { + var agent = new TunnelingAgent(options) + agent.request = https.request + agent.createSocket = createSecureSocket + return agent +} + + +function TunnelingAgent(options) { + var self = this + self.options = options || {} + self.proxyOptions = self.options.proxy || {} + self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets + self.requests = [] + self.sockets = [] + + self.on('free', function onFree(socket, host, port) { + for (var i = 0, len = self.requests.length; i < len; ++i) { + var pending = self.requests[i] + if (pending.host === host && pending.port === port) { + // Detect the request to connect same origin server, + // reuse the connection. + self.requests.splice(i, 1) + pending.request.onSocket(socket) + return + } + } + socket.destroy() + self.removeSocket(socket) + }) +} +util.inherits(TunnelingAgent, events.EventEmitter) + +TunnelingAgent.prototype.addRequest = function addRequest(req, options) { + var self = this + + // Legacy API: addRequest(req, host, port, path) + if (typeof options === 'string') { + options = { + host: options, + port: arguments[2], + path: arguments[3] + }; + } + + if (self.sockets.length >= this.maxSockets) { + // We are over limit so we'll add it to the queue. + self.requests.push({host: options.host, port: options.port, request: req}) + return + } + + // If we are under maxSockets create a new one. + self.createConnection({host: options.host, port: options.port, request: req}) +} + +TunnelingAgent.prototype.createConnection = function createConnection(pending) { + var self = this + + self.createSocket(pending, function(socket) { + socket.on('free', onFree) + socket.on('close', onCloseOrRemove) + socket.on('agentRemove', onCloseOrRemove) + pending.request.onSocket(socket) + + function onFree() { + self.emit('free', socket, pending.host, pending.port) + } + + function onCloseOrRemove(err) { + self.removeSocket(socket) + socket.removeListener('free', onFree) + socket.removeListener('close', onCloseOrRemove) + socket.removeListener('agentRemove', onCloseOrRemove) + } + }) +} + +TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { + var self = this + var placeholder = {} + self.sockets.push(placeholder) + + var connectOptions = mergeOptions({}, self.proxyOptions, + { method: 'CONNECT' + , path: options.host + ':' + options.port + , agent: false + } + ) + if (connectOptions.proxyAuth) { + connectOptions.headers = connectOptions.headers || {} + connectOptions.headers['Proxy-Authorization'] = 'Basic ' + + new Buffer(connectOptions.proxyAuth).toString('base64') + } + + debug('making CONNECT request') + var connectReq = self.request(connectOptions) + connectReq.useChunkedEncodingByDefault = false // for v0.6 + connectReq.once('response', onResponse) // for v0.6 + connectReq.once('upgrade', onUpgrade) // for v0.6 + connectReq.once('connect', onConnect) // for v0.7 or later + connectReq.once('error', onError) + connectReq.end() + + function onResponse(res) { + // Very hacky. This is necessary to avoid http-parser leaks. + res.upgrade = true + } + + function onUpgrade(res, socket, head) { + // Hacky. + process.nextTick(function() { + onConnect(res, socket, head) + }) + } + + function onConnect(res, socket, head) { + connectReq.removeAllListeners() + socket.removeAllListeners() + + if (res.statusCode === 200) { + assert.equal(head.length, 0) + debug('tunneling connection has established') + self.sockets[self.sockets.indexOf(placeholder)] = socket + cb(socket) + } else { + debug('tunneling socket could not be established, statusCode=%d', res.statusCode) + var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode) + error.code = 'ECONNRESET' + options.request.emit('error', error) + self.removeSocket(placeholder) + } + } + + function onError(cause) { + connectReq.removeAllListeners() + + debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack) + var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message) + error.code = 'ECONNRESET' + options.request.emit('error', error) + self.removeSocket(placeholder) + } +} + +TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { + var pos = this.sockets.indexOf(socket) + if (pos === -1) return + + this.sockets.splice(pos, 1) + + var pending = this.requests.shift() + if (pending) { + // If we have pending requests and a socket gets closed a new one + // needs to be created to take over in the pool for the one that closed. + this.createConnection(pending) + } +} + +function createSecureSocket(options, cb) { + var self = this + TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { + // 0 is dummy port for v0.6 + var secureSocket = tls.connect(0, mergeOptions({}, self.options, + { servername: options.host + , socket: socket + } + )) + self.sockets[self.sockets.indexOf(socket)] = secureSocket + cb(secureSocket) + }) +} + + +function mergeOptions(target) { + for (var i = 1, len = arguments.length; i < len; ++i) { + var overrides = arguments[i] + if (typeof overrides === 'object') { + var keys = Object.keys(overrides) + for (var j = 0, keyLen = keys.length; j < keyLen; ++j) { + var k = keys[j] + if (overrides[k] !== undefined) { + target[k] = overrides[k] + } + } + } + } + return target +} + + +var debug +if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { + debug = function() { + var args = Array.prototype.slice.call(arguments) + if (typeof args[0] === 'string') { + args[0] = 'TUNNEL: ' + args[0] + } else { + args.unshift('TUNNEL:') + } + console.error.apply(console, args) + } +} else { + debug = function() {} +} +exports.debug = debug // for test diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/package.json new file mode 100644 index 00000000..25495e05 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/node_modules/tunnel-agent/package.json @@ -0,0 +1,60 @@ +{ + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", + "url": "http://www.futurealoof.com" + }, + "name": "tunnel-agent", + "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.", + "version": "0.4.1", + "repository": { + "url": "git+https://github.com/mikeal/tunnel-agent.git" + }, + "main": "index.js", + "dependencies": {}, + "devDependencies": {}, + "optionalDependencies": {}, + "engines": { + "node": "*" + }, + "gitHead": "912a7a6d00e10ec76baf9c9369de280fa5badef3", + "bugs": { + "url": "https://github.com/mikeal/tunnel-agent/issues" + }, + "homepage": "https://github.com/mikeal/tunnel-agent#readme", + "_id": "tunnel-agent@0.4.1", + "scripts": {}, + "_shasum": "bbeecff4d679ce753db9462761a88dfcec3c5ab3", + "_from": "tunnel-agent@>=0.4.1 <0.5.0", + "_npmVersion": "2.11.2", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "dist": { + "shasum": "bbeecff4d679ce753db9462761a88dfcec3c5ab3", + "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "fredkschott", + "email": "fkschott@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/package.json new file mode 100644 index 00000000..5e89b3ff --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/package.json @@ -0,0 +1,113 @@ +{ + "name": "request", + "description": "Simplified HTTP request client.", + "tags": [ + "http", + "simple", + "util", + "utility" + ], + "version": "2.67.0", + "author": { + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/request/request.git" + }, + "bugs": { + "url": "http://github.com/request/request/issues" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=0.8.0" + }, + "main": "index.js", + "dependencies": { + "bl": "~1.0.0", + "caseless": "~0.11.0", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~1.0.0-rc3", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "node-uuid": "~1.4.7", + "qs": "~5.2.0", + "tunnel-agent": "~0.4.1", + "tough-cookie": "~2.2.0", + "http-signature": "~1.1.0", + "oauth-sign": "~0.8.0", + "hawk": "~3.1.0", + "aws-sign2": "~0.6.0", + "stringstream": "~0.0.4", + "combined-stream": "~1.0.5", + "isstream": "~0.1.2", + "is-typedarray": "~1.0.0", + "har-validator": "~2.0.2" + }, + "scripts": { + "test": "npm run lint && npm run test-ci && npm run test-browser", + "test-ci": "taper tests/test-*.js", + "test-cov": "istanbul cover tape tests/test-*.js", + "test-browser": "node tests/browser/start.js", + "lint": "eslint lib/ *.js tests/ && echo Lint passed." + }, + "devDependencies": { + "browserify-istanbul": "^0.1.5", + "browserify": "^12.0.1", + "buffer-equal": "^0.0.1", + "codecov.io": "^0.1.6", + "coveralls": "^2.11.4", + "eslint": "1.9.0", + "function-bind": "^1.0.2", + "istanbul": "^0.4.0", + "karma-browserify": "^4.4.0", + "karma": "^0.13.10", + "karma-cli": "^0.1.1", + "karma-coverage": "^0.5.3", + "karma-phantomjs-launcher": "^0.1.4", + "karma-tap": "^1.0.3", + "rimraf": "^2.2.8", + "server-destroy": "^1.0.1", + "tape": "^4.2.0", + "taper": "^0.4.0", + "bluebird": "^3.0.2" + }, + "gitHead": "76f0655befbe8b37fa246bdca1107cbf57798d9a", + "homepage": "https://github.com/request/request#readme", + "_id": "request@2.67.0", + "_shasum": "8af74780e2bf11ea0ae9aa965c11f11afd272742", + "_from": "request@>=2.67.0 <3.0.0", + "_npmVersion": "3.3.12", + "_nodeVersion": "5.0.0", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "dist": { + "shasum": "8af74780e2bf11ea0ae9aa965c11f11afd272742", + "tarball": "http://registry.npmjs.org/request/-/request-2.67.0.tgz" + }, + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "fredkschott", + "email": "fkschott@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/request/-/request-2.67.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/request.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/request.js new file mode 100644 index 00000000..19c1b92f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/request/request.js @@ -0,0 +1,1395 @@ +'use strict' + +var http = require('http') + , https = require('https') + , url = require('url') + , util = require('util') + , stream = require('stream') + , zlib = require('zlib') + , bl = require('bl') + , hawk = require('hawk') + , aws = require('aws-sign2') + , httpSignature = require('http-signature') + , mime = require('mime-types') + , stringstream = require('stringstream') + , caseless = require('caseless') + , ForeverAgent = require('forever-agent') + , FormData = require('form-data') + , isTypedArray = require('is-typedarray').strict + , helpers = require('./lib/helpers') + , cookies = require('./lib/cookies') + , getProxyFromURI = require('./lib/getProxyFromURI') + , Querystring = require('./lib/querystring').Querystring + , Har = require('./lib/har').Har + , Auth = require('./lib/auth').Auth + , OAuth = require('./lib/oauth').OAuth + , Multipart = require('./lib/multipart').Multipart + , Redirect = require('./lib/redirect').Redirect + , Tunnel = require('./lib/tunnel').Tunnel + +var safeStringify = helpers.safeStringify + , isReadStream = helpers.isReadStream + , toBase64 = helpers.toBase64 + , defer = helpers.defer + , copy = helpers.copy + , version = helpers.version + , globalCookieJar = cookies.jar() + + +var globalPool = {} + +function filterForNonReserved(reserved, options) { + // Filter out properties that are not reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var notReserved = (reserved.indexOf(i) === -1) + if (notReserved) { + object[i] = options[i] + } + } + return object +} + +function filterOutReservedFunctions(reserved, options) { + // Filter out properties that are functions and are reserved. + // Reserved values are passed in at call site. + + var object = {} + for (var i in options) { + var isReserved = !(reserved.indexOf(i) === -1) + var isFunction = (typeof options[i] === 'function') + if (!(isReserved && isFunction)) { + object[i] = options[i] + } + } + return object + +} + +// Function for properly handling a connection error +function connectionErrorHandler(error) { + var socket = this + if (socket.res) { + if (socket.res.request) { + socket.res.request.emit('error', error) + } else { + socket.res.emit('error', error) + } + } else { + socket._httpMessage.emit('error', error) + } +} + +// Return a simpler request object to allow serialization +function requestToJSON() { + var self = this + return { + uri: self.uri, + method: self.method, + headers: self.headers + } +} + +// Return a simpler response object to allow serialization +function responseToJSON() { + var self = this + return { + statusCode: self.statusCode, + body: self.body, + headers: self.headers, + request: requestToJSON.call(self.request) + } +} + +function Request (options) { + // if given the method property in options, set property explicitMethod to true + + // extend the Request instance with any non-reserved properties + // remove any reserved functions from the options object + // set Request instance to be readable and writable + // call init + + var self = this + + // start with HAR, then override with additional options + if (options.har) { + self._har = new Har(self) + options = self._har.options(options) + } + + stream.Stream.call(self) + var reserved = Object.keys(Request.prototype) + var nonReserved = filterForNonReserved(reserved, options) + + util._extend(self, nonReserved) + options = filterOutReservedFunctions(reserved, options) + + self.readable = true + self.writable = true + if (options.method) { + self.explicitMethod = true + } + self._qs = new Querystring(self) + self._auth = new Auth(self) + self._oauth = new OAuth(self) + self._multipart = new Multipart(self) + self._redirect = new Redirect(self) + self._tunnel = new Tunnel(self) + self.init(options) +} + +util.inherits(Request, stream.Stream) + +// Debugging +Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG) +function debug() { + if (Request.debug) { + console.error('REQUEST %s', util.format.apply(util, arguments)) + } +} +Request.prototype.debug = debug + +Request.prototype.init = function (options) { + // init() contains all the code to setup the request object. + // the actual outgoing request is not started until start() is called + // this function is called from both the constructor and on redirect. + var self = this + if (!options) { + options = {} + } + self.headers = self.headers ? copy(self.headers) : {} + + // Delete headers with value undefined since they break + // ClientRequest.OutgoingMessage.setHeader in node 0.12 + for (var headerName in self.headers) { + if (typeof self.headers[headerName] === 'undefined') { + delete self.headers[headerName] + } + } + + caseless.httpify(self, self.headers) + + if (!self.method) { + self.method = options.method || 'GET' + } + if (!self.localAddress) { + self.localAddress = options.localAddress + } + + self._qs.init(options) + + debug(options) + if (!self.pool && self.pool !== false) { + self.pool = globalPool + } + self.dests = self.dests || [] + self.__isRequestRequest = true + + // Protect against double callback + if (!self._callback && self.callback) { + self._callback = self.callback + self.callback = function () { + if (self._callbackCalled) { + return // Print a warning maybe? + } + self._callbackCalled = true + self._callback.apply(self, arguments) + } + self.on('error', self.callback.bind()) + self.on('complete', self.callback.bind(self, null)) + } + + // People use this property instead all the time, so support it + if (!self.uri && self.url) { + self.uri = self.url + delete self.url + } + + // If there's a baseUrl, then use it as the base URL (i.e. uri must be + // specified as a relative path and is appended to baseUrl). + if (self.baseUrl) { + if (typeof self.baseUrl !== 'string') { + return self.emit('error', new Error('options.baseUrl must be a string')) + } + + if (typeof self.uri !== 'string') { + return self.emit('error', new Error('options.uri must be a string when using options.baseUrl')) + } + + if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) { + return self.emit('error', new Error('options.uri must be a path when using options.baseUrl')) + } + + // Handle all cases to make sure that there's only one slash between + // baseUrl and uri. + var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1 + var uriStartsWithSlash = self.uri.indexOf('/') === 0 + + if (baseUrlEndsWithSlash && uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri.slice(1) + } else if (baseUrlEndsWithSlash || uriStartsWithSlash) { + self.uri = self.baseUrl + self.uri + } else if (self.uri === '') { + self.uri = self.baseUrl + } else { + self.uri = self.baseUrl + '/' + self.uri + } + delete self.baseUrl + } + + // A URI is needed by this point, emit error if we haven't been able to get one + if (!self.uri) { + return self.emit('error', new Error('options.uri is a required argument')) + } + + // If a string URI/URL was given, parse it into a URL object + if (typeof self.uri === 'string') { + self.uri = url.parse(self.uri) + } + + // Some URL objects are not from a URL parsed string and need href added + if (!self.uri.href) { + self.uri.href = url.format(self.uri) + } + + // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme + if (self.uri.protocol === 'unix:') { + return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`')) + } + + // Support Unix Sockets + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + if (self.strictSSL === false) { + self.rejectUnauthorized = false + } + + if (!self.uri.pathname) {self.uri.pathname = '/'} + + if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) { + // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar + // Detect and reject it as soon as possible + var faultyUri = url.format(self.uri) + var message = 'Invalid URI "' + faultyUri + '"' + if (Object.keys(options).length === 0) { + // No option ? This can be the sign of a redirect + // As this is a case where the user cannot do anything (they didn't call request directly with this URL) + // they should be warned that it can be caused by a redirection (can save some hair) + message += '. This can be caused by a crappy redirection.' + } + // This error was fatal + self.abort() + return self.emit('error', new Error(message)) + } + + if (!self.hasOwnProperty('proxy')) { + self.proxy = getProxyFromURI(self.uri) + } + + self.tunnel = self._tunnel.isEnabled() + if (self.proxy) { + self._tunnel.setup(options) + } + + self._redirect.onRequest(options) + + self.setHost = false + if (!self.hasHeader('host')) { + var hostHeaderName = self.originalHostHeaderName || 'host' + self.setHeader(hostHeaderName, self.uri.hostname) + if (self.uri.port) { + if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') && + !(self.uri.port === 443 && self.uri.protocol === 'https:') ) { + self.setHeader(hostHeaderName, self.getHeader('host') + (':' + self.uri.port) ) + } + } + self.setHost = true + } + + self.jar(self._jar || options.jar) + + if (!self.uri.port) { + if (self.uri.protocol === 'http:') {self.uri.port = 80} + else if (self.uri.protocol === 'https:') {self.uri.port = 443} + } + + if (self.proxy && !self.tunnel) { + self.port = self.proxy.port + self.host = self.proxy.hostname + } else { + self.port = self.uri.port + self.host = self.uri.hostname + } + + if (options.form) { + self.form(options.form) + } + + if (options.formData) { + var formData = options.formData + var requestForm = self.form() + var appendFormValue = function (key, value) { + if (value.hasOwnProperty('value') && value.hasOwnProperty('options')) { + requestForm.append(key, value.value, value.options) + } else { + requestForm.append(key, value) + } + } + for (var formKey in formData) { + if (formData.hasOwnProperty(formKey)) { + var formValue = formData[formKey] + if (formValue instanceof Array) { + for (var j = 0; j < formValue.length; j++) { + appendFormValue(formKey, formValue[j]) + } + } else { + appendFormValue(formKey, formValue) + } + } + } + } + + if (options.qs) { + self.qs(options.qs) + } + + if (self.uri.path) { + self.path = self.uri.path + } else { + self.path = self.uri.pathname + (self.uri.search || '') + } + + if (self.path.length === 0) { + self.path = '/' + } + + // Auth must happen last in case signing is dependent on other headers + if (options.aws) { + self.aws(options.aws) + } + + if (options.hawk) { + self.hawk(options.hawk) + } + + if (options.httpSignature) { + self.httpSignature(options.httpSignature) + } + + if (options.auth) { + if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) { + options.auth.user = options.auth.username + } + if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) { + options.auth.pass = options.auth.password + } + + self.auth( + options.auth.user, + options.auth.pass, + options.auth.sendImmediately, + options.auth.bearer + ) + } + + if (self.gzip && !self.hasHeader('accept-encoding')) { + self.setHeader('accept-encoding', 'gzip') + } + + if (self.uri.auth && !self.hasHeader('authorization')) { + var uriAuthPieces = self.uri.auth.split(':').map(function(item) {return self._qs.unescape(item)}) + self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true) + } + + if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) { + var proxyAuthPieces = self.proxy.auth.split(':').map(function(item) {return self._qs.unescape(item)}) + var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':')) + self.setHeader('proxy-authorization', authHeader) + } + + if (self.proxy && !self.tunnel) { + self.path = (self.uri.protocol + '//' + self.uri.host + self.path) + } + + if (options.json) { + self.json(options.json) + } + if (options.multipart) { + self.multipart(options.multipart) + } + + if (options.time) { + self.timing = true + self.elapsedTime = self.elapsedTime || 0 + } + + function setContentLength () { + if (isTypedArray(self.body)) { + self.body = new Buffer(self.body) + } + + if (!self.hasHeader('content-length')) { + var length + if (typeof self.body === 'string') { + length = Buffer.byteLength(self.body) + } + else if (Array.isArray(self.body)) { + length = self.body.reduce(function (a, b) {return a + b.length}, 0) + } + else { + length = self.body.length + } + + if (length) { + self.setHeader('content-length', length) + } else { + self.emit('error', new Error('Argument error, options.body.')) + } + } + } + if (self.body) { + setContentLength() + } + + if (options.oauth) { + self.oauth(options.oauth) + } else if (self._oauth.params && self.hasHeader('authorization')) { + self.oauth(self._oauth.params) + } + + var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol + , defaultModules = {'http:':http, 'https:':https} + , httpModules = self.httpModules || {} + + self.httpModule = httpModules[protocol] || defaultModules[protocol] + + if (!self.httpModule) { + return self.emit('error', new Error('Invalid protocol: ' + protocol)) + } + + if (options.ca) { + self.ca = options.ca + } + + if (!self.agent) { + if (options.agentOptions) { + self.agentOptions = options.agentOptions + } + + if (options.agentClass) { + self.agentClass = options.agentClass + } else if (options.forever) { + var v = version() + // use ForeverAgent in node 0.10- only + if (v.major === 0 && v.minor <= 10) { + self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL + } else { + self.agentClass = self.httpModule.Agent + self.agentOptions = self.agentOptions || {} + self.agentOptions.keepAlive = true + } + } else { + self.agentClass = self.httpModule.Agent + } + } + + if (self.pool === false) { + self.agent = false + } else { + self.agent = self.agent || self.getNewAgent() + } + + self.on('pipe', function (src) { + if (self.ntick && self._started) { + self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.')) + } + self.src = src + if (isReadStream(src)) { + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', mime.lookup(src.path)) + } + } else { + if (src.headers) { + for (var i in src.headers) { + if (!self.hasHeader(i)) { + self.setHeader(i, src.headers[i]) + } + } + } + if (self._json && !self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + if (src.method && !self.explicitMethod) { + self.method = src.method + } + } + + // self.on('pipe', function () { + // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.') + // }) + }) + + defer(function () { + if (self._aborted) { + return + } + + var end = function () { + if (self._form) { + if (!self._auth.hasAuth) { + self._form.pipe(self) + } + else if (self._auth.hasAuth && self._auth.sentAuth) { + self._form.pipe(self) + } + } + if (self._multipart && self._multipart.chunked) { + self._multipart.body.pipe(self) + } + if (self.body) { + setContentLength() + if (Array.isArray(self.body)) { + self.body.forEach(function (part) { + self.write(part) + }) + } else { + self.write(self.body) + } + self.end() + } else if (self.requestBodyStream) { + console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.') + self.requestBodyStream.pipe(self) + } else if (!self.src) { + if (self._auth.hasAuth && !self._auth.sentAuth) { + self.end() + return + } + if (self.method !== 'GET' && typeof self.method !== 'undefined') { + self.setHeader('content-length', 0) + } + self.end() + } + } + + if (self._form && !self.hasHeader('content-length')) { + // Before ending the request, we had to compute the length of the whole form, asyncly + self.setHeader(self._form.getHeaders(), true) + self._form.getLength(function (err, length) { + if (!err) { + self.setHeader('content-length', length) + } + end() + }) + } else { + end() + } + + self.ntick = true + }) + +} + +Request.prototype.getNewAgent = function () { + var self = this + var Agent = self.agentClass + var options = {} + if (self.agentOptions) { + for (var i in self.agentOptions) { + options[i] = self.agentOptions[i] + } + } + if (self.ca) { + options.ca = self.ca + } + if (self.ciphers) { + options.ciphers = self.ciphers + } + if (self.secureProtocol) { + options.secureProtocol = self.secureProtocol + } + if (self.secureOptions) { + options.secureOptions = self.secureOptions + } + if (typeof self.rejectUnauthorized !== 'undefined') { + options.rejectUnauthorized = self.rejectUnauthorized + } + + if (self.cert && self.key) { + options.key = self.key + options.cert = self.cert + } + + if (self.pfx) { + options.pfx = self.pfx + } + + if (self.passphrase) { + options.passphrase = self.passphrase + } + + var poolKey = '' + + // different types of agents are in different pools + if (Agent !== self.httpModule.Agent) { + poolKey += Agent.name + } + + // ca option is only relevant if proxy or destination are https + var proxy = self.proxy + if (typeof proxy === 'string') { + proxy = url.parse(proxy) + } + var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:' + + if (isHttps) { + if (options.ca) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ca + } + + if (typeof options.rejectUnauthorized !== 'undefined') { + if (poolKey) { + poolKey += ':' + } + poolKey += options.rejectUnauthorized + } + + if (options.cert) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.cert.toString('ascii') + options.key.toString('ascii') + } + + if (options.pfx) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.pfx.toString('ascii') + } + + if (options.ciphers) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.ciphers + } + + if (options.secureProtocol) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureProtocol + } + + if (options.secureOptions) { + if (poolKey) { + poolKey += ':' + } + poolKey += options.secureOptions + } + } + + if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) { + // not doing anything special. Use the globalAgent + return self.httpModule.globalAgent + } + + // we're using a stored agent. Make sure it's protocol-specific + poolKey = self.uri.protocol + poolKey + + // generate a new agent for this setting if none yet exists + if (!self.pool[poolKey]) { + self.pool[poolKey] = new Agent(options) + // properly set maxSockets on new agents + if (self.pool.maxSockets) { + self.pool[poolKey].maxSockets = self.pool.maxSockets + } + } + + return self.pool[poolKey] +} + +Request.prototype.start = function () { + // start() is called once we are ready to send the outgoing HTTP request. + // this is usually called on the first write(), end() or on nextTick() + var self = this + + if (self._aborted) { + return + } + + self._started = true + self.method = self.method || 'GET' + self.href = self.uri.href + + if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) { + self.setHeader('content-length', self.src.stat.size) + } + if (self._aws) { + self.aws(self._aws, true) + } + + // We have a method named auth, which is completely different from the http.request + // auth option. If we don't remove it, we're gonna have a bad time. + var reqOptions = copy(self) + delete reqOptions.auth + + debug('make request', self.uri.href) + + self.req = self.httpModule.request(reqOptions) + + if (self.timing) { + self.startTime = new Date().getTime() + } + + if (self.timeout && !self.timeoutTimer) { + var timeout = self.timeout < 0 ? 0 : self.timeout + // Set a timeout in memory - this block will throw if the server takes more + // than `timeout` to write the HTTP status and headers (corresponding to + // the on('response') event on the client). NB: this measures wall-clock + // time, not the time between bytes sent by the server. + self.timeoutTimer = setTimeout(function () { + var connectTimeout = self.req.socket && self.req.socket.readable === false + self.abort() + var e = new Error('ETIMEDOUT') + e.code = 'ETIMEDOUT' + e.connect = connectTimeout + self.emit('error', e) + }, timeout) + + if (self.req.setTimeout) { // only works on node 0.6+ + // Set an additional timeout on the socket, via the `setsockopt` syscall. + // This timeout sets the amount of time to wait *between* bytes sent + // from the server, and may or may not correspond to the wall-clock time + // elapsed from the start of the request. + // + // In particular, it's useful for erroring if the server fails to send + // data halfway through streaming a response. + self.req.setTimeout(timeout, function () { + if (self.req) { + self.req.abort() + var e = new Error('ESOCKETTIMEDOUT') + e.code = 'ESOCKETTIMEDOUT' + e.connect = false + self.emit('error', e) + } + }) + } + } + + self.req.on('response', self.onRequestResponse.bind(self)) + self.req.on('error', self.onRequestError.bind(self)) + self.req.on('drain', function() { + self.emit('drain') + }) + self.req.on('socket', function(socket) { + self.emit('socket', socket) + }) + + self.on('end', function() { + if ( self.req.connection ) { + self.req.connection.removeListener('error', connectionErrorHandler) + } + }) + self.emit('request', self.req) +} + +Request.prototype.onRequestError = function (error) { + var self = this + if (self._aborted) { + return + } + if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' + && self.agent.addRequestNoreuse) { + self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) } + self.start() + self.req.end() + return + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + self.emit('error', error) +} + +Request.prototype.onRequestResponse = function (response) { + var self = this + debug('onRequestResponse', self.uri.href, response.statusCode, response.headers) + response.on('end', function() { + if (self.timing) { + self.elapsedTime += (new Date().getTime() - self.startTime) + debug('elapsed time', self.elapsedTime) + response.elapsedTime = self.elapsedTime + } + debug('response end', self.uri.href, response.statusCode, response.headers) + }) + + // The check on response.connection is a workaround for browserify. + if (response.connection && response.connection.listeners('error').indexOf(connectionErrorHandler) === -1) { + response.connection.setMaxListeners(0) + response.connection.once('error', connectionErrorHandler) + } + if (self._aborted) { + debug('aborted', self.uri.href) + response.resume() + return + } + + self.response = response + response.request = self + response.toJSON = responseToJSON + + // XXX This is different on 0.10, because SSL is strict by default + if (self.httpModule === https && + self.strictSSL && (!response.hasOwnProperty('socket') || + !response.socket.authorized)) { + debug('strict ssl error', self.uri.href) + var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL' + self.emit('error', new Error('SSL Error: ' + sslErr)) + return + } + + // Save the original host before any redirect (if it changes, we need to + // remove any authorization headers). Also remember the case of the header + // name because lots of broken servers expect Host instead of host and we + // want the caller to be able to specify this. + self.originalHost = self.getHeader('host') + if (!self.originalHostHeaderName) { + self.originalHostHeaderName = self.hasHeader('host') + } + if (self.setHost) { + self.removeHeader('host') + } + if (self.timeout && self.timeoutTimer) { + clearTimeout(self.timeoutTimer) + self.timeoutTimer = null + } + + var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar + var addCookie = function (cookie) { + //set the cookie if it's domain in the href's domain. + try { + targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true}) + } catch (e) { + self.emit('error', e) + } + } + + response.caseless = caseless(response.headers) + + if (response.caseless.has('set-cookie') && (!self._disableCookies)) { + var headerName = response.caseless.has('set-cookie') + if (Array.isArray(response.headers[headerName])) { + response.headers[headerName].forEach(addCookie) + } else { + addCookie(response.headers[headerName]) + } + } + + if (self._redirect.onResponse(response)) { + return // Ignore the rest of the response + } else { + // Be a good stream and emit end when the response is finished. + // Hack to emit end on close because of a core bug that never fires end + response.on('close', function () { + if (!self._ended) { + self.response.emit('end') + } + }) + + response.on('end', function () { + self._ended = true + }) + + var responseContent + if (self.gzip) { + var contentEncoding = response.headers['content-encoding'] || 'identity' + contentEncoding = contentEncoding.trim().toLowerCase() + + if (contentEncoding === 'gzip') { + responseContent = zlib.createGunzip() + response.pipe(responseContent) + } else { + // Since previous versions didn't check for Content-Encoding header, + // ignore any invalid values to preserve backwards-compatibility + if (contentEncoding !== 'identity') { + debug('ignoring unrecognized Content-Encoding ' + contentEncoding) + } + responseContent = response + } + } else { + responseContent = response + } + + if (self.encoding) { + if (self.dests.length !== 0) { + console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.') + } else if (responseContent.setEncoding) { + responseContent.setEncoding(self.encoding) + } else { + // Should only occur on node pre-v0.9.4 (joyent/node@9b5abe5) with + // zlib streams. + // If/When support for 0.9.4 is dropped, this should be unnecessary. + responseContent = responseContent.pipe(stringstream(self.encoding)) + } + } + + if (self._paused) { + responseContent.pause() + } + + self.responseContent = responseContent + + self.emit('response', response) + + self.dests.forEach(function (dest) { + self.pipeDest(dest) + }) + + responseContent.on('data', function (chunk) { + self._destdata = true + self.emit('data', chunk) + }) + responseContent.on('end', function (chunk) { + self.emit('end', chunk) + }) + responseContent.on('error', function (error) { + self.emit('error', error) + }) + responseContent.on('close', function () {self.emit('close')}) + + if (self.callback) { + self.readResponseBody(response) + } + //if no callback + else { + self.on('end', function () { + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + self.emit('complete', response) + }) + } + } + debug('finish init function', self.uri.href) +} + +Request.prototype.readResponseBody = function (response) { + var self = this + debug('reading response\'s body') + var buffer = bl() + , strings = [] + + self.on('data', function (chunk) { + if (Buffer.isBuffer(chunk)) { + buffer.append(chunk) + } else { + strings.push(chunk) + } + }) + self.on('end', function () { + debug('end event', self.uri.href) + if (self._aborted) { + debug('aborted', self.uri.href) + return + } + + if (buffer.length) { + debug('has body', self.uri.href, buffer.length) + if (self.encoding === null) { + // response.body = buffer + // can't move to this until https://github.com/rvagg/bl/issues/13 + response.body = buffer.slice() + } else { + response.body = buffer.toString(self.encoding) + } + } else if (strings.length) { + // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation. + // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse(). + if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') { + strings[0] = strings[0].substring(1) + } + response.body = strings.join('') + } + + if (self._json) { + try { + response.body = JSON.parse(response.body, self._jsonReviver) + } catch (e) { + debug('invalid JSON received', self.uri.href) + } + } + debug('emitting complete', self.uri.href) + if (typeof response.body === 'undefined' && !self._json) { + response.body = self.encoding === null ? new Buffer(0) : '' + } + self.emit('complete', response, response.body) + }) +} + +Request.prototype.abort = function () { + var self = this + self._aborted = true + + if (self.req) { + self.req.abort() + } + else if (self.response) { + self.response.abort() + } + + self.emit('abort') +} + +Request.prototype.pipeDest = function (dest) { + var self = this + var response = self.response + // Called after the response is received + if (dest.headers && !dest.headersSent) { + if (response.caseless.has('content-type')) { + var ctname = response.caseless.has('content-type') + if (dest.setHeader) { + dest.setHeader(ctname, response.headers[ctname]) + } + else { + dest.headers[ctname] = response.headers[ctname] + } + } + + if (response.caseless.has('content-length')) { + var clname = response.caseless.has('content-length') + if (dest.setHeader) { + dest.setHeader(clname, response.headers[clname]) + } else { + dest.headers[clname] = response.headers[clname] + } + } + } + if (dest.setHeader && !dest.headersSent) { + for (var i in response.headers) { + // If the response content is being decoded, the Content-Encoding header + // of the response doesn't represent the piped content, so don't pass it. + if (!self.gzip || i !== 'content-encoding') { + dest.setHeader(i, response.headers[i]) + } + } + dest.statusCode = response.statusCode + } + if (self.pipefilter) { + self.pipefilter(response, dest) + } +} + +Request.prototype.qs = function (q, clobber) { + var self = this + var base + if (!clobber && self.uri.query) { + base = self._qs.parse(self.uri.query) + } else { + base = {} + } + + for (var i in q) { + base[i] = q[i] + } + + var qs = self._qs.stringify(base) + + if (qs === '') { + return self + } + + self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs) + self.url = self.uri + self.path = self.uri.path + + if (self.uri.host === 'unix') { + self.enableUnixSocket() + } + + return self +} +Request.prototype.form = function (form) { + var self = this + if (form) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.setHeader('content-type', 'application/x-www-form-urlencoded') + } + self.body = (typeof form === 'string') + ? self._qs.rfc3986(form.toString('utf8')) + : self._qs.stringify(form).toString('utf8') + return self + } + // create form-data object + self._form = new FormData() + self._form.on('error', function(err) { + err.message = 'form-data: ' + err.message + self.emit('error', err) + self.abort() + }) + return self._form +} +Request.prototype.multipart = function (multipart) { + var self = this + + self._multipart.onRequest(multipart) + + if (!self._multipart.chunked) { + self.body = self._multipart.body + } + + return self +} +Request.prototype.json = function (val) { + var self = this + + if (!self.hasHeader('accept')) { + self.setHeader('accept', 'application/json') + } + + self._json = true + if (typeof val === 'boolean') { + if (self.body !== undefined) { + if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) { + self.body = safeStringify(self.body) + } else { + self.body = self._qs.rfc3986(self.body) + } + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + } else { + self.body = safeStringify(val) + if (!self.hasHeader('content-type')) { + self.setHeader('content-type', 'application/json') + } + } + + if (typeof self.jsonReviver === 'function') { + self._jsonReviver = self.jsonReviver + } + + return self +} +Request.prototype.getHeader = function (name, headers) { + var self = this + var result, re, match + if (!headers) { + headers = self.headers + } + Object.keys(headers).forEach(function (key) { + if (key.length !== name.length) { + return + } + re = new RegExp(name, 'i') + match = key.match(re) + if (match) { + result = headers[key] + } + }) + return result +} +Request.prototype.enableUnixSocket = function () { + // Get the socket & request paths from the URL + var unixParts = this.uri.path.split(':') + , host = unixParts[0] + , path = unixParts[1] + // Apply unix properties to request + this.socketPath = host + this.uri.pathname = path + this.uri.path = path + this.uri.host = host + this.uri.hostname = host + this.uri.isUnix = true +} + + +Request.prototype.auth = function (user, pass, sendImmediately, bearer) { + var self = this + + self._auth.onRequest(user, pass, sendImmediately, bearer) + + return self +} +Request.prototype.aws = function (opts, now) { + var self = this + + if (!now) { + self._aws = opts + return self + } + var date = new Date() + self.setHeader('date', date.toUTCString()) + var auth = + { key: opts.key + , secret: opts.secret + , verb: self.method.toUpperCase() + , date: date + , contentType: self.getHeader('content-type') || '' + , md5: self.getHeader('content-md5') || '' + , amazonHeaders: aws.canonicalizeHeaders(self.headers) + } + var path = self.uri.path + if (opts.bucket && path) { + auth.resource = '/' + opts.bucket + path + } else if (opts.bucket && !path) { + auth.resource = '/' + opts.bucket + } else if (!opts.bucket && path) { + auth.resource = path + } else if (!opts.bucket && !path) { + auth.resource = '/' + } + auth.resource = aws.canonicalizeResource(auth.resource) + self.setHeader('authorization', aws.authorization(auth)) + + return self +} +Request.prototype.httpSignature = function (opts) { + var self = this + httpSignature.signRequest({ + getHeader: function(header) { + return self.getHeader(header, self.headers) + }, + setHeader: function(header, value) { + self.setHeader(header, value) + }, + method: self.method, + path: self.path + }, opts) + debug('httpSignature authorization', self.getHeader('authorization')) + + return self +} +Request.prototype.hawk = function (opts) { + var self = this + self.setHeader('Authorization', hawk.client.header(self.uri, self.method, opts).field) +} +Request.prototype.oauth = function (_oauth) { + var self = this + + self._oauth.onRequest(_oauth) + + return self +} + +Request.prototype.jar = function (jar) { + var self = this + var cookies + + if (self._redirect.redirectsFollowed === 0) { + self.originalCookieHeader = self.getHeader('cookie') + } + + if (!jar) { + // disable cookies + cookies = false + self._disableCookies = true + } else { + var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar + var urihref = self.uri.href + //fetch cookie in the Specified host + if (targetCookieJar) { + cookies = targetCookieJar.getCookieString(urihref) + } + } + + //if need cookie and cookie is not empty + if (cookies && cookies.length) { + if (self.originalCookieHeader) { + // Don't overwrite existing Cookie header + self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies) + } else { + self.setHeader('cookie', cookies) + } + } + self._jar = jar + return self +} + + +// Stream API +Request.prototype.pipe = function (dest, opts) { + var self = this + + if (self.response) { + if (self._destdata) { + self.emit('error', new Error('You cannot pipe after data has been emitted from the response.')) + } else if (self._ended) { + self.emit('error', new Error('You cannot pipe after the response has been ended.')) + } else { + stream.Stream.prototype.pipe.call(self, dest, opts) + self.pipeDest(dest) + return dest + } + } else { + self.dests.push(dest) + stream.Stream.prototype.pipe.call(self, dest, opts) + return dest + } +} +Request.prototype.write = function () { + var self = this + if (self._aborted) {return} + + if (!self._started) { + self.start() + } + return self.req.write.apply(self.req, arguments) +} +Request.prototype.end = function (chunk) { + var self = this + if (self._aborted) {return} + + if (chunk) { + self.write(chunk) + } + if (!self._started) { + self.start() + } + self.req.end() +} +Request.prototype.pause = function () { + var self = this + if (!self.responseContent) { + self._paused = true + } else { + self.responseContent.pause.apply(self.responseContent, arguments) + } +} +Request.prototype.resume = function () { + var self = this + if (!self.responseContent) { + self._paused = false + } else { + self.responseContent.resume.apply(self.responseContent, arguments) + } +} +Request.prototype.destroy = function () { + var self = this + if (!self._ended) { + self.end() + } else if (self.response) { + self.response.destroy() + } +} + +Request.defaultProxyHeaderWhiteList = + Tunnel.defaultProxyHeaderWhiteList.slice() + +Request.defaultProxyHeaderExclusiveList = + Tunnel.defaultProxyHeaderExclusiveList.slice() + +// Exports + +Request.prototype.toJSON = requestToJSON +module.exports = Request diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.documentup.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.documentup.json new file mode 100644 index 00000000..57fe3011 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.documentup.json @@ -0,0 +1,6 @@ +{ + "name": "ShellJS", + "twitter": [ + "r2r" + ] +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.jshintrc b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.jshintrc new file mode 100644 index 00000000..a80c559a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.jshintrc @@ -0,0 +1,7 @@ +{ + "loopfunc": true, + "sub": true, + "undef": true, + "unused": true, + "node": true +} \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.npmignore b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.npmignore new file mode 100644 index 00000000..6b20c38a --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.npmignore @@ -0,0 +1,2 @@ +test/ +tmp/ \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.travis.yml b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.travis.yml new file mode 100644 index 00000000..1b3280a5 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/.travis.yml @@ -0,0 +1,6 @@ +language: node_js +node_js: + - "0.10" + - "0.11" + - "0.12" + diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/LICENSE b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/LICENSE new file mode 100644 index 00000000..1b35ee9f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2012, Artur Adib +All rights reserved. + +You may use this project under the terms of the New BSD license as follows: + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of Artur Adib nor the + names of the contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/README.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/README.md new file mode 100644 index 00000000..d08d13e8 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/README.md @@ -0,0 +1,579 @@ +# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs) + +ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts! + +The project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like: + ++ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader ++ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger ++ [JSHint](http://jshint.com) - Most popular JavaScript linter ++ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers ++ [Yeoman](http://yeoman.io/) - Web application stack and development tool ++ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation + +and [many more](https://npmjs.org/browse/depended/shelljs). + +Connect with [@r2r](http://twitter.com/r2r) on Twitter for questions, suggestions, etc. + +## Installing + +Via npm: + +```bash +$ npm install [-g] shelljs +``` + +If the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to +run ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder: + +```bash +$ shjs my_script +``` + +You can also just copy `shell.js` into your project's directory, and `require()` accordingly. + + +## Examples + +### JavaScript + +```javascript +require('shelljs/global'); + +if (!which('git')) { + echo('Sorry, this script requires git'); + exit(1); +} + +// Copy files to release dir +mkdir('-p', 'out/Release'); +cp('-R', 'stuff/*', 'out/Release'); + +// Replace macros in each .js file +cd('lib'); +ls('*.js').forEach(function(file) { + sed('-i', 'BUILD_VERSION', 'v0.1.2', file); + sed('-i', /.*REMOVE_THIS_LINE.*\n/, '', file); + sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file); +}); +cd('..'); + +// Run external tool synchronously +if (exec('git commit -am "Auto-commit"').code !== 0) { + echo('Error: Git commit failed'); + exit(1); +} +``` + +### CoffeeScript + +```coffeescript +require 'shelljs/global' + +if not which 'git' + echo 'Sorry, this script requires git' + exit 1 + +# Copy files to release dir +mkdir '-p', 'out/Release' +cp '-R', 'stuff/*', 'out/Release' + +# Replace macros in each .js file +cd 'lib' +for file in ls '*.js' + sed '-i', 'BUILD_VERSION', 'v0.1.2', file + sed '-i', /.*REMOVE_THIS_LINE.*\n/, '', file + sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat 'macro.js', file +cd '..' + +# Run external tool synchronously +if (exec 'git commit -am "Auto-commit"').code != 0 + echo 'Error: Git commit failed' + exit 1 +``` + +## Global vs. Local + +The example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`. + +Example: + +```javascript +var shell = require('shelljs'); +shell.echo('hello world'); +``` + +## Make tool + +A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. In this case all shell objects are global, and command line arguments will cause the script to execute only the corresponding function in the global `target` object. To avoid redundant calls, target functions are executed only once per script. + +Example (CoffeeScript): + +```coffeescript +require 'shelljs/make' + +target.all = -> + target.bundle() + target.docs() + +target.bundle = -> + cd __dirname + mkdir 'build' + cd 'lib' + (cat '*.js').to '../build/output.js' + +target.docs = -> + cd __dirname + mkdir 'docs' + cd 'lib' + for file in ls '*.js' + text = grep '//@', file # extract special comments + text.replace '//@', '' # remove comment tags + text.to 'docs/my_docs.md' +``` + +To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`. + +You can also pass arguments to your targets by using the `--` separator. For example, to pass `arg1` and `arg2` to a target `bundle`, do `$ node make bundle -- arg1 arg2`: + +```javascript +require('shelljs/make'); + +target.bundle = function(argsArray) { + // argsArray = ['arg1', 'arg2'] + /* ... */ +} +``` + + + + + +## Command reference + + +All commands run synchronously, unless otherwise stated. + + +### cd('dir') +Changes to directory `dir` for the duration of the script + + +### pwd() +Returns the current directory. + + +### ls([options ,] path [,path ...]) +### ls([options ,] path_array) +Available options: + ++ `-R`: recursive ++ `-A`: all files (include files beginning with `.`, except for `.` and `..`) + +Examples: + +```javascript +ls('projs/*.js'); +ls('-R', '/users/me', '/tmp'); +ls('-R', ['/users/me', '/tmp']); // same as above +``` + +Returns array of files in the given path, or in current directory if no path provided. + + +### find(path [,path ...]) +### find(path_array) +Examples: + +```javascript +find('src', 'lib'); +find(['src', 'lib']); // same as above +find('.').filter(function(file) { return file.match(/\.js$/); }); +``` + +Returns array of all files (however deep) in the given paths. + +The main difference from `ls('-R', path)` is that the resulting file names +include the base directories, e.g. `lib/resources/file1` instead of just `file1`. + + +### cp([options ,] source [,source ...], dest) +### cp([options ,] source_array, dest) +Available options: + ++ `-f`: force ++ `-r, -R`: recursive + +Examples: + +```javascript +cp('file1', 'dir1'); +cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp'); +cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above +``` + +Copies files. The wildcard `*` is accepted. + + +### rm([options ,] file [, file ...]) +### rm([options ,] file_array) +Available options: + ++ `-f`: force ++ `-r, -R`: recursive + +Examples: + +```javascript +rm('-rf', '/tmp/*'); +rm('some_file.txt', 'another_file.txt'); +rm(['some_file.txt', 'another_file.txt']); // same as above +``` + +Removes files. The wildcard `*` is accepted. + + +### mv(source [, source ...], dest') +### mv(source_array, dest') +Available options: + ++ `f`: force + +Examples: + +```javascript +mv('-f', 'file', 'dir/'); +mv('file1', 'file2', 'dir/'); +mv(['file1', 'file2'], 'dir/'); // same as above +``` + +Moves files. The wildcard `*` is accepted. + + +### mkdir([options ,] dir [, dir ...]) +### mkdir([options ,] dir_array) +Available options: + ++ `p`: full path (will create intermediate dirs if necessary) + +Examples: + +```javascript +mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +``` + +Creates directories. + + +### test(expression) +Available expression primaries: + ++ `'-b', 'path'`: true if path is a block device ++ `'-c', 'path'`: true if path is a character device ++ `'-d', 'path'`: true if path is a directory ++ `'-e', 'path'`: true if path exists ++ `'-f', 'path'`: true if path is a regular file ++ `'-L', 'path'`: true if path is a symbolic link ++ `'-p', 'path'`: true if path is a pipe (FIFO) ++ `'-S', 'path'`: true if path is a socket + +Examples: + +```javascript +if (test('-d', path)) { /* do something with dir */ }; +if (!test('-f', path)) continue; // skip if it's a regular file +``` + +Evaluates expression using the available primaries and returns corresponding value. + + +### cat(file [, file ...]) +### cat(file_array) + +Examples: + +```javascript +var str = cat('file*.txt'); +var str = cat('file1', 'file2'); +var str = cat(['file1', 'file2']); // same as above +``` + +Returns a string containing the given file, or a concatenated string +containing the files if more than one file is given (a new line character is +introduced between each file). Wildcard `*` accepted. + + +### 'string'.to(file) + +Examples: + +```javascript +cat('input.txt').to('output.txt'); +``` + +Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as +those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ + + +### 'string'.toEnd(file) + +Examples: + +```javascript +cat('input.txt').toEnd('output.txt'); +``` + +Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as +those returned by `cat`, `grep`, etc). + + +### sed([options ,] search_regex, replacement, file) +Available options: + ++ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ + +Examples: + +```javascript +sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +``` + +Reads an input string from `file` and performs a JavaScript `replace()` on the input +using the given search regex and replacement string or function. Returns the new string after replacement. + + +### grep([options ,] regex_filter, file [, file ...]) +### grep([options ,] regex_filter, file_array) +Available options: + ++ `-v`: Inverse the sense of the regex and print the lines not matching the criteria. + +Examples: + +```javascript +grep('-v', 'GLOBAL_VARIABLE', '*.js'); +grep('GLOBAL_VARIABLE', '*.js'); +``` + +Reads input string from given files and returns a string containing all lines of the +file that match the given `regex_filter`. Wildcard `*` accepted. + + +### which(command) + +Examples: + +```javascript +var nodeExec = which('node'); +``` + +Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. +Returns string containing the absolute path to the command. + + +### echo(string [,string ...]) + +Examples: + +```javascript +echo('hello world'); +var str = echo('hello world'); +``` + +Prints string to stdout, and returns string with additional utility methods +like `.to()`. + + +### pushd([options,] [dir | '-N' | '+N']) + +Available options: + ++ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. + +Arguments: + ++ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. ++ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. ++ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. + +Examples: + +```javascript +// process.cwd() === '/usr' +pushd('/etc'); // Returns /etc /usr +pushd('+1'); // Returns /usr /etc +``` + +Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. + +### popd([options,] ['-N' | '+N']) + +Available options: + ++ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. + +Arguments: + ++ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. ++ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. + +Examples: + +```javascript +echo(process.cwd()); // '/usr' +pushd('/etc'); // '/etc /usr' +echo(process.cwd()); // '/etc' +popd(); // '/usr' +echo(process.cwd()); // '/usr' +``` + +When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. + +### dirs([options | '+N' | '-N']) + +Available options: + ++ `-c`: Clears the directory stack by deleting all of the elements. + +Arguments: + ++ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. ++ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. + +Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. + +See also: pushd, popd + + +### ln(options, source, dest) +### ln(source, dest) +Available options: + ++ `s`: symlink ++ `f`: force + +Examples: + +```javascript +ln('file', 'newlink'); +ln('-sf', 'file', 'existing'); +``` + +Links source to dest. Use -f to force the link, should dest already exist. + + +### exit(code) +Exits the current process with the given exit code. + +### env['VAR_NAME'] +Object containing environment variables (both getter and setter). Shortcut to process.env. + +### exec(command [, options] [, callback]) +Available options (all `false` by default): + ++ `async`: Asynchronous execution. Defaults to true if a callback is provided. ++ `silent`: Do not echo program output to console. + +Examples: + +```javascript +var version = exec('node --version', {silent:true}).output; + +var child = exec('some_long_running_process', {async:true}); +child.stdout.on('data', function(data) { + /* ... do something with data ... */ +}); + +exec('some_long_running_process', function(code, output) { + console.log('Exit code:', code); + console.log('Program output:', output); +}); +``` + +Executes the given `command` _synchronously_, unless otherwise specified. +When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's +`output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and +the `callback` gets the arguments `(code, output)`. + +**Note:** For long-lived processes, it's best to run `exec()` asynchronously as +the current synchronous implementation uses a lot of CPU. This should be getting +fixed soon. + + +### chmod(octal_mode || octal_string, file) +### chmod(symbolic_mode, file) + +Available options: + ++ `-v`: output a diagnostic for every file processed ++ `-c`: like verbose but report only when a change is made ++ `-R`: change files and directories recursively + +Examples: + +```javascript +chmod(755, '/Users/brandon'); +chmod('755', '/Users/brandon'); // same as above +chmod('u+x', '/Users/brandon'); +``` + +Alters the permissions of a file or directory by either specifying the +absolute permissions in octal form or expressing the changes in symbols. +This command tries to mimic the POSIX behavior as much as possible. +Notable exceptions: + ++ In symbolic modes, 'a-r' and '-r' are identical. No consideration is + given to the umask. ++ There is no "quiet" option since default behavior is to run silent. + + +## Non-Unix commands + + +### tempdir() + +Examples: + +```javascript +var tmp = tempdir(); // "/tmp" for most *nix platforms +``` + +Searches and returns string containing a writeable, platform-dependent temporary directory. +Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). + + +### error() +Tests if error occurred in the last command. Returns `null` if no error occurred, +otherwise returns string explaining the error + + +## Configuration + + +### config.silent +Example: + +```javascript +var sh = require('shelljs'); +var silentState = sh.config.silent; // save old silent state +sh.config.silent = true; +/* ... */ +sh.config.silent = silentState; // restore old silent state +``` + +Suppresses all command output if `true`, except for `echo()` calls. +Default is `false`. + +### config.fatal +Example: + +```javascript +require('shelljs/global'); +config.fatal = true; +cp('this_file_does_not_exist', '/dev/null'); // dies here +/* more commands... */ +``` + +If `true` the script will die on errors. Default is `false`. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/RELEASE.md b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/RELEASE.md new file mode 100644 index 00000000..69ef3fbb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/RELEASE.md @@ -0,0 +1,9 @@ +# Release steps + +* Ensure master passes CI tests +* Bump version in package.json. Any breaking change or new feature should bump minor (or even major). Non-breaking changes or fixes can just bump patch. +* Update README manually if the changes are not documented in-code. If so, run `scripts/generate-docs.js` +* Commit +* `$ git tag ` (see `git tag -l` for latest) +* `$ git push origin master --tags` +* `$ npm publish .` diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/bin/shjs b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/bin/shjs new file mode 100755 index 00000000..d239a7ad --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/bin/shjs @@ -0,0 +1,51 @@ +#!/usr/bin/env node +require('../global'); + +if (process.argv.length < 3) { + console.log('ShellJS: missing argument (script name)'); + console.log(); + process.exit(1); +} + +var args, + scriptName = process.argv[2]; +env['NODE_PATH'] = __dirname + '/../..'; + +if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { + if (test('-f', scriptName + '.js')) + scriptName += '.js'; + if (test('-f', scriptName + '.coffee')) + scriptName += '.coffee'; +} + +if (!test('-f', scriptName)) { + console.log('ShellJS: script not found ('+scriptName+')'); + console.log(); + process.exit(1); +} + +args = process.argv.slice(3); + +for (var i = 0, l = args.length; i < l; i++) { + if (args[i][0] !== "-"){ + args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words + } +} + +if (scriptName.match(/\.coffee$/)) { + // + // CoffeeScript + // + if (which('coffee')) { + exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true }); + } else { + console.log('ShellJS: CoffeeScript interpreter not found'); + console.log(); + process.exit(1); + } +} else { + // + // JavaScript + // + exec('node ' + scriptName + ' ' + args.join(' '), { async: true }); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/global.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/global.js new file mode 100644 index 00000000..97f0033c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/global.js @@ -0,0 +1,3 @@ +var shell = require('./shell.js'); +for (var cmd in shell) + global[cmd] = shell[cmd]; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/make.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/make.js new file mode 100644 index 00000000..f78b4cfd --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/make.js @@ -0,0 +1,56 @@ +require('./global'); + +global.config.fatal = true; +global.target = {}; + +var args = process.argv.slice(2), + targetArgs, + dashesLoc = args.indexOf('--'); + +// split args, everything after -- if only for targets +if (dashesLoc > -1) { + targetArgs = args.slice(dashesLoc + 1, args.length); + args = args.slice(0, dashesLoc); +} + +// This ensures we only execute the script targets after the entire script has +// been evaluated +setTimeout(function() { + var t; + + if (args.length === 1 && args[0] === '--help') { + console.log('Available targets:'); + for (t in global.target) + console.log(' ' + t); + return; + } + + // Wrap targets to prevent duplicate execution + for (t in global.target) { + (function(t, oldTarget){ + + // Wrap it + global.target[t] = function() { + if (oldTarget.done) + return; + oldTarget.done = true; + return oldTarget.apply(oldTarget, arguments); + }; + + })(t, global.target[t]); + } + + // Execute desired targets + if (args.length > 0) { + args.forEach(function(arg) { + if (arg in global.target) + global.target[arg](targetArgs); + else { + console.log('no such target: ' + arg); + } + }); + } else if ('all' in global.target) { + global.target.all(targetArgs); + } + +}, 0); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/package.json new file mode 100644 index 00000000..5aaead4c --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/package.json @@ -0,0 +1,64 @@ +{ + "name": "shelljs", + "version": "0.5.3", + "author": { + "name": "Artur Adib", + "email": "arturadib@gmail.com" + }, + "description": "Portable Unix shell commands for Node.js", + "keywords": [ + "unix", + "shell", + "makefile", + "make", + "jake", + "synchronous" + ], + "repository": { + "type": "git", + "url": "git://github.com/arturadib/shelljs.git" + }, + "license": "BSD*", + "homepage": "http://github.com/arturadib/shelljs", + "main": "./shell.js", + "scripts": { + "test": "node scripts/run-tests" + }, + "bin": { + "shjs": "./bin/shjs" + }, + "dependencies": {}, + "devDependencies": { + "jshint": "~2.1.11" + }, + "optionalDependencies": {}, + "engines": { + "node": ">=0.8.0" + }, + "gitHead": "22d0975040b9b8234755dc6e692d6869436e8485", + "bugs": { + "url": "https://github.com/arturadib/shelljs/issues" + }, + "_id": "shelljs@0.5.3", + "_shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", + "_from": "shelljs@*", + "_npmVersion": "2.5.1", + "_nodeVersion": "1.2.0", + "_npmUser": { + "name": "artur", + "email": "arturadib@gmail.com" + }, + "maintainers": [ + { + "name": "artur", + "email": "arturadib@gmail.com" + } + ], + "dist": { + "shasum": "c54982b996c76ef0c1e6b59fbdc5825f5b713113", + "tarball": "http://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/scripts/generate-docs.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/scripts/generate-docs.js new file mode 100755 index 00000000..532fed9f --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/scripts/generate-docs.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +require('../global'); + +echo('Appending docs to README.md'); + +cd(__dirname + '/..'); + +// Extract docs from shell.js +var docs = grep('//@', 'shell.js'); + +docs = docs.replace(/\/\/\@include (.+)/g, function(match, path) { + var file = path.match('.js$') ? path : path+'.js'; + return grep('//@', file); +}); + +// Remove '//@' +docs = docs.replace(/\/\/\@ ?/g, ''); +// Append docs to README +sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md'); + +echo('All done.'); diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/scripts/run-tests.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/scripts/run-tests.js new file mode 100755 index 00000000..f9d31e06 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/scripts/run-tests.js @@ -0,0 +1,50 @@ +#!/usr/bin/env node +require('../global'); + +var path = require('path'); + +var failed = false; + +// +// Lint +// +JSHINT_BIN = './node_modules/jshint/bin/jshint'; +cd(__dirname + '/..'); + +if (!test('-f', JSHINT_BIN)) { + echo('JSHint not found. Run `npm install` in the root dir first.'); + exit(1); +} + +if (exec(JSHINT_BIN + ' *.js test/*.js').code !== 0) { + failed = true; + echo('*** JSHINT FAILED! (return code != 0)'); + echo(); +} else { + echo('All JSHint tests passed'); + echo(); +} + +// +// Unit tests +// +cd(__dirname + '/../test'); +ls('*.js').forEach(function(file) { + echo('Running test:', file); + if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit) + failed = true; + echo('*** TEST FAILED! (missing exit code "123")'); + echo(); + } +}); + +if (failed) { + echo(); + echo('*******************************************************'); + echo('WARNING: Some tests did not pass!'); + echo('*******************************************************'); + exit(1); +} else { + echo(); + echo('All tests passed.'); +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/shell.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/shell.js new file mode 100644 index 00000000..bdeb5597 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/shell.js @@ -0,0 +1,159 @@ +// +// ShellJS +// Unix shell commands on top of Node's API +// +// Copyright (c) 2012 Artur Adib +// http://github.com/arturadib/shelljs +// + +var common = require('./src/common'); + + +//@ +//@ All commands run synchronously, unless otherwise stated. +//@ + +//@include ./src/cd +var _cd = require('./src/cd'); +exports.cd = common.wrap('cd', _cd); + +//@include ./src/pwd +var _pwd = require('./src/pwd'); +exports.pwd = common.wrap('pwd', _pwd); + +//@include ./src/ls +var _ls = require('./src/ls'); +exports.ls = common.wrap('ls', _ls); + +//@include ./src/find +var _find = require('./src/find'); +exports.find = common.wrap('find', _find); + +//@include ./src/cp +var _cp = require('./src/cp'); +exports.cp = common.wrap('cp', _cp); + +//@include ./src/rm +var _rm = require('./src/rm'); +exports.rm = common.wrap('rm', _rm); + +//@include ./src/mv +var _mv = require('./src/mv'); +exports.mv = common.wrap('mv', _mv); + +//@include ./src/mkdir +var _mkdir = require('./src/mkdir'); +exports.mkdir = common.wrap('mkdir', _mkdir); + +//@include ./src/test +var _test = require('./src/test'); +exports.test = common.wrap('test', _test); + +//@include ./src/cat +var _cat = require('./src/cat'); +exports.cat = common.wrap('cat', _cat); + +//@include ./src/to +var _to = require('./src/to'); +String.prototype.to = common.wrap('to', _to); + +//@include ./src/toEnd +var _toEnd = require('./src/toEnd'); +String.prototype.toEnd = common.wrap('toEnd', _toEnd); + +//@include ./src/sed +var _sed = require('./src/sed'); +exports.sed = common.wrap('sed', _sed); + +//@include ./src/grep +var _grep = require('./src/grep'); +exports.grep = common.wrap('grep', _grep); + +//@include ./src/which +var _which = require('./src/which'); +exports.which = common.wrap('which', _which); + +//@include ./src/echo +var _echo = require('./src/echo'); +exports.echo = _echo; // don't common.wrap() as it could parse '-options' + +//@include ./src/dirs +var _dirs = require('./src/dirs').dirs; +exports.dirs = common.wrap("dirs", _dirs); +var _pushd = require('./src/dirs').pushd; +exports.pushd = common.wrap('pushd', _pushd); +var _popd = require('./src/dirs').popd; +exports.popd = common.wrap("popd", _popd); + +//@include ./src/ln +var _ln = require('./src/ln'); +exports.ln = common.wrap('ln', _ln); + +//@ +//@ ### exit(code) +//@ Exits the current process with the given exit code. +exports.exit = process.exit; + +//@ +//@ ### env['VAR_NAME'] +//@ Object containing environment variables (both getter and setter). Shortcut to process.env. +exports.env = process.env; + +//@include ./src/exec +var _exec = require('./src/exec'); +exports.exec = common.wrap('exec', _exec, {notUnix:true}); + +//@include ./src/chmod +var _chmod = require('./src/chmod'); +exports.chmod = common.wrap('chmod', _chmod); + + + +//@ +//@ ## Non-Unix commands +//@ + +//@include ./src/tempdir +var _tempDir = require('./src/tempdir'); +exports.tempdir = common.wrap('tempdir', _tempDir); + + +//@include ./src/error +var _error = require('./src/error'); +exports.error = _error; + + + +//@ +//@ ## Configuration +//@ + +exports.config = common.config; + +//@ +//@ ### config.silent +//@ Example: +//@ +//@ ```javascript +//@ var sh = require('shelljs'); +//@ var silentState = sh.config.silent; // save old silent state +//@ sh.config.silent = true; +//@ /* ... */ +//@ sh.config.silent = silentState; // restore old silent state +//@ ``` +//@ +//@ Suppresses all command output if `true`, except for `echo()` calls. +//@ Default is `false`. + +//@ +//@ ### config.fatal +//@ Example: +//@ +//@ ```javascript +//@ require('shelljs/global'); +//@ config.fatal = true; +//@ cp('this_file_does_not_exist', '/dev/null'); // dies here +//@ /* more commands... */ +//@ ``` +//@ +//@ If `true` the script will die on errors. Default is `false`. diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/cat.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/cat.js new file mode 100644 index 00000000..f6f4d254 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/cat.js @@ -0,0 +1,43 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### cat(file [, file ...]) +//@ ### cat(file_array) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var str = cat('file*.txt'); +//@ var str = cat('file1', 'file2'); +//@ var str = cat(['file1', 'file2']); // same as above +//@ ``` +//@ +//@ Returns a string containing the given file, or a concatenated string +//@ containing the files if more than one file is given (a new line character is +//@ introduced between each file). Wildcard `*` accepted. +function _cat(options, files) { + var cat = ''; + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) + common.error('no such file or directory: ' + file); + + cat += fs.readFileSync(file, 'utf8') + '\n'; + }); + + if (cat[cat.length-1] === '\n') + cat = cat.substring(0, cat.length-1); + + return common.ShellString(cat); +} +module.exports = _cat; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/cd.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/cd.js new file mode 100644 index 00000000..230f4326 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/cd.js @@ -0,0 +1,19 @@ +var fs = require('fs'); +var common = require('./common'); + +//@ +//@ ### cd('dir') +//@ Changes to directory `dir` for the duration of the script +function _cd(options, dir) { + if (!dir) + common.error('directory not specified'); + + if (!fs.existsSync(dir)) + common.error('no such file or directory: ' + dir); + + if (!fs.statSync(dir).isDirectory()) + common.error('not a directory: ' + dir); + + process.chdir(dir); +} +module.exports = _cd; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/chmod.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/chmod.js new file mode 100644 index 00000000..f2888930 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/chmod.js @@ -0,0 +1,208 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +var PERMS = (function (base) { + return { + OTHER_EXEC : base.EXEC, + OTHER_WRITE : base.WRITE, + OTHER_READ : base.READ, + + GROUP_EXEC : base.EXEC << 3, + GROUP_WRITE : base.WRITE << 3, + GROUP_READ : base.READ << 3, + + OWNER_EXEC : base.EXEC << 6, + OWNER_WRITE : base.WRITE << 6, + OWNER_READ : base.READ << 6, + + // Literal octal numbers are apparently not allowed in "strict" javascript. Using parseInt is + // the preferred way, else a jshint warning is thrown. + STICKY : parseInt('01000', 8), + SETGID : parseInt('02000', 8), + SETUID : parseInt('04000', 8), + + TYPE_MASK : parseInt('0770000', 8) + }; +})({ + EXEC : 1, + WRITE : 2, + READ : 4 +}); + +//@ +//@ ### chmod(octal_mode || octal_string, file) +//@ ### chmod(symbolic_mode, file) +//@ +//@ Available options: +//@ +//@ + `-v`: output a diagnostic for every file processed//@ +//@ + `-c`: like verbose but report only when a change is made//@ +//@ + `-R`: change files and directories recursively//@ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ chmod(755, '/Users/brandon'); +//@ chmod('755', '/Users/brandon'); // same as above +//@ chmod('u+x', '/Users/brandon'); +//@ ``` +//@ +//@ Alters the permissions of a file or directory by either specifying the +//@ absolute permissions in octal form or expressing the changes in symbols. +//@ This command tries to mimic the POSIX behavior as much as possible. +//@ Notable exceptions: +//@ +//@ + In symbolic modes, 'a-r' and '-r' are identical. No consideration is +//@ given to the umask. +//@ + There is no "quiet" option since default behavior is to run silent. +function _chmod(options, mode, filePattern) { + if (!filePattern) { + if (options.length > 0 && options.charAt(0) === '-') { + // Special case where the specified file permissions started with - to subtract perms, which + // get picked up by the option parser as command flags. + // If we are down by one argument and options starts with -, shift everything over. + filePattern = mode; + mode = options; + options = ''; + } + else { + common.error('You must specify a file.'); + } + } + + options = common.parseOptions(options, { + 'R': 'recursive', + 'c': 'changes', + 'v': 'verbose' + }); + + if (typeof filePattern === 'string') { + filePattern = [ filePattern ]; + } + + var files; + + if (options.recursive) { + files = []; + common.expand(filePattern).forEach(function addFile(expandedFile) { + var stat = fs.lstatSync(expandedFile); + + if (!stat.isSymbolicLink()) { + files.push(expandedFile); + + if (stat.isDirectory()) { // intentionally does not follow symlinks. + fs.readdirSync(expandedFile).forEach(function (child) { + addFile(expandedFile + '/' + child); + }); + } + } + }); + } + else { + files = common.expand(filePattern); + } + + files.forEach(function innerChmod(file) { + file = path.resolve(file); + if (!fs.existsSync(file)) { + common.error('File not found: ' + file); + } + + // When recursing, don't follow symlinks. + if (options.recursive && fs.lstatSync(file).isSymbolicLink()) { + return; + } + + var perms = fs.statSync(file).mode; + var type = perms & PERMS.TYPE_MASK; + + var newPerms = perms; + + if (isNaN(parseInt(mode, 8))) { + // parse options + mode.split(',').forEach(function (symbolicMode) { + /*jshint regexdash:true */ + var pattern = /([ugoa]*)([=\+-])([rwxXst]*)/i; + var matches = pattern.exec(symbolicMode); + + if (matches) { + var applyTo = matches[1]; + var operator = matches[2]; + var change = matches[3]; + + var changeOwner = applyTo.indexOf('u') != -1 || applyTo === 'a' || applyTo === ''; + var changeGroup = applyTo.indexOf('g') != -1 || applyTo === 'a' || applyTo === ''; + var changeOther = applyTo.indexOf('o') != -1 || applyTo === 'a' || applyTo === ''; + + var changeRead = change.indexOf('r') != -1; + var changeWrite = change.indexOf('w') != -1; + var changeExec = change.indexOf('x') != -1; + var changeSticky = change.indexOf('t') != -1; + var changeSetuid = change.indexOf('s') != -1; + + var mask = 0; + if (changeOwner) { + mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0); + } + if (changeGroup) { + mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0); + } + if (changeOther) { + mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0); + } + + // Sticky bit is special - it's not tied to user, group or other. + if (changeSticky) { + mask |= PERMS.STICKY; + } + + switch (operator) { + case '+': + newPerms |= mask; + break; + + case '-': + newPerms &= ~mask; + break; + + case '=': + newPerms = type + mask; + + // According to POSIX, when using = to explicitly set the permissions, setuid and setgid can never be cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + break; + } + + if (options.verbose) { + log(file + ' -> ' + newPerms.toString(8)); + } + + if (perms != newPerms) { + if (!options.verbose && options.changes) { + log(file + ' -> ' + newPerms.toString(8)); + } + fs.chmodSync(file, newPerms); + } + } + else { + common.error('Invalid symbolic mode change: ' + symbolicMode); + } + }); + } + else { + // they gave us a full number + newPerms = type + parseInt(mode, 8); + + // POSIX rules are that setuid and setgid can only be added using numeric form, but not cleared. + if (fs.statSync(file).isDirectory()) { + newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms; + } + + fs.chmodSync(file, newPerms); + } + }); +} +module.exports = _chmod; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/common.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/common.js new file mode 100644 index 00000000..d8c23129 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/common.js @@ -0,0 +1,203 @@ +var os = require('os'); +var fs = require('fs'); +var _ls = require('./ls'); + +// Module globals +var config = { + silent: false, + fatal: false +}; +exports.config = config; + +var state = { + error: null, + currentCmd: 'shell.js', + tempDir: null +}; +exports.state = state; + +var platform = os.type().match(/^Win/) ? 'win' : 'unix'; +exports.platform = platform; + +function log() { + if (!config.silent) + console.log.apply(this, arguments); +} +exports.log = log; + +// Shows error message. Throws unless _continue or config.fatal are true +function error(msg, _continue) { + if (state.error === null) + state.error = ''; + state.error += state.currentCmd + ': ' + msg + '\n'; + + if (msg.length > 0) + log(state.error); + + if (config.fatal) + process.exit(1); + + if (!_continue) + throw ''; +} +exports.error = error; + +// In the future, when Proxies are default, we can add methods like `.to()` to primitive strings. +// For now, this is a dummy function to bookmark places we need such strings +function ShellString(str) { + return str; +} +exports.ShellString = ShellString; + +// Returns {'alice': true, 'bob': false} when passed a dictionary, e.g.: +// parseOptions('-a', {'a':'alice', 'b':'bob'}); +function parseOptions(str, map) { + if (!map) + error('parseOptions() internal error: no map given'); + + // All options are false by default + var options = {}; + for (var letter in map) + options[map[letter]] = false; + + if (!str) + return options; // defaults + + if (typeof str !== 'string') + error('parseOptions() internal error: wrong str'); + + // e.g. match[1] = 'Rf' for str = '-Rf' + var match = str.match(/^\-(.+)/); + if (!match) + return options; + + // e.g. chars = ['R', 'f'] + var chars = match[1].split(''); + + chars.forEach(function(c) { + if (c in map) + options[map[c]] = true; + else + error('option not recognized: '+c); + }); + + return options; +} +exports.parseOptions = parseOptions; + +// Expands wildcards with matching (ie. existing) file names. +// For example: +// expand(['file*.js']) = ['file1.js', 'file2.js', ...] +// (if the files 'file1.js', 'file2.js', etc, exist in the current dir) +function expand(list) { + var expanded = []; + list.forEach(function(listEl) { + // Wildcard present on directory names ? + if(listEl.search(/\*[^\/]*\//) > -1 || listEl.search(/\*\*[^\/]*\//) > -1) { + var match = listEl.match(/^([^*]+\/|)(.*)/); + var root = match[1]; + var rest = match[2]; + var restRegex = rest.replace(/\*\*/g, ".*").replace(/\*/g, "[^\\/]*"); + restRegex = new RegExp(restRegex); + + _ls('-R', root).filter(function (e) { + return restRegex.test(e); + }).forEach(function(file) { + expanded.push(file); + }); + } + // Wildcard present on file names ? + else if (listEl.search(/\*/) > -1) { + _ls('', listEl).forEach(function(file) { + expanded.push(file); + }); + } else { + expanded.push(listEl); + } + }); + return expanded; +} +exports.expand = expand; + +// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e. +// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006 +function unlinkSync(file) { + try { + fs.unlinkSync(file); + } catch(e) { + // Try to override file permission + if (e.code === 'EPERM') { + fs.chmodSync(file, '0666'); + fs.unlinkSync(file); + } else { + throw e; + } + } +} +exports.unlinkSync = unlinkSync; + +// e.g. 'shelljs_a5f185d0443ca...' +function randomFileName() { + function randomHash(count) { + if (count === 1) + return parseInt(16*Math.random(), 10).toString(16); + else { + var hash = ''; + for (var i=0; i and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && !options.force) + common.error('dest file already exists: ' + dest); + + if (options.recursive) { + // Recursive allows the shortcut syntax "sourcedir/" for "sourcedir/*" + // (see Github issue #15) + sources.forEach(function(src, i) { + if (src[src.length - 1] === '/') + sources[i] += '*'; + }); + + // Create dest + try { + fs.mkdirSync(dest, parseInt('0777', 8)); + } catch (e) { + // like Unix's cp, keep going even if we can't create dest dir + } + } + + sources = common.expand(sources); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + if (fs.statSync(src).isDirectory()) { + if (!options.recursive) { + // Non-Recursive + common.log(src + ' is a directory (not copied)'); + } else { + // Recursive + // 'cp /a/source dest' should create 'source' in 'dest' + var newDest = path.join(dest, path.basename(src)), + checkDir = fs.statSync(src); + try { + fs.mkdirSync(newDest, checkDir.mode); + } catch (e) { + //if the directory already exists, that's okay + if (e.code !== 'EEXIST') { + common.error('dest file no such file or directory: ' + newDest, true); + throw e; + } + } + + cpdirSyncRecursive(src, newDest, {force: options.force}); + } + return; // done with dir + } + + // If here, src is a file + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && !options.force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + copyFileSync(src, thisDest); + }); // forEach(src) +} +module.exports = _cp; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/dirs.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/dirs.js new file mode 100644 index 00000000..58fae8b3 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/dirs.js @@ -0,0 +1,191 @@ +var common = require('./common'); +var _cd = require('./cd'); +var path = require('path'); + +// Pushd/popd/dirs internals +var _dirStack = []; + +function _isStackIndex(index) { + return (/^[\-+]\d+$/).test(index); +} + +function _parseStackIndex(index) { + if (_isStackIndex(index)) { + if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd + return (/^-/).test(index) ? Number(index) - 1 : Number(index); + } else { + common.error(index + ': directory stack index out of range'); + } + } else { + common.error(index + ': invalid number'); + } +} + +function _actualDirStack() { + return [process.cwd()].concat(_dirStack); +} + +//@ +//@ ### pushd([options,] [dir | '-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`. +//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ // process.cwd() === '/usr' +//@ pushd('/etc'); // Returns /etc /usr +//@ pushd('+1'); // Returns /usr /etc +//@ ``` +//@ +//@ Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack. +function _pushd(options, dir) { + if (_isStackIndex(options)) { + dir = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + var dirs = _actualDirStack(); + + if (dir === '+0') { + return dirs; // +0 is a noop + } else if (!dir) { + if (dirs.length > 1) { + dirs = dirs.splice(1, 1).concat(dirs); + } else { + return common.error('no other directory'); + } + } else if (_isStackIndex(dir)) { + var n = _parseStackIndex(dir); + dirs = dirs.slice(n).concat(dirs.slice(0, n)); + } else { + if (options['no-cd']) { + dirs.splice(1, 0, dir); + } else { + dirs.unshift(dir); + } + } + + if (options['no-cd']) { + dirs = dirs.slice(1); + } else { + dir = path.resolve(dirs.shift()); + _cd('', dir); + } + + _dirStack = dirs; + return _dirs(''); +} +exports.pushd = _pushd; + +//@ +//@ ### popd([options,] ['-N' | '+N']) +//@ +//@ Available options: +//@ +//@ + `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated. +//@ +//@ Arguments: +//@ +//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero. +//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo(process.cwd()); // '/usr' +//@ pushd('/etc'); // '/etc /usr' +//@ echo(process.cwd()); // '/etc' +//@ popd(); // '/usr' +//@ echo(process.cwd()); // '/usr' +//@ ``` +//@ +//@ When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack. +function _popd(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'n' : 'no-cd' + }); + + if (!_dirStack.length) { + return common.error('directory stack empty'); + } + + index = _parseStackIndex(index || '+0'); + + if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) { + index = index > 0 ? index - 1 : index; + _dirStack.splice(index, 1); + } else { + var dir = path.resolve(_dirStack.shift()); + _cd('', dir); + } + + return _dirs(''); +} +exports.popd = _popd; + +//@ +//@ ### dirs([options | '+N' | '-N']) +//@ +//@ Available options: +//@ +//@ + `-c`: Clears the directory stack by deleting all of the elements. +//@ +//@ Arguments: +//@ +//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero. +//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero. +//@ +//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified. +//@ +//@ See also: pushd, popd +function _dirs(options, index) { + if (_isStackIndex(options)) { + index = options; + options = ''; + } + + options = common.parseOptions(options, { + 'c' : 'clear' + }); + + if (options['clear']) { + _dirStack = []; + return _dirStack; + } + + var stack = _actualDirStack(); + + if (index) { + index = _parseStackIndex(index); + + if (index < 0) { + index = stack.length + index; + } + + common.log(stack[index]); + return stack[index]; + } + + common.log(stack.join(' ')); + + return stack; +} +exports.dirs = _dirs; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/echo.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/echo.js new file mode 100644 index 00000000..760ea840 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/echo.js @@ -0,0 +1,20 @@ +var common = require('./common'); + +//@ +//@ ### echo(string [,string ...]) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ echo('hello world'); +//@ var str = echo('hello world'); +//@ ``` +//@ +//@ Prints string to stdout, and returns string with additional utility methods +//@ like `.to()`. +function _echo() { + var messages = [].slice.call(arguments, 0); + console.log.apply(this, messages); + return common.ShellString(messages.join(' ')); +} +module.exports = _echo; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/error.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/error.js new file mode 100644 index 00000000..cca3efb6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/error.js @@ -0,0 +1,10 @@ +var common = require('./common'); + +//@ +//@ ### error() +//@ Tests if error occurred in the last command. Returns `null` if no error occurred, +//@ otherwise returns string explaining the error +function error() { + return common.state.error; +}; +module.exports = error; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/exec.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/exec.js new file mode 100644 index 00000000..d259a9f2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/exec.js @@ -0,0 +1,216 @@ +var common = require('./common'); +var _tempDir = require('./tempdir'); +var _pwd = require('./pwd'); +var path = require('path'); +var fs = require('fs'); +var child = require('child_process'); + +// Hack to run child_process.exec() synchronously (sync avoids callback hell) +// Uses a custom wait loop that checks for a flag file, created when the child process is done. +// (Can't do a wait loop that checks for internal Node variables/messages as +// Node is single-threaded; callbacks and other internal state changes are done in the +// event loop). +function execSync(cmd, opts) { + var tempDir = _tempDir(); + var stdoutFile = path.resolve(tempDir+'/'+common.randomFileName()), + codeFile = path.resolve(tempDir+'/'+common.randomFileName()), + scriptFile = path.resolve(tempDir+'/'+common.randomFileName()), + sleepFile = path.resolve(tempDir+'/'+common.randomFileName()); + + var options = common.extend({ + silent: common.config.silent + }, opts); + + var previousStdoutContent = ''; + // Echoes stdout changes from running process, if not silent + function updateStdout() { + if (options.silent || !fs.existsSync(stdoutFile)) + return; + + var stdoutContent = fs.readFileSync(stdoutFile, 'utf8'); + // No changes since last time? + if (stdoutContent.length <= previousStdoutContent.length) + return; + + process.stdout.write(stdoutContent.substr(previousStdoutContent.length)); + previousStdoutContent = stdoutContent; + } + + function escape(str) { + return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); + } + + if (fs.existsSync(scriptFile)) common.unlinkSync(scriptFile); + if (fs.existsSync(stdoutFile)) common.unlinkSync(stdoutFile); + if (fs.existsSync(codeFile)) common.unlinkSync(codeFile); + + var execCommand = '"'+process.execPath+'" '+scriptFile; + var execOptions = { + env: process.env, + cwd: _pwd(), + maxBuffer: 20*1024*1024 + }; + + if (typeof child.execSync === 'function') { + var script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});", + "var stdoutStream = fs.createWriteStream('"+escape(stdoutFile)+"');", + "childProcess.stdout.pipe(stdoutStream, {end: false});", + "childProcess.stderr.pipe(stdoutStream, {end: false});", + "childProcess.stdout.pipe(process.stdout);", + "childProcess.stderr.pipe(process.stderr);", + "var stdoutEnded = false, stderrEnded = false;", + "function tryClosing(){ if(stdoutEnded && stderrEnded){ stdoutStream.end(); } }", + "childProcess.stdout.on('end', function(){ stdoutEnded = true; tryClosing(); });", + "childProcess.stderr.on('end', function(){ stderrEnded = true; tryClosing(); });" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + if (options.silent) { + execOptions.stdio = 'ignore'; + } else { + execOptions.stdio = [0, 1, 2]; + } + + // Welcome to the future + child.execSync(execCommand, execOptions); + } else { + cmd += ' > '+stdoutFile+' 2>&1'; // works on both win/unix + + var script = [ + "var child = require('child_process')", + " , fs = require('fs');", + "var childProcess = child.exec('"+escape(cmd)+"', {env: process.env, maxBuffer: 20*1024*1024}, function(err) {", + " fs.writeFileSync('"+escape(codeFile)+"', err ? err.code.toString() : '0');", + "});" + ].join('\n'); + + fs.writeFileSync(scriptFile, script); + + child.exec(execCommand, execOptions); + + // The wait loop + // sleepFile is used as a dummy I/O op to mitigate unnecessary CPU usage + // (tried many I/O sync ops, writeFileSync() seems to be only one that is effective in reducing + // CPU usage, though apparently not so much on Windows) + while (!fs.existsSync(codeFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } + while (!fs.existsSync(stdoutFile)) { updateStdout(); fs.writeFileSync(sleepFile, 'a'); } + } + + // At this point codeFile exists, but it's not necessarily flushed yet. + // Keep reading it until it is. + var code = parseInt('', 10); + while (isNaN(code)) { + code = parseInt(fs.readFileSync(codeFile, 'utf8'), 10); + } + + var stdout = fs.readFileSync(stdoutFile, 'utf8'); + + // No biggie if we can't erase the files now -- they're in a temp dir anyway + try { common.unlinkSync(scriptFile); } catch(e) {} + try { common.unlinkSync(stdoutFile); } catch(e) {} + try { common.unlinkSync(codeFile); } catch(e) {} + try { common.unlinkSync(sleepFile); } catch(e) {} + + // some shell return codes are defined as errors, per http://tldp.org/LDP/abs/html/exitcodes.html + if (code === 1 || code === 2 || code >= 126) { + common.error('', true); // unix/shell doesn't really give an error message after non-zero exit codes + } + // True if successful, false if not + var obj = { + code: code, + output: stdout + }; + return obj; +} // execSync() + +// Wrapper around exec() to enable echoing output to console in real time +function execAsync(cmd, opts, callback) { + var output = ''; + + var options = common.extend({ + silent: common.config.silent + }, opts); + + var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) { + if (callback) + callback(err ? err.code : 0, output); + }); + + c.stdout.on('data', function(data) { + output += data; + if (!options.silent) + process.stdout.write(data); + }); + + c.stderr.on('data', function(data) { + output += data; + if (!options.silent) + process.stdout.write(data); + }); + + return c; +} + +//@ +//@ ### exec(command [, options] [, callback]) +//@ Available options (all `false` by default): +//@ +//@ + `async`: Asynchronous execution. Defaults to true if a callback is provided. +//@ + `silent`: Do not echo program output to console. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var version = exec('node --version', {silent:true}).output; +//@ +//@ var child = exec('some_long_running_process', {async:true}); +//@ child.stdout.on('data', function(data) { +//@ /* ... do something with data ... */ +//@ }); +//@ +//@ exec('some_long_running_process', function(code, output) { +//@ console.log('Exit code:', code); +//@ console.log('Program output:', output); +//@ }); +//@ ``` +//@ +//@ Executes the given `command` _synchronously_, unless otherwise specified. +//@ When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's +//@ `output` (stdout + stderr) and its exit `code`. Otherwise returns the child process object, and +//@ the `callback` gets the arguments `(code, output)`. +//@ +//@ **Note:** For long-lived processes, it's best to run `exec()` asynchronously as +//@ the current synchronous implementation uses a lot of CPU. This should be getting +//@ fixed soon. +function _exec(command, options, callback) { + if (!command) + common.error('must specify command'); + + // Callback is defined instead of options. + if (typeof options === 'function') { + callback = options; + options = { async: true }; + } + + // Callback is defined with options. + if (typeof options === 'object' && typeof callback === 'function') { + options.async = true; + } + + options = common.extend({ + silent: common.config.silent, + async: false + }, options); + + if (options.async) + return execAsync(command, options, callback); + else + return execSync(command, options); +} +module.exports = _exec; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/find.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/find.js new file mode 100644 index 00000000..d9eeec26 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/find.js @@ -0,0 +1,51 @@ +var fs = require('fs'); +var common = require('./common'); +var _ls = require('./ls'); + +//@ +//@ ### find(path [,path ...]) +//@ ### find(path_array) +//@ Examples: +//@ +//@ ```javascript +//@ find('src', 'lib'); +//@ find(['src', 'lib']); // same as above +//@ find('.').filter(function(file) { return file.match(/\.js$/); }); +//@ ``` +//@ +//@ Returns array of all files (however deep) in the given paths. +//@ +//@ The main difference from `ls('-R', path)` is that the resulting file names +//@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. +function _find(options, paths) { + if (!paths) + common.error('no path specified'); + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + function pushFile(file) { + if (common.platform === 'win') + file = file.replace(/\\/g, '/'); + list.push(file); + } + + // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs + // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory + + paths.forEach(function(file) { + pushFile(file); + + if (fs.statSync(file).isDirectory()) { + _ls('-RA', file+'/*').forEach(function(subfile) { + pushFile(subfile); + }); + } + }); + + return list; +} +module.exports = _find; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/grep.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/grep.js new file mode 100644 index 00000000..00c7d6a4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/grep.js @@ -0,0 +1,52 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### grep([options ,] regex_filter, file [, file ...]) +//@ ### grep([options ,] regex_filter, file_array) +//@ Available options: +//@ +//@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. +//@ +//@ Examples: +//@ +//@ ```javascript +//@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); +//@ grep('GLOBAL_VARIABLE', '*.js'); +//@ ``` +//@ +//@ Reads input string from given files and returns a string containing all lines of the +//@ file that match the given `regex_filter`. Wildcard `*` accepted. +function _grep(options, regex, files) { + options = common.parseOptions(options, { + 'v': 'inverse' + }); + + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 2); + // if it's array leave it as it is + + files = common.expand(files); + + var grep = ''; + files.forEach(function(file) { + if (!fs.existsSync(file)) { + common.error('no such file or directory: ' + file, true); + return; + } + + var contents = fs.readFileSync(file, 'utf8'), + lines = contents.split(/\r*\n/); + lines.forEach(function(line) { + var matched = line.match(regex); + if ((options.inverse && !matched) || (!options.inverse && matched)) + grep += line + '\n'; + }); + }); + + return common.ShellString(grep); +} +module.exports = _grep; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/ln.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/ln.js new file mode 100644 index 00000000..a7b9701b --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/ln.js @@ -0,0 +1,53 @@ +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); +var os = require('os'); + +//@ +//@ ### ln(options, source, dest) +//@ ### ln(source, dest) +//@ Available options: +//@ +//@ + `s`: symlink +//@ + `f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ln('file', 'newlink'); +//@ ln('-sf', 'file', 'existing'); +//@ ``` +//@ +//@ Links source to dest. Use -f to force the link, should dest already exist. +function _ln(options, source, dest) { + options = common.parseOptions(options, { + 's': 'symlink', + 'f': 'force' + }); + + if (!source || !dest) { + common.error('Missing and/or '); + } + + source = path.resolve(process.cwd(), String(source)); + dest = path.resolve(process.cwd(), String(dest)); + + if (!fs.existsSync(source)) { + common.error('Source file does not exist', true); + } + + if (fs.existsSync(dest)) { + if (!options.force) { + common.error('Destination file exists', true); + } + + fs.unlinkSync(dest); + } + + if (options.symlink) { + fs.symlinkSync(source, dest, os.platform() === "win32" ? "junction" : null); + } else { + fs.linkSync(source, dest, os.platform() === "win32" ? "junction" : null); + } +} +module.exports = _ln; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/ls.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/ls.js new file mode 100644 index 00000000..3345db44 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/ls.js @@ -0,0 +1,126 @@ +var path = require('path'); +var fs = require('fs'); +var common = require('./common'); +var _cd = require('./cd'); +var _pwd = require('./pwd'); + +//@ +//@ ### ls([options ,] path [,path ...]) +//@ ### ls([options ,] path_array) +//@ Available options: +//@ +//@ + `-R`: recursive +//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ ls('projs/*.js'); +//@ ls('-R', '/users/me', '/tmp'); +//@ ls('-R', ['/users/me', '/tmp']); // same as above +//@ ``` +//@ +//@ Returns array of files in the given path, or in current directory if no path provided. +function _ls(options, paths) { + options = common.parseOptions(options, { + 'R': 'recursive', + 'A': 'all', + 'a': 'all_deprecated' + }); + + if (options.all_deprecated) { + // We won't support the -a option as it's hard to image why it's useful + // (it includes '.' and '..' in addition to '.*' files) + // For backwards compatibility we'll dump a deprecated message and proceed as before + common.log('ls: Option -a is deprecated. Use -A instead'); + options.all = true; + } + + if (!paths) + paths = ['.']; + else if (typeof paths === 'object') + paths = paths; // assume array + else if (typeof paths === 'string') + paths = [].slice.call(arguments, 1); + + var list = []; + + // Conditionally pushes file to list - returns true if pushed, false otherwise + // (e.g. prevents hidden files to be included unless explicitly told so) + function pushFile(file, query) { + // hidden file? + if (path.basename(file)[0] === '.') { + // not explicitly asking for hidden files? + if (!options.all && !(path.basename(query)[0] === '.' && path.basename(query).length > 1)) + return false; + } + + if (common.platform === 'win') + file = file.replace(/\\/g, '/'); + + list.push(file); + return true; + } + + paths.forEach(function(p) { + if (fs.existsSync(p)) { + var stats = fs.statSync(p); + // Simple file? + if (stats.isFile()) { + pushFile(p, p); + return; // continue + } + + // Simple dir? + if (stats.isDirectory()) { + // Iterate over p contents + fs.readdirSync(p).forEach(function(file) { + if (!pushFile(file, p)) + return; + + // Recursive? + if (options.recursive) { + var oldDir = _pwd(); + _cd('', p); + if (fs.statSync(file).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), file+'/*')); + _cd('', oldDir); + } + }); + return; // continue + } + } + + // p does not exist - possible wildcard present + + var basename = path.basename(p); + var dirname = path.dirname(p); + // Wildcard present on an existing dir? (e.g. '/tmp/*.js') + if (basename.search(/\*/) > -1 && fs.existsSync(dirname) && fs.statSync(dirname).isDirectory) { + // Escape special regular expression chars + var regexp = basename.replace(/(\^|\$|\(|\)|<|>|\[|\]|\{|\}|\.|\+|\?)/g, '\\$1'); + // Translates wildcard into regex + regexp = '^' + regexp.replace(/\*/g, '.*') + '$'; + // Iterate over directory contents + fs.readdirSync(dirname).forEach(function(file) { + if (file.match(new RegExp(regexp))) { + if (!pushFile(path.normalize(dirname+'/'+file), basename)) + return; + + // Recursive? + if (options.recursive) { + var pp = dirname + '/' + file; + if (fs.lstatSync(pp).isDirectory()) + list = list.concat(_ls('-R'+(options.all?'A':''), pp+'/*')); + } // recursive + } // if file matches + }); // forEach + return; + } + + common.error('no such file or directory: ' + p, true); + }); + + return list; +} +module.exports = _ls; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/mkdir.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/mkdir.js new file mode 100644 index 00000000..5a7088f2 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/mkdir.js @@ -0,0 +1,68 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Recursively creates 'dir' +function mkdirSyncRecursive(dir) { + var baseDir = path.dirname(dir); + + // Base dir exists, no recursion necessary + if (fs.existsSync(baseDir)) { + fs.mkdirSync(dir, parseInt('0777', 8)); + return; + } + + // Base dir does not exist, go recursive + mkdirSyncRecursive(baseDir); + + // Base dir created, can create dir + fs.mkdirSync(dir, parseInt('0777', 8)); +} + +//@ +//@ ### mkdir([options ,] dir [, dir ...]) +//@ ### mkdir([options ,] dir_array) +//@ Available options: +//@ +//@ + `p`: full path (will create intermediate dirs if necessary) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g'); +//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above +//@ ``` +//@ +//@ Creates directories. +function _mkdir(options, dirs) { + options = common.parseOptions(options, { + 'p': 'fullpath' + }); + if (!dirs) + common.error('no paths given'); + + if (typeof dirs === 'string') + dirs = [].slice.call(arguments, 1); + // if it's array leave it as it is + + dirs.forEach(function(dir) { + if (fs.existsSync(dir)) { + if (!options.fullpath) + common.error('path already exists: ' + dir, true); + return; // skip dir + } + + // Base dir does not exist, and no -p option given + var baseDir = path.dirname(dir); + if (!fs.existsSync(baseDir) && !options.fullpath) { + common.error('no such file or directory: ' + baseDir, true); + return; // skip dir + } + + if (options.fullpath) + mkdirSyncRecursive(dir); + else + fs.mkdirSync(dir, parseInt('0777', 8)); + }); +} // mkdir +module.exports = _mkdir; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/mv.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/mv.js new file mode 100644 index 00000000..11f96071 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/mv.js @@ -0,0 +1,80 @@ +var fs = require('fs'); +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### mv(source [, source ...], dest') +//@ ### mv(source_array, dest') +//@ Available options: +//@ +//@ + `f`: force +//@ +//@ Examples: +//@ +//@ ```javascript +//@ mv('-f', 'file', 'dir/'); +//@ mv('file1', 'file2', 'dir/'); +//@ mv(['file1', 'file2'], 'dir/'); // same as above +//@ ``` +//@ +//@ Moves files. The wildcard `*` is accepted. +function _mv(options, sources, dest) { + options = common.parseOptions(options, { + 'f': 'force' + }); + + // Get sources, dest + if (arguments.length < 3) { + common.error('missing and/or '); + } else if (arguments.length > 3) { + sources = [].slice.call(arguments, 1, arguments.length - 1); + dest = arguments[arguments.length - 1]; + } else if (typeof sources === 'string') { + sources = [sources]; + } else if ('length' in sources) { + sources = sources; // no-op for array + } else { + common.error('invalid arguments'); + } + + sources = common.expand(sources); + + var exists = fs.existsSync(dest), + stats = exists && fs.statSync(dest); + + // Dest is not existing dir, but multiple sources given + if ((!exists || !stats.isDirectory()) && sources.length > 1) + common.error('dest is not a directory (too many sources)'); + + // Dest is an existing file, but no -f given + if (exists && stats.isFile() && !options.force) + common.error('dest file already exists: ' + dest); + + sources.forEach(function(src) { + if (!fs.existsSync(src)) { + common.error('no such file or directory: '+src, true); + return; // skip file + } + + // If here, src exists + + // When copying to '/path/dir': + // thisDest = '/path/dir/file1' + var thisDest = dest; + if (fs.existsSync(dest) && fs.statSync(dest).isDirectory()) + thisDest = path.normalize(dest + '/' + path.basename(src)); + + if (fs.existsSync(thisDest) && !options.force) { + common.error('dest file already exists: ' + thisDest, true); + return; // skip file + } + + if (path.resolve(src) === path.dirname(path.resolve(thisDest))) { + common.error('cannot move to self: '+src, true); + return; // skip file + } + + fs.renameSync(src, thisDest); + }); // forEach(src) +} // mv +module.exports = _mv; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/popd.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/popd.js new file mode 100644 index 00000000..11ea24fa --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/popd.js @@ -0,0 +1 @@ +// see dirs.js \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/pushd.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/pushd.js new file mode 100644 index 00000000..11ea24fa --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/pushd.js @@ -0,0 +1 @@ +// see dirs.js \ No newline at end of file diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/pwd.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/pwd.js new file mode 100644 index 00000000..41727bb9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/pwd.js @@ -0,0 +1,11 @@ +var path = require('path'); +var common = require('./common'); + +//@ +//@ ### pwd() +//@ Returns the current directory. +function _pwd(options) { + var pwd = path.resolve(process.cwd()); + return common.ShellString(pwd); +} +module.exports = _pwd; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/rm.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/rm.js new file mode 100644 index 00000000..bd608cb0 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/rm.js @@ -0,0 +1,163 @@ +var common = require('./common'); +var fs = require('fs'); + +// Recursively removes 'dir' +// Adapted from https://github.com/ryanmcgrath/wrench-js +// +// Copyright (c) 2010 Ryan McGrath +// Copyright (c) 2012 Artur Adib +// +// Licensed under the MIT License +// http://www.opensource.org/licenses/mit-license.php +function rmdirSyncRecursive(dir, force) { + var files; + + files = fs.readdirSync(dir); + + // Loop through and delete everything in the sub-tree after checking it + for(var i = 0; i < files.length; i++) { + var file = dir + "/" + files[i], + currFile = fs.lstatSync(file); + + if(currFile.isDirectory()) { // Recursive function back to the beginning + rmdirSyncRecursive(file, force); + } + + else if(currFile.isSymbolicLink()) { // Unlink symlinks + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + else // Assume it's a file - perhaps a try/catch belongs here? + if (force || isWriteable(file)) { + try { + common.unlinkSync(file); + } catch (e) { + common.error('could not remove file (code '+e.code+'): ' + file, true); + } + } + } + + // Now that we know everything in the sub-tree has been deleted, we can delete the main directory. + // Huzzah for the shopkeep. + + var result; + try { + // Retry on windows, sometimes it takes a little time before all the files in the directory are gone + var start = Date.now(); + while (true) { + try { + result = fs.rmdirSync(dir); + if (fs.existsSync(dir)) throw { code: "EAGAIN" } + break; + } catch(er) { + // In addition to error codes, also check if the directory still exists and loop again if true + if (process.platform === "win32" && (er.code === "ENOTEMPTY" || er.code === "EBUSY" || er.code === "EPERM" || er.code === "EAGAIN")) { + if (Date.now() - start > 1000) throw er; + } else if (er.code === "ENOENT") { + // Directory did not exist, deletion was successful + break; + } else { + throw er; + } + } + } + } catch(e) { + common.error('could not remove directory (code '+e.code+'): ' + dir, true); + } + + return result; +} // rmdirSyncRecursive + +// Hack to determine if file has write permissions for current user +// Avoids having to check user, group, etc, but it's probably slow +function isWriteable(file) { + var writePermission = true; + try { + var __fd = fs.openSync(file, 'a'); + fs.closeSync(__fd); + } catch(e) { + writePermission = false; + } + + return writePermission; +} + +//@ +//@ ### rm([options ,] file [, file ...]) +//@ ### rm([options ,] file_array) +//@ Available options: +//@ +//@ + `-f`: force +//@ + `-r, -R`: recursive +//@ +//@ Examples: +//@ +//@ ```javascript +//@ rm('-rf', '/tmp/*'); +//@ rm('some_file.txt', 'another_file.txt'); +//@ rm(['some_file.txt', 'another_file.txt']); // same as above +//@ ``` +//@ +//@ Removes files. The wildcard `*` is accepted. +function _rm(options, files) { + options = common.parseOptions(options, { + 'f': 'force', + 'r': 'recursive', + 'R': 'recursive' + }); + if (!files) + common.error('no paths given'); + + if (typeof files === 'string') + files = [].slice.call(arguments, 1); + // if it's array leave it as it is + + files = common.expand(files); + + files.forEach(function(file) { + if (!fs.existsSync(file)) { + // Path does not exist, no force flag given + if (!options.force) + common.error('no such file or directory: '+file, true); + + return; // skip file + } + + // If here, path exists + + var stats = fs.lstatSync(file); + if (stats.isFile() || stats.isSymbolicLink()) { + + // Do not check for file writing permissions + if (options.force) { + common.unlinkSync(file); + return; + } + + if (isWriteable(file)) + common.unlinkSync(file); + else + common.error('permission denied: '+file, true); + + return; + } // simple file + + // Path is an existing directory, but no -r flag given + if (stats.isDirectory() && !options.recursive) { + common.error('path is a directory', true); + return; // skip path + } + + // Recursively remove existing directory + if (stats.isDirectory() && options.recursive) { + rmdirSyncRecursive(file, options.force); + } + }); // forEach(file) +} // rm +module.exports = _rm; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/sed.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/sed.js new file mode 100644 index 00000000..65f7cb49 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/sed.js @@ -0,0 +1,43 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### sed([options ,] search_regex, replacement, file) +//@ Available options: +//@ +//@ + `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_ +//@ +//@ Examples: +//@ +//@ ```javascript +//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js'); +//@ sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js'); +//@ ``` +//@ +//@ Reads an input string from `file` and performs a JavaScript `replace()` on the input +//@ using the given search regex and replacement string or function. Returns the new string after replacement. +function _sed(options, regex, replacement, file) { + options = common.parseOptions(options, { + 'i': 'inplace' + }); + + if (typeof replacement === 'string' || typeof replacement === 'function') + replacement = replacement; // no-op + else if (typeof replacement === 'number') + replacement = replacement.toString(); // fallback + else + common.error('invalid replacement string'); + + if (!file) + common.error('no file given'); + + if (!fs.existsSync(file)) + common.error('no such file or directory: ' + file); + + var result = fs.readFileSync(file, 'utf8').replace(regex, replacement); + if (options.inplace) + fs.writeFileSync(file, result, 'utf8'); + + return common.ShellString(result); +} +module.exports = _sed; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/tempdir.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/tempdir.js new file mode 100644 index 00000000..45953c24 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/tempdir.js @@ -0,0 +1,56 @@ +var common = require('./common'); +var os = require('os'); +var fs = require('fs'); + +// Returns false if 'dir' is not a writeable directory, 'dir' otherwise +function writeableDir(dir) { + if (!dir || !fs.existsSync(dir)) + return false; + + if (!fs.statSync(dir).isDirectory()) + return false; + + var testFile = dir+'/'+common.randomFileName(); + try { + fs.writeFileSync(testFile, ' '); + common.unlinkSync(testFile); + return dir; + } catch (e) { + return false; + } +} + + +//@ +//@ ### tempdir() +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var tmp = tempdir(); // "/tmp" for most *nix platforms +//@ ``` +//@ +//@ Searches and returns string containing a writeable, platform-dependent temporary directory. +//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir). +function _tempDir() { + var state = common.state; + if (state.tempDir) + return state.tempDir; // from cache + + state.tempDir = writeableDir(os.tempDir && os.tempDir()) || // node 0.8+ + writeableDir(process.env['TMPDIR']) || + writeableDir(process.env['TEMP']) || + writeableDir(process.env['TMP']) || + writeableDir(process.env['Wimp$ScrapDir']) || // RiscOS + writeableDir('C:\\TEMP') || // Windows + writeableDir('C:\\TMP') || // Windows + writeableDir('\\TEMP') || // Windows + writeableDir('\\TMP') || // Windows + writeableDir('/tmp') || + writeableDir('/var/tmp') || + writeableDir('/usr/tmp') || + writeableDir('.'); // last resort + + return state.tempDir; +} +module.exports = _tempDir; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/test.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/test.js new file mode 100644 index 00000000..8a4ac7d4 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/test.js @@ -0,0 +1,85 @@ +var common = require('./common'); +var fs = require('fs'); + +//@ +//@ ### test(expression) +//@ Available expression primaries: +//@ +//@ + `'-b', 'path'`: true if path is a block device +//@ + `'-c', 'path'`: true if path is a character device +//@ + `'-d', 'path'`: true if path is a directory +//@ + `'-e', 'path'`: true if path exists +//@ + `'-f', 'path'`: true if path is a regular file +//@ + `'-L', 'path'`: true if path is a symboilc link +//@ + `'-p', 'path'`: true if path is a pipe (FIFO) +//@ + `'-S', 'path'`: true if path is a socket +//@ +//@ Examples: +//@ +//@ ```javascript +//@ if (test('-d', path)) { /* do something with dir */ }; +//@ if (!test('-f', path)) continue; // skip if it's a regular file +//@ ``` +//@ +//@ Evaluates expression using the available primaries and returns corresponding value. +function _test(options, path) { + if (!path) + common.error('no path given'); + + // hack - only works with unary primaries + options = common.parseOptions(options, { + 'b': 'block', + 'c': 'character', + 'd': 'directory', + 'e': 'exists', + 'f': 'file', + 'L': 'link', + 'p': 'pipe', + 'S': 'socket' + }); + + var canInterpret = false; + for (var key in options) + if (options[key] === true) { + canInterpret = true; + break; + } + + if (!canInterpret) + common.error('could not interpret expression'); + + if (options.link) { + try { + return fs.lstatSync(path).isSymbolicLink(); + } catch(e) { + return false; + } + } + + if (!fs.existsSync(path)) + return false; + + if (options.exists) + return true; + + var stats = fs.statSync(path); + + if (options.block) + return stats.isBlockDevice(); + + if (options.character) + return stats.isCharacterDevice(); + + if (options.directory) + return stats.isDirectory(); + + if (options.file) + return stats.isFile(); + + if (options.pipe) + return stats.isFIFO(); + + if (options.socket) + return stats.isSocket(); +} // test +module.exports = _test; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/to.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/to.js new file mode 100644 index 00000000..f0299993 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/to.js @@ -0,0 +1,29 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.to(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').to('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_ +function _to(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.writeFileSync(file, this.toString(), 'utf8'); + } catch(e) { + common.error('could not write to file (code '+e.code+'): '+file, true); + } +} +module.exports = _to; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/toEnd.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/toEnd.js new file mode 100644 index 00000000..f6d099d9 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/toEnd.js @@ -0,0 +1,29 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +//@ +//@ ### 'string'.toEnd(file) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ cat('input.txt').toEnd('output.txt'); +//@ ``` +//@ +//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with JavaScript strings (such as +//@ those returned by `cat`, `grep`, etc). +function _toEnd(options, file) { + if (!file) + common.error('wrong arguments'); + + if (!fs.existsSync( path.dirname(file) )) + common.error('no such file or directory: ' + path.dirname(file)); + + try { + fs.appendFileSync(file, this.toString(), 'utf8'); + } catch(e) { + common.error('could not append to file (code '+e.code+'): '+file, true); + } +} +module.exports = _toEnd; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/which.js b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/which.js new file mode 100644 index 00000000..2822ecfb --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/node_modules/shelljs/src/which.js @@ -0,0 +1,83 @@ +var common = require('./common'); +var fs = require('fs'); +var path = require('path'); + +// Cross-platform method for splitting environment PATH variables +function splitPath(p) { + for (i=1;i<2;i++) {} + + if (!p) + return []; + + if (common.platform === 'win') + return p.split(';'); + else + return p.split(':'); +} + +function checkPath(path) { + return fs.existsSync(path) && fs.statSync(path).isDirectory() == false; +} + +//@ +//@ ### which(command) +//@ +//@ Examples: +//@ +//@ ```javascript +//@ var nodeExec = which('node'); +//@ ``` +//@ +//@ Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions. +//@ Returns string containing the absolute path to the command. +function _which(options, cmd) { + if (!cmd) + common.error('must specify command'); + + var pathEnv = process.env.path || process.env.Path || process.env.PATH, + pathArray = splitPath(pathEnv), + where = null; + + // No relative/absolute paths provided? + if (cmd.search(/\//) === -1) { + // Search for command in PATH + pathArray.forEach(function(dir) { + if (where) + return; // already found it + + var attempt = path.resolve(dir + '/' + cmd); + if (checkPath(attempt)) { + where = attempt; + return; + } + + if (common.platform === 'win') { + var baseAttempt = attempt; + attempt = baseAttempt + '.exe'; + if (checkPath(attempt)) { + where = attempt; + return; + } + attempt = baseAttempt + '.cmd'; + if (checkPath(attempt)) { + where = attempt; + return; + } + attempt = baseAttempt + '.bat'; + if (checkPath(attempt)) { + where = attempt; + return; + } + } // if 'win' + }); + } + + // Command not found anywhere? + if (!checkPath(cmd) && !where) + return null; + + where = where || path.resolve(cmd); + + return common.ShellString(where); +} +module.exports = _which; diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/npm-shrinkwrap.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/npm-shrinkwrap.json new file mode 100644 index 00000000..90b7d2f7 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/npm-shrinkwrap.json @@ -0,0 +1,559 @@ +{ + "name": "vscode-instant-markdown", + "version": "0.0.1", + "dependencies": { + "bluebird": { + "version": "3.0.6", + "from": "bluebird@*", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.0.6.tgz" + }, + "instant-markdown-d": { + "version": "0.1.0", + "from": "instant-markdown-d@0.1.0", + "resolved": "https://registry.npmjs.org/instant-markdown-d/-/instant-markdown-d-0.1.0.tgz", + "dependencies": { + "highlight.js": { + "version": "8.9.1", + "from": "highlight.js@>=8.4.0 <9.0.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-8.9.1.tgz" + }, + "markdown-it": { + "version": "3.1.0", + "from": "markdown-it@>=3.0.3 <4.0.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-3.1.0.tgz", + "dependencies": { + "argparse": { + "version": "1.0.3", + "from": "argparse@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.3.tgz", + "dependencies": { + "lodash": { + "version": "3.10.1", + "from": "lodash@>=3.2.0 <4.0.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz" + }, + "sprintf-js": { + "version": "1.0.3", + "from": "sprintf-js@>=1.0.2 <1.1.0", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" + } + } + }, + "linkify-it": { + "version": "0.1.5", + "from": "linkify-it@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-0.1.5.tgz", + "dependencies": { + "uc.micro": { + "version": "1.0.0", + "from": "uc.micro@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.0.tgz" + } + } + }, + "mdurl": { + "version": "1.0.1", + "from": "mdurl@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz" + }, + "uc.micro": { + "version": "0.1.0", + "from": "uc.micro@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-0.1.0.tgz" + } + } + }, + "send": { + "version": "0.1.4", + "from": "send@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.1.4.tgz", + "dependencies": { + "debug": { + "version": "2.2.0", + "from": "debug@*", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "dependencies": { + "ms": { + "version": "0.7.1", + "from": "ms@0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + } + } + }, + "mime": { + "version": "1.2.11", + "from": "mime@>=1.2.9 <1.3.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.11.tgz" + }, + "fresh": { + "version": "0.2.0", + "from": "fresh@0.2.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.2.0.tgz" + }, + "range-parser": { + "version": "0.0.4", + "from": "range-parser@0.0.4", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz" + } + } + }, + "socket.io": { + "version": "0.9.17", + "from": "socket.io@>=0.9.0 <0.10.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-0.9.17.tgz", + "dependencies": { + "socket.io-client": { + "version": "0.9.16", + "from": "socket.io-client@0.9.16", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.16.tgz", + "dependencies": { + "uglify-js": { + "version": "1.2.5", + "from": "uglify-js@1.2.5", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-1.2.5.tgz" + }, + "ws": { + "version": "0.4.32", + "from": "ws@>=0.4.0 <0.5.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-0.4.32.tgz", + "dependencies": { + "commander": { + "version": "2.1.0", + "from": "commander@>=2.1.0 <2.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz" + }, + "nan": { + "version": "1.0.0", + "from": "nan@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-1.0.0.tgz" + }, + "tinycolor": { + "version": "0.0.1", + "from": "tinycolor@>=0.0.0 <1.0.0", + "resolved": "https://registry.npmjs.org/tinycolor/-/tinycolor-0.0.1.tgz" + }, + "options": { + "version": "0.0.6", + "from": "options@>=0.0.5", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz" + } + } + }, + "xmlhttprequest": { + "version": "1.4.2", + "from": "xmlhttprequest@1.4.2", + "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.4.2.tgz" + }, + "active-x-obfuscator": { + "version": "0.0.1", + "from": "active-x-obfuscator@0.0.1", + "resolved": "https://registry.npmjs.org/active-x-obfuscator/-/active-x-obfuscator-0.0.1.tgz", + "dependencies": { + "zeparser": { + "version": "0.0.5", + "from": "zeparser@0.0.5", + "resolved": "https://registry.npmjs.org/zeparser/-/zeparser-0.0.5.tgz" + } + } + } + } + }, + "policyfile": { + "version": "0.0.4", + "from": "policyfile@0.0.4", + "resolved": "https://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz" + }, + "base64id": { + "version": "0.1.0", + "from": "base64id@0.1.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz" + }, + "redis": { + "version": "0.7.3", + "from": "redis@0.7.3", + "resolved": "https://registry.npmjs.org/redis/-/redis-0.7.3.tgz" + } + } + } + } + }, + "request": { + "version": "2.67.0", + "from": "request@>=2.67.0 <3.0.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.67.0.tgz", + "dependencies": { + "bl": { + "version": "1.0.0", + "from": "bl@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-1.0.0.tgz", + "dependencies": { + "readable-stream": { + "version": "2.0.4", + "from": "readable-stream@>=2.0.0 <2.1.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz", + "dependencies": { + "core-util-is": { + "version": "1.0.2", + "from": "core-util-is@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + }, + "inherits": { + "version": "2.0.1", + "from": "inherits@>=2.0.1 <2.1.0", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + }, + "isarray": { + "version": "0.0.1", + "from": "isarray@0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "process-nextick-args": { + "version": "1.0.3", + "from": "process-nextick-args@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" + }, + "string_decoder": { + "version": "0.10.31", + "from": "string_decoder@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, + "util-deprecate": { + "version": "1.0.2", + "from": "util-deprecate@>=1.0.1 <1.1.0", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + } + } + } + } + }, + "caseless": { + "version": "0.11.0", + "from": "caseless@>=0.11.0 <0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, + "extend": { + "version": "3.0.0", + "from": "extend@>=3.0.0 <3.1.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + }, + "forever-agent": { + "version": "0.6.1", + "from": "forever-agent@>=0.6.1 <0.7.0", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, + "form-data": { + "version": "1.0.0-rc3", + "from": "form-data@>=1.0.0-rc3 <1.1.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz", + "dependencies": { + "async": { + "version": "1.5.0", + "from": "async@>=1.4.0 <2.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.0.tgz" + } + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "from": "json-stringify-safe@>=5.0.1 <5.1.0", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "mime-types": { + "version": "2.1.8", + "from": "mime-types@>=2.1.7 <2.2.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.8.tgz", + "dependencies": { + "mime-db": { + "version": "1.20.0", + "from": "mime-db@>=1.20.0 <1.21.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.20.0.tgz" + } + } + }, + "node-uuid": { + "version": "1.4.7", + "from": "node-uuid@>=1.4.7 <1.5.0", + "resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" + }, + "qs": { + "version": "5.2.0", + "from": "qs@>=5.2.0 <5.3.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz" + }, + "tunnel-agent": { + "version": "0.4.1", + "from": "tunnel-agent@>=0.4.1 <0.5.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.1.tgz" + }, + "tough-cookie": { + "version": "2.2.1", + "from": "tough-cookie@>=2.2.0 <2.3.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz" + }, + "http-signature": { + "version": "1.1.0", + "from": "http-signature@>=1.1.0 <1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.0.tgz", + "dependencies": { + "assert-plus": { + "version": "0.1.5", + "from": "assert-plus@>=0.1.5 <0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz" + }, + "jsprim": { + "version": "1.2.2", + "from": "jsprim@>=1.2.2 <2.0.0", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz", + "dependencies": { + "extsprintf": { + "version": "1.0.2", + "from": "extsprintf@1.0.2", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + }, + "json-schema": { + "version": "0.2.2", + "from": "json-schema@0.2.2", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz" + }, + "verror": { + "version": "1.3.6", + "from": "verror@1.3.6", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + } + } + }, + "sshpk": { + "version": "1.7.1", + "from": "sshpk@>=1.7.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.1.tgz", + "dependencies": { + "asn1": { + "version": "0.2.3", + "from": "asn1@>=0.2.3 <0.3.0", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" + }, + "assert-plus": { + "version": "0.2.0", + "from": "assert-plus@>=0.2.0 <0.3.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + }, + "dashdash": { + "version": "1.10.1", + "from": "dashdash@>=1.10.1 <2.0.0", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.10.1.tgz", + "dependencies": { + "assert-plus": { + "version": "0.1.5", + "from": "assert-plus@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz" + } + } + }, + "jsbn": { + "version": "0.1.0", + "from": "jsbn@>=0.1.0 <0.2.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + }, + "tweetnacl": { + "version": "0.13.2", + "from": "tweetnacl@>=0.13.0 <1.0.0", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.2.tgz" + }, + "jodid25519": { + "version": "1.0.2", + "from": "jodid25519@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz" + }, + "ecc-jsbn": { + "version": "0.1.1", + "from": "ecc-jsbn@>=0.0.1 <1.0.0", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz" + } + } + } + } + }, + "oauth-sign": { + "version": "0.8.0", + "from": "oauth-sign@>=0.8.0 <0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz" + }, + "hawk": { + "version": "3.1.2", + "from": "hawk@>=3.1.0 <3.2.0", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.2.tgz", + "dependencies": { + "hoek": { + "version": "2.16.3", + "from": "hoek@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, + "boom": { + "version": "2.10.1", + "from": "boom@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + }, + "cryptiles": { + "version": "2.0.5", + "from": "cryptiles@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + }, + "sntp": { + "version": "1.0.9", + "from": "sntp@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" + } + } + }, + "aws-sign2": { + "version": "0.6.0", + "from": "aws-sign2@>=0.6.0 <0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, + "stringstream": { + "version": "0.0.5", + "from": "stringstream@>=0.0.4 <0.1.0", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + }, + "combined-stream": { + "version": "1.0.5", + "from": "combined-stream@>=1.0.5 <1.1.0", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "dependencies": { + "delayed-stream": { + "version": "1.0.0", + "from": "delayed-stream@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + } + } + }, + "isstream": { + "version": "0.1.2", + "from": "isstream@>=0.1.2 <0.2.0", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" + }, + "is-typedarray": { + "version": "1.0.0", + "from": "is-typedarray@>=1.0.0 <1.1.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + }, + "har-validator": { + "version": "2.0.3", + "from": "har-validator@>=2.0.2 <2.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.3.tgz", + "dependencies": { + "chalk": { + "version": "1.1.1", + "from": "chalk@>=1.1.1 <2.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz", + "dependencies": { + "ansi-styles": { + "version": "2.1.0", + "from": "ansi-styles@>=2.1.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" + }, + "escape-string-regexp": { + "version": "1.0.3", + "from": "escape-string-regexp@>=1.0.2 <2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" + }, + "has-ansi": { + "version": "2.0.0", + "from": "has-ansi@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "dependencies": { + "ansi-regex": { + "version": "2.0.0", + "from": "ansi-regex@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } + } + }, + "strip-ansi": { + "version": "3.0.0", + "from": "strip-ansi@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", + "dependencies": { + "ansi-regex": { + "version": "2.0.0", + "from": "ansi-regex@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" + } + } + }, + "supports-color": { + "version": "2.0.0", + "from": "supports-color@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + } + } + }, + "commander": { + "version": "2.9.0", + "from": "commander@>=2.9.0 <3.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "dependencies": { + "graceful-readlink": { + "version": "1.0.1", + "from": "graceful-readlink@>=1.0.0", + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + } + } + }, + "is-my-json-valid": { + "version": "2.12.3", + "from": "is-my-json-valid@>=2.12.3 <3.0.0", + "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.3.tgz", + "dependencies": { + "generate-function": { + "version": "2.0.0", + "from": "generate-function@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" + }, + "generate-object-property": { + "version": "1.2.0", + "from": "generate-object-property@>=1.1.0 <2.0.0", + "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "dependencies": { + "is-property": { + "version": "1.0.2", + "from": "is-property@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" + } + } + }, + "jsonpointer": { + "version": "2.0.0", + "from": "jsonpointer@2.0.0", + "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" + }, + "xtend": { + "version": "4.0.1", + "from": "xtend@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + } + } + }, + "pinkie-promise": { + "version": "2.0.0", + "from": "pinkie-promise@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz", + "dependencies": { + "pinkie": { + "version": "2.0.1", + "from": "pinkie@>=2.0.0 <3.0.0", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.1.tgz" + } + } + } + } + } + } + }, + "shelljs": { + "version": "0.5.3", + "from": "shelljs@*", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.5.3.tgz" + } + } +} diff --git a/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/package.json b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/package.json new file mode 100644 index 00000000..20e5eef6 --- /dev/null +++ b/.vscode/extensions/dbankier.vscode-instant-markdown-0.1.0/package.json @@ -0,0 +1,36 @@ +{ + "name": "vscode-instant-markdown", + "displayName": "Instant Markdown", + "description": "Instant previews of your markdown files as you type.", + "version": "0.1.0", + "publisher": "dbankier", + "homepage": "https://github.com/dbankier/vscode-instant-markdown/blob/master/README.md", + "repository": { + "type": "git", + "url": "https://github.com/ziyasal/vscode-instant-markdown.git" + }, + "engines": { + "vscode": "^0.10.1" + }, + "categories": [ + "Other" + ], + "activationEvents": [ + "onLanguage:markdown" + ], + "main": "./extension", + "devDependencies": { + "vscode": "0.10.x" + }, + "dependencies": { + "bluebird": "^3.0.6", + "instant-markdown-d": "0.1.0", + "request": "^2.67.0", + "shelljs": "^0.5.3" + }, + "__metadata": { + "id": "b7495032-d1d3-4be2-a2a1-695559fcd3d6", + "publisherId": "261c2fe7-dbea-4dbf-bff3-6da4a886e8d2", + "publisherDisplayName": "David Bankier" + } +} \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/.travis.yml b/.vscode/extensions/vscodevim.vim-0.1.10/.travis.yml deleted file mode 100644 index abb54a77..00000000 --- a/.vscode/extensions/vscodevim.vim-0.1.10/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -notifications: - email: false - -sudo: false - -os: - - osx - - linux - -addons: - apt: - packages: - - xclip - -language: node_js - -node_js: - - "6.3.1" - -env: - - GITHUB_TOKEN=1b17d62d38a4846efa7ea4de4b773b581787b0f1 - -before_install: - - if [ $TRAVIS_OS_NAME == "linux" ]; then - export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; - sh -e /etc/init.d/xvfb start; - sleep 3; - fi - -install: - - npm install - - npm run vscode:prepublish - -script: - - npm install -g gulp - - gulp - - npm test --silent diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/gulpfile.js b/.vscode/extensions/vscodevim.vim-0.1.10/gulpfile.js deleted file mode 100644 index 7353a0f7..00000000 --- a/.vscode/extensions/vscodevim.vim-0.1.10/gulpfile.js +++ /dev/null @@ -1,80 +0,0 @@ -var gulp = require('gulp'), - tslint = require('gulp-tslint'), - typings = require('gulp-typings'), - shell = require('gulp-shell'), - soften = require('gulp-soften'), - git = require('gulp-git'), - bump = require('gulp-bump'), - filter = require('gulp-filter'), - tag_version = require('gulp-tag-version'), - inject = require('gulp-inject-string'), - trimlines = require('gulp-trimlines'), - merge = require('merge-stream'); - -var paths = { - src_ts: "src/**/*.ts", - tests_ts: "test/**/*.ts" -}; - -function versionBump(importance) { - return gulp.src(['./package.json']) - .pipe(bump({type: importance})) - .pipe(gulp.dest('./')) - .pipe(git.commit('bump package version')) - .pipe(filter('package.json')) - .pipe(tag_version()); -} - -gulp.task('patch', function() { return versionBump('patch'); }) -gulp.task('minor', function() { return versionBump('minor'); }) -gulp.task('major', function() { return versionBump('major'); }) - -gulp.task('typings', function () { - return gulp.src('./typings.json') - .pipe(typings()); -}); - -gulp.task('typings-vscode-definitions', ['typings'], function() { - // add vscode definitions - var vscodeTypings = '/// \n'; - var vscodeNodeTypings = '/// \n'; - return gulp.src('./typings/index.d.ts') - .pipe(inject.replace(vscodeTypings, '')) - .pipe(inject.replace(vscodeNodeTypings, '')) - .pipe(inject.prepend(vscodeTypings)) - .pipe(inject.prepend(vscodeNodeTypings)) - .pipe(gulp.dest('./typings')); -}) - -gulp.task('fix-whitespace', function() { - // 1. change tabs to spaces - // 2. trim trailing whitespace - return gulp.src([paths.src_ts, paths.tests_ts], { base: "./" }) - .pipe(soften(2)) - .pipe(trimlines({ - leading: false - })) - .pipe(gulp.dest('./')); -}); - -gulp.task('tslint', ['fix-whitespace'], function() { - var tslintOptions = { - summarizeFailureOutput: true - }; - - var srcs = gulp.src(paths.src_ts) - .pipe(tslint()) - .pipe(tslint.report('prose', tslintOptions)); - var tests = gulp.src(paths.tests_ts) - .pipe(tslint({ - configuration: 'test/tslint.json' - })) - .pipe(tslint.report('prose', tslintOptions)); - return merge(srcs, tests); -}); - -gulp.task('compile', shell.task(['npm run vscode:prepublish'])); -gulp.task('watch', shell.task(['npm run compile'])); -gulp.task('init', ['typings']); -gulp.task('default', ['tslint', 'compile']); -gulp.task('release', ['default', 'patch']); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/.github/CONTRIBUTING.md b/.vscode/extensions/vscodevim.vim-0.2.0/.github/CONTRIBUTING.md similarity index 87% rename from .vscode/extensions/vscodevim.vim-0.1.10/.github/CONTRIBUTING.md rename to .vscode/extensions/vscodevim.vim-0.2.0/.github/CONTRIBUTING.md index 54a64d9d..dc8d6ee1 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/.github/CONTRIBUTING.md +++ b/.vscode/extensions/vscodevim.vim-0.2.0/.github/CONTRIBUTING.md @@ -2,7 +2,7 @@ The following is a set of guidelines for contributing to Vim for VSCode. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request. -If you need help with Vim for VSCode, come visit our [Slack](https://vscodevim-slackin.azurewebsites.net/) community. +If you need help with Vim for VSCode, come visit our [Slack](https://vscodevim-slackin.azurewebsites.net/) community. Thanks for helping us make Vim for VSCode better! ## Submitting Issues @@ -15,8 +15,8 @@ When creating a new bug report do: ## Submitting Pull Requests -Pull requests are *awesome*. -If you're looking to raise a PR for something which doesn't have an open issue, consider creating an issue first. +Pull requests are *awesome*. +If you're looking to raise a PR for something which doesn't have an open issue, consider creating an issue first. When submitting a PR, ensure: 1. Run all the tests and ensure they pass. @@ -42,8 +42,8 @@ When submitting a PR, ensure: ## Developing 1. Watch for changes and recompile Typescript files. Run this in the `Vim` directory: `gulp watch` -2. Open up Visual Studio code and add the `Vim` directory as a folder. -3. Click on the debugger. You now have two options - Launch Extension (to play around with the extension) and Launch Tests (to run the tests). +2. Open up Visual Studio code and add the `Vim` directory as a folder. +3. Click on the debugger. You now have two options - Launch Extension (to play around with the extension) and Launch Tests (to run the tests). ## Code Architecture @@ -54,9 +54,9 @@ The code is split into two parts - ModeHandler (which is essentially the Vim sta Actions are all currently stuffied into actions.ts (sorry!). There are: * BaseAction - the base Action type that all Actions derive from. * BaseMovement - A movement, like `w`, `h`, `{`, etc. ONLY updates the cursor position. At worst, might return an IMovement, which indicates a start and stop. This is used for movements like aw which may actually start before the cursor. -* BaseCommand - Anything which is not just a movement is a Command. That includes motions which also update the state of Vim in some way, like `*`. +* BaseCommand - Anything which is not just a movement is a Command. That includes motions which also update the state of Vim in some way, like `*`. -At one point, I wanted to have actions.ts be completely pure (no side effects whatsoever), so commands would just return objects indicating what side effects on the editor they would have. This explains the giant switch in handleCommand in ModeHandler. I now believe this to be a dumb idea and someone should get rid of it. +At one point, I wanted to have actions.ts be completely pure (no side effects whatsoever), so commands would just return objects indicating what side effects on the editor they would have. This explains the giant switch in handleCommand in ModeHandler. I now believe this to be a dumb idea and someone should get rid of it. Probably me. :wink: @@ -66,25 +66,34 @@ It's contained entirely within modeHandler.ts. It's actually pretty complicated, It consists of two data structures: -* VimState - this is the state of Vim. It's what actions update. +* VimState - this is the state of Vim. It's what actions update. * RecordedState - this is temporary state that will reset at the end of a change. (RecordedState is a poor name for this; I've been going back and forth on different names). #### How it works -1. `handleKeyEventHelper` is called with the most recent keypress. +1. `handleKeyEventHelper` is called with the most recent keypress. 2. `Actions.getRelevantAction` determines if all the keys pressed so far uniquely specify any action in actions.ts. If not, we continue waiting for keypresses. -3. `runAction` runs the action that was matched. Movements, Commands and Operators all have separate functions that dictate how to run them - `executeMovement`, `handleCommand`, and `executeOperator` respectively. +3. `runAction` runs the action that was matched. Movements, Commands and Operators all have separate functions that dictate how to run them - `executeMovement`, `handleCommand`, and `executeOperator` respectively. 4. Now that we've updated VimState, we run `updateView` with the new VimState to "redraw" VSCode to the new state. #### vscode.window.onDidChangeTextEditorSelection This is my hack to simulate a click event based API in an IDE that doesn't have them (yet?). I check the selection that just came in to see if it's the same as what I thought I previously set the selection to the last time the state machine updated. If it's not, the user *probably* clicked. (But she also could have tab completed!) -## Troubleshooting +## Release + +To push a release: + +1. Bump the version number and create a git tag: `gulp patch|minor|major` +2. Push the changes: `git push origin --tags` + +In addition to building and testing the extension, when a tag is applied to the commit, the CI server will also create a GitHub release and publish the new version to the Visual Studio marketplace. + +## Troubleshooting ### Visual Studio Code Slowdown -If your autocomplete, your fuzzy file search, or your _everything_ is suddenly running slower, try to recall if you ever ran `npm test` instead of just running tests through Visual Studio Code. This will add a massive folder called `.vscode-test/` to your project, which Visual Studio Code will happily consume all of your CPU cycles indexing. +If your autocomplete, your fuzzy file search, or your _everything_ is suddenly running slower, try to recall if you ever ran `npm test` instead of just running tests through Visual Studio Code. This will add a massive folder called `.vscode-test/` to your project, which Visual Studio Code will happily consume all of your CPU cycles indexing. Long story short, you can speed up VSC by doing this: diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/.github/ISSUE_TEMPLATE.md b/.vscode/extensions/vscodevim.vim-0.2.0/.github/ISSUE_TEMPLATE.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/.github/ISSUE_TEMPLATE.md rename to .vscode/extensions/vscodevim.vim-0.2.0/.github/ISSUE_TEMPLATE.md diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/.github/PULL_REQUEST_TEMPLATE.md b/.vscode/extensions/vscodevim.vim-0.2.0/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/.github/PULL_REQUEST_TEMPLATE.md rename to .vscode/extensions/vscodevim.vim-0.2.0/.github/PULL_REQUEST_TEMPLATE.md diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/.travis.yml b/.vscode/extensions/vscodevim.vim-0.2.0/.travis.yml new file mode 100644 index 00000000..388d4e26 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/.travis.yml @@ -0,0 +1,59 @@ +notifications: + email: false + +sudo: false + +os: +- osx +- linux + +addons: + apt: + packages: + - xclip + +language: node_js + +node_js: +- 6.3.1 + +env: + global: + secure: "LME+kQWa4fRxHgrSBe4rQw+bqXK3P5GRVXQU5RCE1fF8Qj6U98YJBwtXxi83c6RgBfUjxDOOwFwKUH02T+1GTZCdJ3xQPGgfLMBmRqTb8R2dpNlh21nQmHt/3HAUZbC8D6CzbI/WbSTneyH2vWfVzTtwwOTvooekyyG/ZE7ZXGhXlkrCkU4eLnCsZuoIFH8bw6vGx8EB/iv5MaB7qQnUtBHm+lwGC5fEVD5zjuSLYlNo50z422djt7+sRwHG0Oxh4AJoADrCRRoM6r+O3L8SbhWDEue7D509JrNaJSKeKfGMTZWQC9VLUqnk3275+Px/jNx4J/TYayTK+B/dAuodbtznlPXYty879oJBokxkb3hhPTwlHwc+R0NXJAcfzOMFS2II2HzH0u4/tWXrWBrDbh5HKkJ80+/UDbGc7zek7A4qjYzVKsiLir6oxsbh1CUrwZF+6paCRDUAY0+mKqkLb7eaehKLoa0UjrO9xmvmW2giElyfkwRN+/dnNBGLooNGXprOpwH5B4krcsiqvQV3DdDLwFQz/Cq1GSvGvuM4zDll1c0dwsFCFYYYnXROmKhaOPdM6LKgTCGHk2DIYsNckYR71lMB7HzO2gf5AHREm2ViHpP6j1d7BDBOb878nBcuwoQged1LcvFtgAfCdcmdaa6ZvFM0ylZF/ywWmTAHOCo=" + +before_install: +- if [ $TRAVIS_OS_NAME == "linux" ]; then + export CXX="g++-4.9" CC="gcc-4.9" DISPLAY=:99.0; + sh -e /etc/init.d/xvfb start; sleep 3; + fi + +install: +- npm install; + +script: +- npm install -g gulp; +- gulp; +- npm test --silent; + +after_success: +- npm install -g vsce; +- vsce package; + +deploy: +- provider: releases + api_key: + secure: YQLI+5JqIZj4XNrVO6EUrahICsfQVZ64wWmu8mMOj2rOaEid3dIL1Q69YbzQWIbcLt3y4oBGeefrakWdr/k/xgrnrkoEj3XnzgIp2E+e7rJvwnH4tM6tV191iq4wXdTo6vf0Ha/Bo6LpibP/LgPOXOY64/qZ0HtS1zqAxQLz+9b1O2knGnAQnaE0sqf0xQwZBl5kd/ChRV/+IIJJb5p3Pok9idbTW54O9BRb2ue720cvOR3afyIau2njVB8INgvNU9b2cYqg6RLAUOj2RaenuaH7GLI2dIYj9a8wgJyxliNTMGNFRhz+KmXie3tUZDuRytqxIq2SD7FHl744+F4L2YQyMiMMs4bF0jLkeDVwHExQsrdXlQ1pW2GLR7YQQpcr202jBkq+CNC7DBNyQlXwe/21M5kxYMTEJMqTMdPDfPgmhshf6VWqTSDczLDxue72m+gWxwv6kseFSQxwvRXly8hW0ev2rddMt9nu73hAZ+Lkmu16qArQ8HxAQUrBASaDYa0RAqJ3bNj6RwKFsa9/HK27XRrUY5GViMSQSeaEv3EO9Nc0ibMbFFL8EEBB9wXDS75jmlAioQcl1B1rzcKbSW37wSOJH1WUJCpM0+xdQVo8Gngld0LAyugOikir+mcnnEkGCeo2ZdeMEy63iqhCKwz2au4+XbEttBgfhd/una4= + file_glob: true + file: "*.vsix" + skip_cleanup: true + on: + repo: VSCodeVim/Vim + tags: true + condition: $TRAVIS_OS_NAME = linux +- provider: script + script: vsce publish -p $VS_TOKEN + skip_cleanup: true + on: + repo: VSCodeVim/Vim + tags: true + condition: $TRAVIS_OS_NAME = linux \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/.vsixmanifest b/.vscode/extensions/vscodevim.vim-0.2.0/.vsixmanifest similarity index 78% rename from .vscode/extensions/vscodevim.vim-0.1.10/.vsixmanifest rename to .vscode/extensions/vscodevim.vim-0.2.0/.vsixmanifest index 46a9f0bd..ef5d94d2 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/.vsixmanifest +++ b/.vscode/extensions/vscodevim.vim-0.2.0/.vsixmanifest @@ -1,25 +1,28 @@ - + Vim Vim emulation for Visual Studio Code - vim,vi,vscodevim,vsc-vim,keybindings + vim,vi,vscodevim,keybindings Other Public + + - + + extension/LICENSE.txt extension/images/icon.png diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/LICENSE.txt b/.vscode/extensions/vscodevim.vim-0.2.0/LICENSE.txt similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/LICENSE.txt rename to .vscode/extensions/vscodevim.vim-0.2.0/LICENSE.txt diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/README.md b/.vscode/extensions/vscodevim.vim-0.2.0/README.md similarity index 95% rename from .vscode/extensions/vscodevim.vim-0.1.10/README.md rename to .vscode/extensions/vscodevim.vim-0.2.0/README.md index 0e8de20c..219ce900 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/README.md +++ b/.vscode/extensions/vscodevim.vim-0.2.0/README.md @@ -1,3 +1,4 @@ +[![Version](http://vsmarketplacebadge.apphb.com/version/vscodevim.vim.svg)](http://aka.ms/vscodevim) [![Build Status](https://travis-ci.org/VSCodeVim/Vim.svg?branch=master)](https://travis-ci.org/VSCodeVim/Vim) [![Slack Status](https://vscodevim-slackin.azurewebsites.net/badge.svg)](https://vscodevim-slackin.azurewebsites.net) # Vim @@ -46,7 +47,7 @@ Due to overlap between VSCode and VIm, options are loaded slightly different fro Vim options can be added to your user or workspace settings (open Command Pallete and search for "User Settings" or "Workspace Settings"). Changes require restarting of VSCode to take effect. -The following is a subset of the supported configurations; the full list is described in [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json#L155): +The following is a subset of the supported configurations; the full list is described in [package.json](https://github.com/VSCodeVim/Vim/blob/master/package.json#L175): * insertModeKeyBindings/otherModesKeyBindings * Keybinding overrides to use for insert and other (non-insert) modes @@ -124,7 +125,8 @@ The following is a subset of the supported configurations; the full list is desc On OS X, open Terminal and run the following command: ``` -defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false +defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false // For VSCode +defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false // For VSCode Insider ``` ## Contributing diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/ROADMAP.md b/.vscode/extensions/vscodevim.vim-0.2.0/ROADMAP.md similarity index 50% rename from .vscode/extensions/vscodevim.vim-0.1.10/ROADMAP.md rename to .vscode/extensions/vscodevim.vim-0.2.0/ROADMAP.md index e71fd385..f538a148 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/ROADMAP.md +++ b/.vscode/extensions/vscodevim.vim-0.2.0/ROADMAP.md @@ -2,7 +2,11 @@ :white_check_mark: - command done -:warning: - command partially implemented +:white_check_mark: :star: - command done with VS Code specific customization + +:warning: - some variations of the command are not supported + +:running: work in progress :arrow_down: - command is low priority; open an issue (or thumbs up the relevant issue) if you want to see it sooner @@ -107,41 +111,41 @@ Status | Command | Description ## Pattern searches -Status | Command | Description ----|--------|------------------------------ -:warning: | :1234: `/{pattern}[/[offset]]` | search forward for the Nth occurrence of {pattern} -:warning: | :1234: `?{pattern}[?[offset]]` | search backward for the Nth occurrence of {pattern} - | :1234: `/` | repeat last search, in the forward direction - | :1234: `?` | repeat last search, in the backward direction -:warning: | :1234: n | repeat last search -:warning: | :1234: N | repeat last search, in opposite direction +Status | Command | Description | Note +---|--------|------------|------------------ +:white_check_mark: :star: | :1234: `/{pattern}[/[offset]]` | search forward for the Nth occurrence of {pattern} | Currently we only support JavaScript Regex but not Vim's in-house Regex engine. +:white_check_mark: :star: | :1234: `?{pattern}[?[offset]]` | search backward for the Nth occurrence of {pattern} | Currently we only support JavaScript Regex but not Vim's in-house Regex engine. +:warning: | :1234: `/` | repeat last search, in the forward direction | {count} is not supported. +:warning: | :1234: `?` | repeat last search, in the backward direction | {count} is not supported. +:warning: | :1234: n | repeat last search | {count} is not supported. +:warning: | :1234: N | repeat last search, in opposite direction | {count} is not supported. :white_check_mark: | :1234: * | search forward for the identifier under the cursor :white_check_mark: | :1234: # | search backward for the identifier under the cursor - | :1234: g* | like "*", but also find partial matches - | :1234: g# | like "#", but also find partial matches +:arrow_down: | :1234: g* | like "*", but also find partial matches +:arrow_down: | :1234: g# | like "#", but also find partial matches :white_check_mark: | gd | goto local declaration of identifier under the cursor - | gD | goto global declaration of identifier under the cursor +:arrow_down: | gD | goto global declaration of identifier under the cursor ## Marks and motions Status | Command | Description ---|--------|------------------------------ :white_check_mark: | m{a-zA-Z} | mark current position with mark {a-zA-Z} - | `{a-z} | go to mark {a-z} within current file - | `{A-Z} | go to mark {A-Z} in any file - | `{0-9} | go to the position where Vim was previously exited - | `` | go to the position before the last jump - | `" | go to the position when last editing this file - | `[ | go to the start of the previously operated or put text - | `] | go to the end of the previously operated or put text - | `< | go to the start of the (previous) Visual area - | `> | go to the end of the (previous) Visual area - | `. | go to the position of the last change in this file - | '{a-zA-Z0-9[]'"<>.} | same as `, but on the first non-blank in the line - | :marks | print the active marks - | :1234: CTRL-O | go to Nth older position in jump list - | :1234: CTRL-I | go to Nth newer position in jump list - | :ju[mps] | print the jump list +:white_check_mark:| `{a-z} | go to mark {a-z} within current file +:white_check_mark:| `{A-Z} | go to mark {A-Z} in any file +:white_check_mark:| `{0-9} | go to the position where Vim was previously exited +:arrow_down:| `` | go to the position before the last jump +:arrow_down:| `" | go to the position when last editing this file +:arrow_down:| `[ | go to the start of the previously operated or put text +:arrow_down:| `] | go to the end of the previously operated or put text +:arrow_down:| `< | go to the start of the (previous) Visual area +:arrow_down:| `> | go to the end of the (previous) Visual area +:arrow_down:| `. | go to the position of the last change in this file +:arrow_down:| '{a-zA-Z0-9[]'"<>.} | same as `, but on the first non-blank in the line +:arrow_down:| :marks | print the active marks +:arrow_down:| :1234: CTRL-O | go to Nth older position in jump list +:arrow_down:| :1234: CTRL-I | go to Nth newer position in jump list +:arrow_down:| :ju[mps] | print the jump list ## Various motions @@ -151,55 +155,55 @@ Status | Command | Description :white_check_mark: |:1234: H | go to the Nth line in the window, on the first non-blank :white_check_mark: | M | go to the middle line in the window, on the first non-blank :white_check_mark: |:1234: L | go to the Nth line from the bottom, on the first non-blank - |:1234: go | go to Nth byte in the buffer - |:[range]go[to] [off] | go to [off] byte in the buffer +:arrow_down:|:1234: go | go to Nth byte in the buffer +:arrow_down:|:[range]go[to] [off] | go to [off] byte in the buffer ## Using tags Status | Command | Description ---|--------|------------------------------ - | :ta[g][!] {tag} | jump to tag {tag} - | :[count]ta[g][!] | jump to [count]'th newer tag in tag list - | CTRL-] | jump to the tag under cursor, unless changes have been made - | :ts[elect][!] [tag] | list matching tags and select one to jump to - | :tj[ump][!] [tag] | jump to tag [tag] or select from list when there are multiple matches - | :lt[ag][!] [tag] | jump to tag [tag] and add matching tags to the location list - | :tagsa | print tag list - | :1234: CTRL-T | jump back from Nth older tag in tag list - | :[count]po[p][!] | jump back from [count]'th older tag in tag list - | :[count]tn[ext][!] | jump to [count]'th next matching tag - | :[count]tp[revious][!] | jump to [count]'th previous matching tag - | :[count]tr[ewind][!] | jump to [count]'th matching tag - | :tl[ast][!] | jump to last matching tag - | :pt[ag] {tag} | open a preview window to show tag {tag} - | CTRL-W } | like CTRL-] but show tag in preview window - | :pts[elect] | like ":tselect" but show tag in preview window - | :ptj[ump] | like ":tjump" but show tag in preview window - | :pc[lose] | close tag preview window - | CTRL-W z | close tag preview window` +:arrow_down:| :ta[g][!] {tag} | jump to tag {tag} +:arrow_down:| :[count]ta[g][!] | jump to [count]'th newer tag in tag list +:arrow_down:| CTRL-] | jump to the tag under cursor, unless changes have been made +:arrow_down:| :ts[elect][!] [tag] | list matching tags and select one to jump to +:arrow_down:| :tj[ump][!] [tag] | jump to tag [tag] or select from list when there are multiple matches +:arrow_down:| :lt[ag][!] [tag] | jump to tag [tag] and add matching tags to the location list +:arrow_down:| :tagsa | print tag list +:arrow_down:| :1234: CTRL-T | jump back from Nth older tag in tag list +:arrow_down:| :[count]po[p][!] | jump back from [count]'th older tag in tag list +:arrow_down:| :[count]tn[ext][!] | jump to [count]'th next matching tag +:arrow_down:| :[count]tp[revious][!] | jump to [count]'th previous matching tag +:arrow_down:| :[count]tr[ewind][!] | jump to [count]'th matching tag +:arrow_down:| :tl[ast][!] | jump to last matching tag +:arrow_down:| :pt[ag] {tag} | open a preview window to show tag {tag} +:arrow_down:| CTRL-W } | like CTRL-] but show tag in preview window +:arrow_down:| :pts[elect] | like ":tselect" but show tag in preview window +:arrow_down:| :ptj[ump] | like ":tjump" but show tag in preview window +:arrow_down:| :pc[lose] | close tag preview window +:arrow_down:| CTRL-W z | close tag preview window` ## Scrolling Status | Command | Description ---|--------|------------------------------ -:x: | :1234: CTRL-E | window N lines downwards (default: 1) -:warning: | :1234: CTRL-D | window N lines Downwards (default: 1/2 window) -:x: | :1234: CTRL-F | window N pages Forwards (downwards) - :x: | :1234: CTRL-Y | window N lines upwards (default: 1) -:warning: | :1234: CTRL-U | window N lines Upwards (default: 1/2 window) -:x: | :1234: CTRL-B | window N pages Backwards (upwards) -:x: | z CR or zt | redraw, current line at top of window -:warning: | z. or zz | redraw, current line at center of window -:x: | z- or zb | redraw, current line at bottom of window +:white_check_mark: | :1234: CTRL-E | window N lines downwards (default: 1) +:white_check_mark: | :1234: CTRL-D | window N lines Downwards (default: 1/2 window) +:white_check_mark: | :1234: CTRL-F | window N pages Forwards (downwards) +:white_check_mark: | :1234: CTRL-Y | window N lines upwards (default: 1) +:white_check_mark: | :1234: CTRL-U | window N lines Upwards (default: 1/2 window) +:white_check_mark: | :1234: CTRL-B | window N pages Backwards (upwards) +:white_check_mark: | z CR or zt | redraw, current line at top of window +:white_check_mark: | z. or zz | redraw, current line at center of window +:white_check_mark: | z- or zb | redraw, current line at bottom of window These only work when 'wrap' is off: -Status | Command | Description ----|--------|------------------------------ - :x: | :1234: zh | scroll screen N characters to the right - :x: | :1234: zl | scroll screen N characters to the left - :x: | :1234: zH | scroll screen half a screenwidth to the right -:x: | :1234: zL | scroll screen half a screenwidth to the left +Status | Command | Description | Note +---|--------|------------------|------------ +:white_check_mark: :star: | :1234: zh | scroll screen N characters to the right | In Code, the cursor wil always move when you run this command, whether the horizontal scrollbar moves or not. +:white_check_mark: :star: | :1234: zl | scroll screen N characters to the left | As above +:white_check_mark: :star: | :1234: zH | scroll screen half a screenwidth to the right | As above +:white_check_mark: :star: | :1234: zL | scroll screen half a screenwidth to the left | As above ## Inserting text @@ -217,8 +221,8 @@ in Visual block mode: Status | Command | Description ---|--------|------------------------------ - | I | insert the same text in front of all the selected lines - | A | append the same text after all the selected lines +:white_check_mark:| I | insert the same text in front of all the selected lines +:white_check_mark:| A | append the same text after all the selected lines ## Insert mode keys @@ -242,26 +246,26 @@ Status | Command | Description ## Special keys in Insert mode -Status | Command | Description ----|--------|------------------------------ - | CTRL-V {char}.. | insert character literally, or enter decimal byte value -:warning: | NL or CR or CTRL-M or CTRL-J | begin new line - | CTRL-E | insert the character from below the cursor - | CTRL-Y | insert the character from above the cursor - | CTRL-A | insert previously inserted text - | CTRL-@ | insert previously inserted text and stop Insert mode - | CTRL-R {0-9a-z%#:.-="} | insert the contents of a register - | CTRL-N | insert next match of identifier before the cursor - | CTRL-P | insert previous match of identifier before the cursor - | CTRL-X ... | complete the word before the cursor in various ways - | BS or CTRL-H | delete the character before the cursor -:white_check_mark: | Del | delete the character under the cursor -:white_check_mark: | CTRL-W | delete word before the cursor - | CTRL-U | delete all entered characters in the current line - | CTRL-T | insert one shiftwidth of indent in front of the current line - | CTRL-D | delete one shiftwidth of indent in front of the current line - | 0 CTRL-D | delete all indent in the current line - | ^ CTRL-D | delete all indent in the current line, restore indent in next line +Status | Command | Description | Note +---|--------|-----------|------------------- +:arrow_down: |CTRL-V {char}.. | insert character literally, or enter decimal byte value +:warning: | NL or CR or CTRL-M or CTRL-J | begin new line | CTRL-M and CTRL-J are not supported yet +:white_check_mark: | CTRL-E | insert the character from below the cursor +:white_check_mark: | CTRL-Y | insert the character from above the cursor +:running: | CTRL-A | insert previously inserted text +:running: | CTRL-@ | insert previously inserted text and stop Insert mode +:white_check_mark: | CTRL-R {0-9a-z%#:.-="} | insert the contents of a register +:arrow_down:| CTRL-N | insert next match of identifier before the cursor +:arrow_down:| CTRL-P | insert previous match of identifier before the cursor +:arrow_down:| CTRL-X ... | complete the word before the cursor in various ways +:white_check_mark: | BS or CTRL-H | delete the character before the cursor +:white_check_mark: | Del | delete the character under the cursor +:white_check_mark: | CTRL-W | delete word before the cursor +:white_check_mark: | CTRL-U | delete all entered characters in the current line +:white_check_mark: | CTRL-T | insert one shiftwidth of indent in front of the current line +:white_check_mark: | CTRL-D | delete one shiftwidth of indent in front of the current line + | 0 CTRL-D | delete all indent in the current line + | ^ CTRL-D | delete all indent in the current line, restore indent in next line ## Digraphs @@ -274,8 +278,8 @@ Status | Command | Description Status | Command | Description ---|--------|------------------------------ - | :r [file] | insert the contents of [file] below the cursor - | :r! {command} | insert the standard output of {command} below the cursor +:warning: | :r [file] | insert the contents of [file] below the cursor +:warning: | :r! {command} | insert the standard output of {command} below the cursor ## Deleting text @@ -289,23 +293,23 @@ Status | Command | Description :white_check_mark: | :1234: dd | delete N lines :white_check_mark: | :1234: D | delete to the end of the line (and N-1 more lines) :white_check_mark: | :1234: J | join N-1 lines (delete EOLs) - | {visual}J | join the highlighted lines +:white_check_mark: | {visual}J | join the highlighted lines :white_check_mark: | :1234: gJ | like "J", but without inserting spaces - | {visual}gJ | like "{visual}J", but without inserting spaces - | :[range]d [x] | delete [range] lines [into register x] +:white_check_mark:| {visual}gJ | like "{visual}J", but without inserting spaces +:white_check_mark:| :[range]d [x] | delete [range] lines [into register x] ## Copying and moving text -Status | Command | Description ----|--------|------------------------------ -:warning: | "{char} | use register {char} for the next delete, yank, or put +Status | Command | Description | Note +---|--------|-------------|----------------- +:running: | "{char} | use register {char} for the next delete, yank, or put | read only registers are not supported yet :white_check_mark: | "* | use register `*` to access system clipboard - | :reg | show the contents of all registers - | :reg {arg} | show the contents of registers mentioned in {arg} +:white_check_mark: | :reg | show the contents of all registers +:white_check_mark: | :reg {arg} | show the contents of registers mentioned in {arg} :white_check_mark: | :1234: y{motion} | yank the text moved over with {motion} into a register :white_check_mark: | {visual}y | yank the highlighted text into a register :white_check_mark: | :1234: yy | yank N lines into a register -:warning: | :1234: Y | yank N lines into a register +:white_check_mark: | :1234: Y | yank N lines into a register :white_check_mark: | :1234: p | put a register after the cursor position (N times) :white_check_mark: | :1234: P | put a register before the cursor position (N times) :white_check_mark: | :1234: ]p | like p, but adjust indent to current line @@ -315,28 +319,27 @@ Status | Command | Description ## Changing text -Status | Command | Description ----|--------|------------------------------ -:warning: | :1234: r{char} | replace N characters with {char} - | :1234: gr{char} | replace N characters without affecting layout -:warning: | :1234: R | enter Replace mode (repeat the entered text N times) - | :1234: gR | enter virtual Replace mode: Like Replace mode but without affecting layout - | {visual}r{char} | in Visual block mode: Replace each char of the selected text with {char} +Status | Command | Description | Note +---|--------|------------|------------------ +:white_check_mark: | :1234: r{char} | replace N characters with {char} +:arrow_down:| :1234: gr{char} | replace N characters without affecting layout +:white_check_mark: | :1234: R | enter Replace mode (repeat the entered text N times) | {count} is not supported yet +:arrow_down:| :1234: gR | enter virtual Replace mode: Like Replace mode but without affecting layout +:arrow_down:| {visual}r{char} | in Visual block mode: Replace each char of the selected text with {char} (change = delete text and enter Insert mode) Status | Command | Description ---|--------|------------------------------ -:warning: | :1234: c{motion} | change the text that is moved over with {motion} -:white_check_mark: | {visual}c | change the highlighted text -:warning: | :1234: cc | change N lines -:warning: | :1234: S | change N lines -:warning: | :1234: C | change to the end of the line (and N-1 more lines) - | :1234: s | change N characters - | {visual}c | in Visual block mode: Change each of the selected lines with the entered text - | {visual}C | in Visual block mode: Change each of the selected lines until end-of-line with the entered text -:warning: | :1234: ~ | switch case for N characters and advance cursor -:white_check_mark: | {visual}~ | switch case for highlighted text +:white_check_mark: | :1234: c{motion} | change the text that is moved over with {motion} +:white_check_mark: | {visual}c | change the highlighted text +:white_check_mark: | :1234: cc | change N lines +:white_check_mark: | :1234: S | change N lines +:white_check_mark: | :1234: C | change to the end of the line (and N-1 more lines) +:white_check_mark: | :1234: s | change N characters +:white_check_mark: | {visual}c | in Visual block mode: Change each of the selected lines with the entered text +:white_check_mark: | {visual}C | in Visual block mode: Change each of the selected lines until end-of-line with the entered text +:white_check_mark: | switch case for highlighted text :white_check_mark: | {visual}u | make highlighted text lowercase :white_check_mark: | {visual}U | make highlighted text uppercase :white_check_mark: | g~{motion} | switch case for the text that is moved over with {motion} @@ -350,26 +353,26 @@ Status | Command | Description :white_check_mark: | :1234: << | move N lines one shiftwidth left :white_check_mark: | :1234: >{motion} | move the lines that are moved over with {motion} one shiftwidth right :white_check_mark: | :1234: >> | move N lines one shiftwidth right - | :1234: gq{motion}| format the lines that are moved over with {motion} to 'textwidth' length - | :[range]ce[nter] [width] | center the lines in [range] - | :[range]le[ft] [indent] | left-align the lines in [range] (with [indent]) - | :[range]ri[ght] [width] | right-align the lines in [range] +:arrow_down:| :1234: gq{motion}| format the lines that are moved over with {motion} to 'textwidth' length +:arrow_down:| :[range]ce[nter] [width] | center the lines in [range] +:arrow_down:| :[range]le[ft] [indent] | left-align the lines in [range] (with [indent]) +:arrow_down:| :[ranee]ri[ght] [width] | right-align the lines in [range] ## Complex changes -Status | Command | Description ----|--------|------------------------------ - | :1234: `!{motion}{command}` | filter the lines that are moved over through {command} - | :1234: `!!{command}` | filter N lines through {command} - | `{visual}!{command}` | filter the highlighted lines through {command} - | `:[range]! {command}` | filter [range] lines through {command} +Status | Command | Description | Note +---|--------|------------------|------------ +:arrow_down:| :1234: `!{motion}{command}` | filter the lines that are moved over through {command} +:arrow_down:| :1234: `!!{command}` | filter N lines through {command} +:arrow_down:| `{visual}!{command}` | filter the highlighted lines through {command} +:arrow_down:| `:[range]! {command}` | filter [range] lines through {command} :white_check_mark: | :1234: ={motion} | filter the lines that are moved over through 'equalprg' - | :1234: == | filter N lines through 'equalprg' +:arrow_down:| :1234: == | filter N lines through 'equalprg' :white_check_mark: | {visual}= | filter the highlighted lines through 'equalprg' -:warning: | :[range]s[ubstitute]/{pattern}/{string}/[g][c] | substitute {pattern} by {string} in [range] lines; with [g], replace all occurrences of {pattern}; with [c], confirm each replacement - | :[range]s[ubstitute] [g][c] | repeat previous ":s" with new range and options - | & | Repeat previous ":s" on current line without options - :arrow_down: | :[range]ret[ab][!] [tabstop] | set 'tabstop' to new value and adjust white space accordingly +:white_check_mark: :star: :warning: | :[range]s[ubstitute]/{pattern}/{string}/[g][c] | substitute {pattern} by {string} in [range] lines; with [g], replace all occurrences of {pattern}; with [c], confirm each replacement | Currently we only support JavaScript Regex and only options `gi` are implemented +:arrow_down:| :[range]s[ubstitute] [g][c] | repeat previous ":s" with new range and options +:arrow_down:| & | Repeat previous ":s" on current line without options +:arrow_down:| :[range]ret[ab][!] [tabstop] | set 'tabstop' to new value and adjust white space accordingly ## Visual mode @@ -377,12 +380,11 @@ Status | Command | Description ---|--------|------------------------------ :white_check_mark: | v | start highlighting characters :white_check_mark: | V | start highlighting linewise - | CTRL-V | start highlighting blockwise - | o | exchange cursor position with start of highlighting - | gv | start highlighting on previous visual area +:white_check_mark:| o | exchange cursor position with start of highlighting +:arrow_down: | gv | start highlighting on previous visual area :white_check_mark: | v | highlight characters or stop highlighting :white_check_mark: | V | highlight linewise or stop highlighting - | CTRL-V | highlight blockwise or stop highlighting +:white_check_mark: | CTRL-V | highlight blockwise or stop highlighting ## Text objects (only in Visual mode or after an operator) @@ -394,8 +396,8 @@ Status | Command | Description :white_check_mark: | :1234: iW | Select "inner |WORD|" :white_check_mark: | :1234: as | Select "a sentence" :white_check_mark: | :1234: is | Select "inner sentence" - | :1234: ap | Select "a paragraph" - | :1234: ip | Select "inner paragraph" +:white_check_mark: | :1234: ap | Select "a paragraph" +:white_check_mark: | :1234: ip | Select "inner paragraph" :white_check_mark: | :1234: a], a[ | select '[' ']' blocks :white_check_mark: | :1234: i], i[ | select inner '[' ']' blocks :white_check_mark: | :1234: ab, a(, a) | Select "a block" (from "[(" to "])") @@ -415,18 +417,18 @@ Status | Command | Description ## Repeating commands -Status | Command | Description ----|--------|------------------------------ -:white_check_mark: | :1234: . | repeat last change (with count replaced with N) - | q{a-z} | record typed characters into register {a-z} - | q{A-Z} | record typed characters, appended to register {a-z} - | q | stop recording - | :1234: @{a-z} | execute the contents of register {a-z} (N times) - | :1234: @@ | repeat previous @{a-z} (N times) - | :@{a-z} | execute the contents of register {a-z} as an Ex command - | :@@ | repeat previous :@{a-z} - | :[range]g[lobal]/{pattern}/[cmd] | execute Ex command [cmd] (default: ":p") on the lines within [range] where {pattern} matches - | :[range]g[lobal]!/{pattern}/[cmd] | execute Ex command [cmd] (default: ":p") on the lines within [range] where {pattern} does NOT match +Status | Command | Description | Note +---|--------|--------------|---------------- +:white_check_mark: :star: | :1234: . | repeat last change (with count replaced with N) | It won't repeat Code's auto-complete change. +:arrow_down:| q{a-z} | record typed characters into register {a-z} +:arrow_down:| q{A-Z} | record typed characters, appended to register {a-z} +:arrow_down:| q | stop recording +:arrow_down:| :1234: @{a-z} | execute the contents of register {a-z} (N times) +:arrow_down:| :1234: @@ | repeat previous @{a-z} (N times) +:arrow_down:| :@{a-z} | execute the contents of register {a-z} as an Ex command +:arrow_down:| :@@ | repeat previous :@{a-z} +:arrow_down:| :[range]g[lobal]/{pattern}/[cmd] | execute Ex command [cmd] (default: ":p") on the lines within [range] where {pattern} matches +:arrow_down:| :[range]g[lobal]!/{pattern}/[cmd] | execute Ex command [cmd] (default: ":p") on the lines within [range] where {pattern} does NOT match :arrow_down: | :so[urce] {file} | read Ex commands from {file} :arrow_down: | :so[urce]! {file} | read Vim commands from {file} :arrow_down: | :sl[eep] [sec] | don't do anything for [sec] seconds @@ -434,30 +436,30 @@ Status | Command | Description ## options -Status | Command | Description ----|--------|------------------------------ - | :se[t] | show all modified options - | :se[t] all | show all non-termcap options - | :se[t] termcap | show all termcap options +Status | Command | Description | Note +---|--------|---------|--------------------- +:arrow_down: | :se[t] | show all modified options +:arrow_down: | :se[t] all | show all non-termcap options +:arrow_down: | :se[t] termcap | show all termcap options :white_check_mark: | :se[t] {option} | set boolean option (switch it on), show string or number option :white_check_mark: | :se[t] no{option} | reset boolean option (switch it off) - | :se[t] inv{option} |invert boolean option +:white_check_mark: | :se[t] inv{option} |invert boolean option :white_check_mark: | :se[t] {option}={value} | set string/number option to {value} - | :se[t] {option}+={value} | append {value} to string option, add {value} to number option - | :se[t] {option}-={value} | remove {value} to string option, subtract {value} from number option - | :se[t] {option}? | show value of {option} - | :se[t] {option}& | reset {option} to its default value - | :setl[ocal] | like ":set" but set the local value for options that have one - | :setg[lobal] | like ":set" but set the global value of a local option - | :fix[del] | set value of 't_kD' according to value of 't_kb' - | :opt[ions] | open a new window to view and set options, grouped by functionality, a one line explanation and links to the help +:white_check_mark: | :se[t] {option}+={value} | append {value} to string option, add {value} to number option +:white_check_mark: | :se[t] {option}-={value} | remove {value} to string option, subtract {value} from number option | We don't support string option here yet. +:white_check_mark: | :se[t] {option}? | show value of {option} +:arrow_down: | :se[t] {option}& | reset {option} to its default value +:arrow_down: | :setl[ocal] | like ":set" but set the local value for options that have one +:arrow_down: | :setg[lobal] | like ":set" but set the global value of a local option +:arrow_down: | :fix[del] | set value of 't_kD' according to value of 't_kb' +:arrow_down: | :opt[ions] | open a new window to view and set options, grouped by functionality, a one line explanation and links to the help Since the list is too long, now we just put those already supported options here. Status | Command | Default Value | Description ---|--------|-------|------------------------------ :white_check_mark:| tabstop (ts) | 4. we use Code's default value `tabSize` instead of Vim | number of spaces that <Tab> in file uses -:white_check_mark:| :white_check_mark:| hlsearch (hls) | false | When there is a previous search pattern, highlight all its matches. +:white_check_mark:| hlsearch (hls) | false | When there is a previous search pattern, highlight all its matches. :white_check_mark:| ignorecase (ic) | true | Ignore case in search patterns. :white_check_mark:| smartcase (scs) | true | Override the 'ignorecase' option if the search pattern contains upper case characters. :white_check_mark:| iskeyword (isk) | `@,48-57,_,128-167,224-235` | keywords contain alphanumeric characters and '_'. If there is no user setting for `iskeyword`, we use `editor.wordSeparators` properties. @@ -469,74 +471,75 @@ Status | Command | Default Value | Description ## Undo/Redo commands -Status | Command | Default Value | Description +Status | Command | Description | Note ---|--------|-------|------------------------------ -:warning: | :1234: u | undo last N changes -:warning: | :1234: CTRL-R | redo last N undone changes -| U | restore last changed line +:running: | :1234: u | undo last N changes | Current implementation may not cover every case perfectly. +:running: | :1234: CTRL-R | redo last N undone changes | As above. + | U | restore last changed line ## External commands -Status | Command | Default Value | Description ----|--------|-------|------------------------------ +Status | Command | Description +---|--------|----------------- :arrow_down: | :sh[ell] | start a shell :arrow_down: | :!{command} | execute {command} with a shell :arrow_down: | K | lookup keyword under the cursor with 'keywordprg' program (default: "man") -## Ex rangs +## Ex ranges -Status | Command | Default Value | Description ----|--------|-------|------------------------------ -:white_check_mark: | , | separates two line numbers -| ; | idem, set cursor to the first line number before interpreting the second one +Status | Command | Description | Note +---|--------|-------|------------|------------------ +:white_check_mark: | , | separates two line numbers| +:white_check_mark: :star: :warning: | ; | idem, set cursor to the first line number before interpreting the second one | The cursor movement is not included. :white_check_mark: | {number} | an absolute line number :white_check_mark: | . | the current line :white_check_mark: | $ | the last line in the file :white_check_mark: | % | equal to 1,$ (the entire file) -| * | equal to '<,'> (visual area) -| 't | position of mark t -| /{pattern}[/] | the next line where {pattern} matches -| ?{pattern}[?] | the previous line where {pattern} matches +:white_check_mark: | * | equal to '<,'> (visual area) +:white_check_mark: | 't | position of mark t +:arrow_down: | /{pattern}[/] | the next line where {pattern} matches +:arrow_down: | ?{pattern}[?] | the previous line where {pattern} matches :white_check_mark: | +[num] | add [num] to the preceding line number (default: 1) :white_check_mark: | -[num] | subtract [num] from the preceding line number (default: 1) ## Editing a file -Status | Command | Description ----|--------|------------------------------ -:warning: | :e[dit] {file} | Edit {file}. We will open file in a new Tab of current Grouped Editor instead of opening in current tab. +Status | Command | Description | Note +---|--------|------------------|----------- +:white_check_mark: :star: | :e[dit] {file} | Edit {file}. | We will open file in a new Tab of current Grouped Editor instead of opening in current tab. ## Multi-window commands -Status | Command | Description ----|--------|------------------------------ -:warning: | :e[dit] {file} | Edit {file}. We will open file in a new Tab of current Grouped Editor instead of opening in current tab. -:warning: | <ctrl-w> hl | Switching between windows. As we don't have the concept of Window in VS Code, we are mapping these commands to switching between Grouped Editors. -:x: | :sp {file} | Split current window in two. VS Code doesn't support split Window horizontally. - | :vsp {file} | Split vertically current window in two. -:x: | :new | Create a new window horizontally and start editing an empty file in it. - | :vne[w] | Create a new window vertically and start editing an empty file in it. +Status | Command | Description | Note +---|--------|-----------------|------------- +:white_check_mark: :star: | :e[dit] {file} | Edit {file}. | We will open file in a new Tab of current Grouped Editor instead of opening in current tab. +:white_check_mark: :star: | <ctrl-w> hl | Switching between windows. | As we don't have the concept of Window in VS Code, we are mapping these commands to switching between Grouped Editors. +:x: | :sp {file} | Split current window in two. | VS Code doesn't support split Window horizontally. +:white_check_mark: :star: | :vsp {file} | Split vertically current window in two. | VS Code only supports three vertical window at most and that's the limitation of this command. +:x: | :new | Create a new window horizontally and start editing an empty file in it. | VS Code doesn't support split Window horizontally. +:white_check_mark: :star: | :vne[w] | Create a new window vertically and start editing an empty file in it. | VS Code only supports three vertical window at most and that's the limitation of this command. + ## Tabs -Status | Command | Description ----|--------|------------------------------ +Status | Command | Description | Note +---|--------|------------------|------------ :white_check_mark: | :tabn[ext] :1234: | Go to next tab page or tab page {count}. The first tab page has number one. - | {count}<C-PageDown>, {count}gt | Same as above +:white_check_mark: | {count}<C-PageDown>, {count}gt | Same as above :white_check_mark: | :tabp[revious] :1234: | Go to the previous tab page. Wraps around from the first one to the last one. :white_check_mark: | :tabN[ext] :1234: | Same as above - | {count}<C-PageUp>, {count}gT | Same as above +:white_check_mark: | {count}<C-PageUp>, {count}gT | Same as above :white_check_mark: | :tabfir[st] | Go to the first tab page. :white_check_mark: | :tabl[ast] | Go to the last tab page. -:warning: | :tabe[dit] {file} | Open a new tab page with an empty window, after the current tab page - | :[count]tabe[dit], :[count]tabnew | Same as above -:warning: | :tabnew {file} | Open a new tab page with an empty window, after the current tab page - | :[count]tab {cmd} | Execute {cmd} and when it opens a new window open a new tab page instead. -:warning: | :tabc[lose][!] :1234: | Close current tab page or close tab page {count}. -:warning: | :tabo[nly][!] | Close all other tab pages. +:white_check_mark: | :tabe[dit] {file} | Open a new tab page with an empty window, after the current tab page +:arrow_down: | :[count]tabe[dit], :[count]tabnew | Same as above | [count] is not supported. +:white_check_mark: | :tabnew {file} | Open a new tab page with an empty window, after the current tab page +:arrow_down:| :[count]tab {cmd} | Execute {cmd} and when it opens a new window open a new tab page instead. +:white_check_mark: :star: | :tabc[lose][!] :1234: | Close current tab page or close tab page {count}. | Code will close tab directly without saving. +:white_check_mark: :star: | :tabo[nly][!] | Close all other tab pages. | `!` is not supported yet. | Code will close tab directly without saving. :white_check_mark: | :tabm[ove] [N] | Move the current tab page to after tab page N. -:x: | :tabs | List the tab pages and the windows they contain. - | :tabd[o] {cmd} | Execute {cmd} in each tab page. +:arrow_down:| :tabs | List the tab pages and the windows they contain. | You can always use Code's built-in shortcut: `cmd/ctrl+p` +:arrow_down:| :tabd[o] {cmd} | Execute {cmd} in each tab page. ## Folding ### Fold methods @@ -546,45 +549,32 @@ The folding method can be set with the 'foldmethod' option. This is currently no Status | Command | Description ---|--------|------------------------------ -:x: | zf{motion} or {Visual}zf | Operator to create a fold. -:x: | zF | Create a fold for [count] lines. Works like "zf". -:x: | zd | Delete one fold at the cursor. -:x: | zD | Delete folds recursively at the cursor. -:x: | zE | Eliminate all folds in the window. +:arrow_down: | zf{motion} or {Visual}zf | Operator to create a fold. +:arrow_down: | zF | Create a fold for [count] lines. Works like "zf". +:arrow_down: | zd | Delete one fold at the cursor. +:arrow_down: | zD | Delete folds recursively at the cursor. +:arrow_down: | zE | Eliminate all folds in the window. :white_check_mark: | zo | Open one fold under the cursor.When a count is given, that many folds deep will be opened. :white_check_mark: | zO | Open all folds under the cursor recursively. :white_check_mark: | zc | Close one fold under the cursor. When a count is given, that many folds deep are closed. :white_check_mark:| zC | Close all folds under the cursor recursively. -:x: | za | When on a closed fold: open it. When on an open fold: close it and set 'foldenable'. -:x: | zA | When on a closed fold: open it recursively. When on an open fold: close it recursively and set 'foldenable'. -:x: | zv | View cursor line: Open just enough folds to make the line in which the cursor is located not folded. -:x: | zx | Update folds: Undo manually opened and closed folds: re-apply 'foldlevel', then do "zv": View cursor line. -:x: | zX | Undo manually opened and closed folds -:x: | zm | Fold more: Subtract one from 'foldlevel'. +:arrow_down: | za | When on a closed fold: open it. When on an open fold: close it and set 'foldenable'. +:arrow_down: | zA | When on a closed fold: open it recursively. When on an open fold: close it recursively and set 'foldenable'. +:arrow_down: | zv | View cursor line: Open just enough folds to make the line in which the cursor is located not folded. +:arrow_down: | zx | Update folds: Undo manually opened and closed folds: re-apply 'foldlevel', then do "zv": View cursor line. +:arrow_down: | zX | Undo manually opened and closed folds +:arrow_down: | zm | Fold more: Subtract one from 'foldlevel'. :white_check_mark: | zM | Close all folds: set 'foldlevel' to 0. 'foldenable' will be set. -:x: | zr | Reduce folding: Add one to 'foldlevel'. +:arrow_down: | zr | Reduce folding: Add one to 'foldlevel'. :white_check_mark: | zR | Open all folds. This sets 'foldlevel' to highest fold level. - | zn | Fold none: reset 'foldenable'. All folds will be open. - | zN | Fold normal: set 'foldenable'. All folds will be as they were before. - | zi | Invert 'foldenable'. -:x: | [z | Move to the start of the current open fold. -:x: | ]z | Move to the end of the current open fold. -:x: | zj | Move downwards to the start of the next fold. -:x: | zk | Move upwards to the end of the previous fold. +:arrow_down: | zn | Fold none: reset 'foldenable'. All folds will be open. +:arrow_down: | zN | Fold normal: set 'foldenable'. All folds will be as they were before. +:arrow_down: | zi | Invert 'foldenable'. +:arrow_down: | [z | Move to the start of the current open fold. +:arrow_down: | ]z | Move to the end of the current open fold. +:arrow_down: | zj | Move downwards to the start of the next fold. +:arrow_down: | zk | Move upwards to the end of the previous fold. ### Fold options -Status | Command | Description ----|--------|------------------------------ -:x: | foldlevel | 'foldlevel' is a number option: The higher the more folded regions are open. -:x: | foldtext | 'foldtext' is a string option that specifies an expression. This expression is evaluated to obtain the text displayed for a closed fold. -:x: | foldcolumn | 'foldcolumn' is a number, which sets the width for a column on the side of the window to indicate folds. - | foldenable fen | Open all folds while not set. -:x: | foldexpr fde | Expression used for "expr" folding. -:x: | foldignore fdi | Characters used for "indent" folding. -:x: | foldmarker fmr | Defined markers used for "marker" folding. -:x: | foldmethod fdm | Name of the current folding method. -:x: | foldminlines fml | Minimum number of screen lines for a fold to be displayed closed. -:x: | foldnestmax fdn | Maximum nesting for "indent" and "syntax" folding. -:x: | foldopen fdo | Which kinds of commands open closed folds. -:x: | foldclose fcl | When the folds not under the cursor are closed. +Currently we don't support any fold option and we are following Code configurations. diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/STYLE.md b/.vscode/extensions/vscodevim.vim-0.2.0/STYLE.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/STYLE.md rename to .vscode/extensions/vscodevim.vim-0.2.0/STYLE.md diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/gulpfile.js b/.vscode/extensions/vscodevim.vim-0.2.0/gulpfile.js new file mode 100644 index 00000000..f59e127f --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/gulpfile.js @@ -0,0 +1,76 @@ +var gulp = require('gulp'), + bump = require('gulp-bump'), + git = require('gulp-git'), + inject = require('gulp-inject-string'), + merge = require('merge-stream'), + tag_version = require('gulp-tag-version'), + trimlines = require('gulp-trimlines'), + tslint = require('gulp-tslint'), + typings = require('gulp-typings'), + shell = require('gulp-shell'), + soften = require('gulp-soften'); + +var paths = { + src_ts: "src/**/*.ts", + tests_ts: "test/**/*.ts" +}; + +function versionBump(semver) { + return gulp.src(['./package.json']) + .pipe(bump({type: semver})) + .pipe(gulp.dest('./')) + .pipe(git.commit('bump package version')) + .pipe(tag_version()); +} + +gulp.task('typings', function () { + return gulp.src('./typings.json') + .pipe(typings()); +}); + +gulp.task('typings-vscode-definitions', ['typings'], function() { + // add vscode definitions + var vscodeTypings = '/// \n'; + var vscodeNodeTypings = '/// \n'; + return gulp.src('./typings/index.d.ts') + .pipe(inject.replace(vscodeTypings, '')) + .pipe(inject.replace(vscodeNodeTypings, '')) + .pipe(inject.prepend(vscodeTypings)) + .pipe(inject.prepend(vscodeNodeTypings)) + .pipe(gulp.dest('./typings')); +}) + +gulp.task('fix-whitespace', function() { + // 1. change tabs to spaces + // 2. trim trailing whitespace + return gulp.src([paths.src_ts, paths.tests_ts], { base: "./" }) + .pipe(soften(2)) + .pipe(trimlines({ + leading: false + })) + .pipe(gulp.dest('./')); +}); + +gulp.task('tslint', ['fix-whitespace'], function() { + var tslintOptions = { + summarizeFailureOutput: true + }; + + var srcs = gulp.src(paths.src_ts) + .pipe(tslint({ formatter: 'verbose' })) + .pipe(tslint.report(tslintOptions)); + var tests = gulp.src(paths.tests_ts) + .pipe(tslint({ formatter: 'verbose' })) + .pipe(tslint.report(tslintOptions)); + return merge(srcs, tests); +}); + +gulp.task('default', ['tslint', 'compile']); + +gulp.task('compile', shell.task(['npm run vscode:prepublish'])); +gulp.task('watch', shell.task(['npm run compile'])); +gulp.task('init', ['typings']); + +gulp.task('patch', ['default'], function() { return versionBump('patch'); }) +gulp.task('minor', ['default'], function() { return versionBump('minor'); }) +gulp.task('major', ['default'], function() { return versionBump('major'); }) diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/images/icon.png b/.vscode/extensions/vscodevim.vim-0.2.0/images/icon.png similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/images/icon.png rename to .vscode/extensions/vscodevim.vim-0.2.0/images/icon.png diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/images/screen.png b/.vscode/extensions/vscodevim.vim-0.2.0/images/screen.png similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/images/screen.png rename to .vscode/extensions/vscodevim.vim-0.2.0/images/screen.png diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/child-process/README.md b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/child-process/README.md new file mode 100644 index 00000000..5e9a74ca --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/child-process/README.md @@ -0,0 +1,9 @@ +# Security holding package + +This package name is not currently in use, but was formerly occupied +by another package. To avoid malicious use, npm is hanging on to the +package name, but loosely, and we'll probably give it to you if you +want it. + +You may adopt this package by contacting support@npmjs.com and +requesting the name. diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/child-process/package.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/child-process/package.json new file mode 100644 index 00000000..a2b27863 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/child-process/package.json @@ -0,0 +1,83 @@ +{ + "_args": [ + [ + { + "raw": "child-process@^1.0.2", + "scope": null, + "escapedName": "child-process", + "name": "child-process", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "/Volumes/Source/vim" + ] + ], + "_from": "child-process@>=1.0.2 <2.0.0", + "_id": "child-process@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/child-process", + "_nodeVersion": "4.2.6", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/child-process-1.0.2.tgz_1472177123005_0.36590453051030636" + }, + "_npmUser": { + "name": "npm", + "email": "npm@npmjs.com" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": {}, + "_requested": { + "raw": "child-process@^1.0.2", + "scope": null, + "escapedName": "child-process", + "name": "child-process", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/" + ], + "_resolved": "https://registry.npmjs.org/child-process/-/child-process-1.0.2.tgz", + "_shasum": "98974dc7ed1ee4c6229f8e305fa7313a6885a7f2", + "_shrinkwrap": null, + "_spec": "child-process@^1.0.2", + "_where": "/Volumes/Source/vim", + "author": "", + "bugs": { + "url": "https://github.com/npm/security-holder/issues" + }, + "dependencies": {}, + "description": "This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "98974dc7ed1ee4c6229f8e305fa7313a6885a7f2", + "tarball": "https://registry.npmjs.org/child-process/-/child-process-1.0.2.tgz" + }, + "gitHead": "9ef10011153183d323ed420df5bb17eaf08ab730", + "homepage": "https://github.com/npm/security-holder#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "npm", + "email": "npm@npmjs.com" + } + ], + "name": "child-process", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/security-holder.git" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "version": "1.0.2" +} diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/.npmignore b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/.npmignore similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/.npmignore rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/.npmignore diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/README.md b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/README.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/README.md rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/README.md diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/index.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/index.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/index.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/index.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/package.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/package.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/package.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/package.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/darwin.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/darwin.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/darwin.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/darwin.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/fallbacks/paste.vbs b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/fallbacks/paste.vbs similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/fallbacks/paste.vbs rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/fallbacks/paste.vbs diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/linux.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/linux.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/linux.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/linux.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/win32.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/win32.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/platform/win32.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/platform/win32.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/test/copypaste.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/test/copypaste.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/test/copypaste.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/test/copypaste.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/test/mocha.opts b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/test/mocha.opts similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/copy-paste/test/mocha.opts rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/copy-paste/test/mocha.opts diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/.npmignore b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/.npmignore similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/.npmignore rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/.npmignore diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/.travis.yml b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/.travis.yml similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/.travis.yml rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/.travis.yml diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/LICENSE b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/LICENSE similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/LICENSE rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/LICENSE diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/README.md b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/README.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/README.md rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/README.md diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/index.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/index.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/index.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/index.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/package.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/package.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/package.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/package.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/test/index.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/test/index.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/diff-match-patch/test/index.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/diff-match-patch/test/index.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/.npmignore b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/.npmignore similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/.npmignore rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/.npmignore diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/.travis.yml b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/.travis.yml similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/.travis.yml rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/.travis.yml diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/Changelog.md b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/Changelog.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/Changelog.md rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/Changelog.md diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/LICENSE b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/LICENSE similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/LICENSE rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/LICENSE diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/README.md b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/README.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/README.md rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/README.md diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/dbcs-codec.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/dbcs-codec.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/dbcs-codec.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/dbcs-codec.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/dbcs-data.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/dbcs-data.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/dbcs-data.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/dbcs-data.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/index.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/index.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/index.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/index.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/internal.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/internal.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/internal.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/internal.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/sbcs-codec.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/sbcs-codec.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/sbcs-codec.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/sbcs-codec.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/sbcs-data-generated.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/sbcs-data-generated.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/sbcs-data-generated.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/sbcs-data.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/sbcs-data.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/sbcs-data.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/sbcs-data.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/big5-added.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/big5-added.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/big5-added.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/big5-added.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/cp936.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/cp936.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/cp936.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/cp936.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/cp949.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/cp949.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/cp949.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/cp949.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/cp950.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/cp950.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/cp950.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/cp950.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/eucjp.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/eucjp.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/eucjp.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/eucjp.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/gbk-added.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/gbk-added.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/gbk-added.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/gbk-added.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/shiftjis.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/shiftjis.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/tables/shiftjis.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/tables/shiftjis.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/utf16.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/utf16.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/utf16.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/utf16.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/utf7.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/utf7.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/encodings/utf7.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/encodings/utf7.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/bom-handling.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/bom-handling.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/bom-handling.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/bom-handling.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/extend-node.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/extend-node.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/extend-node.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/extend-node.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/index.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/index.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/index.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/index.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/streams.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/streams.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/lib/streams.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/lib/streams.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/package.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/package.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/iconv-lite/package.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/iconv-lite/package.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/LICENSE b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/LICENSE similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/LICENSE rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/LICENSE diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/README.md b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/README.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/README.md rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/README.md diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_DataView.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_DataView.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_DataView.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_DataView.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Hash.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Hash.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Hash.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Hash.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_LazyWrapper.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_LazyWrapper.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_LazyWrapper.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_LazyWrapper.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_ListCache.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_ListCache.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_ListCache.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_ListCache.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_LodashWrapper.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_LodashWrapper.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_LodashWrapper.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_LodashWrapper.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Map.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Map.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Map.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Map.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_MapCache.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_MapCache.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_MapCache.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_MapCache.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Promise.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Promise.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Promise.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Promise.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Set.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Set.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Set.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Set.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_SetCache.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_SetCache.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_SetCache.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_SetCache.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Stack.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Stack.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Stack.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Stack.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Symbol.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Symbol.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Symbol.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Symbol.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Uint8Array.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Uint8Array.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_Uint8Array.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_Uint8Array.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_WeakMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_WeakMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_WeakMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_WeakMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_addMapEntry.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_addMapEntry.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_addMapEntry.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_addMapEntry.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_addSetEntry.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_addSetEntry.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_addSetEntry.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_addSetEntry.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_apply.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_apply.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_apply.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_apply.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayAggregator.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayAggregator.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayAggregator.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayAggregator.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayEach.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayEach.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayEach.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayEach.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayEachRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayEachRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayEachRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayEachRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayEvery.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayEvery.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayEvery.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayEvery.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayFilter.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayFilter.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayFilter.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayFilter.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayIncludes.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayIncludes.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayIncludes.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayIncludes.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayIncludesWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayIncludesWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayIncludesWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayIncludesWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayLikeKeys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayLikeKeys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayLikeKeys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayLikeKeys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayPush.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayPush.js new file mode 100644 index 00000000..7d742b38 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayPush.js @@ -0,0 +1,20 @@ +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +module.exports = arrayPush; diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayReduce.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayReduce.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayReduce.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayReduce.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayReduceRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayReduceRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arrayReduceRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arrayReduceRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arraySome.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arraySome.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_arraySome.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_arraySome.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_asciiSize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_asciiSize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_asciiSize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_asciiSize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_asciiToArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_asciiToArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_asciiToArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_asciiToArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_asciiWords.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_asciiWords.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_asciiWords.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_asciiWords.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assignInDefaults.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assignInDefaults.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assignInDefaults.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assignInDefaults.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assignMergeValue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assignMergeValue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assignMergeValue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assignMergeValue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assignValue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assignValue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assignValue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assignValue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assocIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assocIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_assocIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_assocIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseAggregator.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseAggregator.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseAggregator.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseAggregator.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseAssign.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseAssign.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseAssign.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseAssign.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseAt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseAt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseAt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseAt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseClamp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseClamp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseClamp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseClamp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseClone.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseClone.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseClone.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseClone.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseConforms.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseConforms.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseConforms.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseConforms.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseConformsTo.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseConformsTo.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseConformsTo.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseConformsTo.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseCreate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseCreate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseCreate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseCreate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseDelay.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseDelay.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseDelay.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseDelay.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseDifference.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseDifference.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseDifference.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseDifference.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseEach.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseEach.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseEach.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseEach.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseEachRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseEachRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseEachRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseEachRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseEvery.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseEvery.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseEvery.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseEvery.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseExtremum.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseExtremum.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseExtremum.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseExtremum.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFill.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFill.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFill.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFill.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFilter.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFilter.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFilter.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFilter.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFindIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFindIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFindIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFindIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFindKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFindKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFindKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFindKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFlatten.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFlatten.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFlatten.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFlatten.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseForOwn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseForOwn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseForOwn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseForOwn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseForOwnRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseForOwnRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseForOwnRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseForOwnRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseForRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseForRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseForRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseForRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFunctions.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFunctions.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseFunctions.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseFunctions.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGetAllKeys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGetAllKeys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGetAllKeys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGetAllKeys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGetTag.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGetTag.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGetTag.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGetTag.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseGt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseGt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseHas.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseHas.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseHas.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseHas.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseHasIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseHasIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseHasIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseHasIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseInRange.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseInRange.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseInRange.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseInRange.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIndexOfWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIndexOfWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIndexOfWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIndexOfWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIntersection.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIntersection.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIntersection.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIntersection.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseInverter.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseInverter.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseInverter.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseInverter.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseInvoke.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseInvoke.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseInvoke.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseInvoke.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsArrayBuffer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsArrayBuffer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsArrayBuffer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsArrayBuffer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsDate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsDate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsDate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsDate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsEqual.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsEqual.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsEqual.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsEqual.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsEqualDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsEqualDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsEqualDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsEqualDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsMatch.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsMatch.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsMatch.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsMatch.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsNaN.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsNaN.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsNaN.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsNaN.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsNative.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsNative.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsNative.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsNative.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsRegExp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsRegExp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsRegExp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsRegExp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsTypedArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsTypedArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIsTypedArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIsTypedArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIteratee.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIteratee.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseIteratee.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseIteratee.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseKeys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseKeys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseKeys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseKeys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseKeysIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseKeysIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseKeysIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseKeysIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseLodash.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseLodash.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseLodash.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseLodash.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseLt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseLt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseLt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseLt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMatches.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMatches.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMatches.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMatches.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMatchesProperty.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMatchesProperty.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMatchesProperty.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMatchesProperty.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMean.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMean.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMean.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMean.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMerge.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMerge.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMerge.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMerge.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMergeDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMergeDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseMergeDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseMergeDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseNth.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseNth.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseNth.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseNth.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseOrderBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseOrderBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseOrderBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseOrderBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePick.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePick.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePick.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePick.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePickBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePickBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePickBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePickBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseProperty.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseProperty.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseProperty.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseProperty.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePropertyDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePropertyDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePropertyDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePropertyDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePropertyOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePropertyOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePropertyOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePropertyOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePullAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePullAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePullAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePullAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePullAt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePullAt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_basePullAt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_basePullAt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRandom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRandom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRandom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRandom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRange.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRange.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRange.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRange.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseReduce.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseReduce.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseReduce.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseReduce.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRepeat.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRepeat.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRepeat.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRepeat.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRest.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRest.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseRest.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseRest.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSetData.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSetData.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSetData.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSetData.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSlice.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSlice.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSlice.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSlice.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSome.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSome.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSome.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSome.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortedIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortedIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortedIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortedIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortedIndexBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortedIndexBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortedIndexBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortedIndexBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortedUniq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortedUniq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSortedUniq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSortedUniq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSum.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSum.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseSum.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseSum.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseTimes.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseTimes.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseTimes.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseTimes.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseToNumber.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseToNumber.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseToNumber.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseToNumber.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseToPairs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseToPairs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseToPairs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseToPairs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseToString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseToString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseToString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseToString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUnary.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUnary.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUnary.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUnary.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUniq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUniq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUniq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUniq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUnset.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUnset.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUnset.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUnset.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUpdate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUpdate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseUpdate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseUpdate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseValues.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseValues.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseValues.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseValues.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseWrapperValue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseWrapperValue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseWrapperValue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseWrapperValue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseXor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseXor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseXor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseXor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseZipObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseZipObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_baseZipObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_baseZipObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cacheHas.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cacheHas.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cacheHas.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cacheHas.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castArrayLikeObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castArrayLikeObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castArrayLikeObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castArrayLikeObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castFunction.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castFunction.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castFunction.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castFunction.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castPath.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castPath.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castPath.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castPath.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castSlice.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castSlice.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_castSlice.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_castSlice.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_charsEndIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_charsEndIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_charsEndIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_charsEndIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_charsStartIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_charsStartIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_charsStartIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_charsStartIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneArrayBuffer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneArrayBuffer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneArrayBuffer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneArrayBuffer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneBuffer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneBuffer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneBuffer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneBuffer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneDataView.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneDataView.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneDataView.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneDataView.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneRegExp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneRegExp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneRegExp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneRegExp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneSymbol.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneSymbol.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneSymbol.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneSymbol.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneTypedArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneTypedArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_cloneTypedArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_cloneTypedArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_compareAscending.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_compareAscending.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_compareAscending.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_compareAscending.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_compareMultiple.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_compareMultiple.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_compareMultiple.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_compareMultiple.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_composeArgs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_composeArgs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_composeArgs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_composeArgs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_composeArgsRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_composeArgsRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_composeArgsRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_composeArgsRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_copyArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_copyArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_copyArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_copyArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_copyObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_copyObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_copyObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_copyObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_copySymbols.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_copySymbols.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_copySymbols.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_copySymbols.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_coreJsData.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_coreJsData.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_coreJsData.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_coreJsData.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_countHolders.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_countHolders.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_countHolders.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_countHolders.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createAggregator.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createAggregator.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createAggregator.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createAggregator.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createAssigner.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createAssigner.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createAssigner.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createAssigner.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createBaseEach.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createBaseEach.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createBaseEach.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createBaseEach.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createBaseFor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createBaseFor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createBaseFor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createBaseFor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createBind.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createBind.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createBind.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createBind.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCaseFirst.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCaseFirst.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCaseFirst.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCaseFirst.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCompounder.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCompounder.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCompounder.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCompounder.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCtor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCtor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCtor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCtor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCurry.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCurry.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createCurry.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createCurry.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createFind.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createFind.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createFind.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createFind.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createFlow.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createFlow.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createFlow.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createFlow.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createHybrid.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createHybrid.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createHybrid.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createHybrid.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createInverter.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createInverter.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createInverter.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createInverter.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createMathOperation.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createMathOperation.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createMathOperation.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createMathOperation.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createOver.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createOver.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createOver.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createOver.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createPadding.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createPadding.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createPadding.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createPadding.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createPartial.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createPartial.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createPartial.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createPartial.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRange.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRange.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRange.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRange.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRecurry.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRecurry.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRecurry.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRecurry.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRelationalOperation.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRelationalOperation.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRelationalOperation.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRelationalOperation.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRound.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRound.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createRound.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createRound.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createToPairs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createToPairs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createToPairs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createToPairs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createWrap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createWrap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_createWrap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_createWrap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_deburrLetter.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_deburrLetter.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_deburrLetter.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_deburrLetter.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_defineProperty.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_defineProperty.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_defineProperty.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_defineProperty.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_equalArrays.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_equalArrays.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_equalArrays.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_equalArrays.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_equalByTag.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_equalByTag.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_equalByTag.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_equalByTag.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_equalObjects.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_equalObjects.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_equalObjects.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_equalObjects.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_escapeHtmlChar.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_escapeHtmlChar.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_escapeHtmlChar.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_escapeHtmlChar.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_escapeStringChar.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_escapeStringChar.js new file mode 100644 index 00000000..44eca96c --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_escapeStringChar.js @@ -0,0 +1,22 @@ +/** Used to escape characters for inclusion in compiled string literals. */ +var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' +}; + +/** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ +function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; +} + +module.exports = escapeStringChar; diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_freeGlobal.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_freeGlobal.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_freeGlobal.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_freeGlobal.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getAllKeys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getAllKeys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getAllKeys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getAllKeys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getAllKeysIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getAllKeysIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getAllKeysIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getAllKeysIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getData.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getData.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getData.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getData.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getFuncName.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getFuncName.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getFuncName.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getFuncName.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getHolder.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getHolder.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getHolder.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getHolder.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getMapData.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getMapData.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getMapData.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getMapData.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getMatchData.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getMatchData.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getMatchData.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getMatchData.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getNative.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getNative.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getNative.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getNative.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getPrototype.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getPrototype.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getPrototype.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getPrototype.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getSymbols.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getSymbols.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getSymbols.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getSymbols.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getSymbolsIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getSymbolsIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getSymbolsIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getSymbolsIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getTag.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getTag.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getTag.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getTag.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getValue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getValue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getValue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getValue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getView.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getView.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getView.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getView.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getWrapDetails.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getWrapDetails.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_getWrapDetails.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_getWrapDetails.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hasPath.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hasPath.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hasPath.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hasPath.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hasUnicode.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hasUnicode.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hasUnicode.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hasUnicode.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hasUnicodeWord.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hasUnicodeWord.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hasUnicodeWord.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hasUnicodeWord.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashClear.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashClear.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashClear.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashClear.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashDelete.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashDelete.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashDelete.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashDelete.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashGet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashGet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashGet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashGet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashHas.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashHas.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashHas.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashHas.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_hashSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_hashSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_initCloneArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_initCloneArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_initCloneArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_initCloneArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_initCloneByTag.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_initCloneByTag.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_initCloneByTag.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_initCloneByTag.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_initCloneObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_initCloneObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_initCloneObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_initCloneObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_insertWrapDetails.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_insertWrapDetails.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_insertWrapDetails.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_insertWrapDetails.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isFlattenable.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isFlattenable.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isFlattenable.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isFlattenable.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isHostObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isHostObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isHostObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isHostObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isIterateeCall.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isIterateeCall.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isIterateeCall.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isIterateeCall.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isKeyable.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isKeyable.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isKeyable.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isKeyable.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isLaziable.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isLaziable.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isLaziable.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isLaziable.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isMaskable.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isMaskable.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isMaskable.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isMaskable.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isMasked.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isMasked.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isMasked.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isMasked.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isPrototype.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isPrototype.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isPrototype.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isPrototype.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isStrictComparable.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isStrictComparable.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_isStrictComparable.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_isStrictComparable.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_iteratorToArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_iteratorToArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_iteratorToArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_iteratorToArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_lazyClone.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_lazyClone.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_lazyClone.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_lazyClone.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_lazyReverse.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_lazyReverse.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_lazyReverse.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_lazyReverse.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_lazyValue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_lazyValue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_lazyValue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_lazyValue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheClear.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheClear.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheClear.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheClear.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheDelete.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheDelete.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheDelete.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheDelete.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheGet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheGet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheGet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheGet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheHas.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheHas.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheHas.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheHas.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_listCacheSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_listCacheSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheClear.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheClear.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheClear.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheClear.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheDelete.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheDelete.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheDelete.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheDelete.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheGet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheGet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheGet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheGet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheHas.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheHas.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheHas.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheHas.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapCacheSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapCacheSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapToArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapToArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mapToArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mapToArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_matchesStrictComparable.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_matchesStrictComparable.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_matchesStrictComparable.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_matchesStrictComparable.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mergeData.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mergeData.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mergeData.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mergeData.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mergeDefaults.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mergeDefaults.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_mergeDefaults.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_mergeDefaults.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_metaMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_metaMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_metaMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_metaMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nativeCreate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nativeCreate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nativeCreate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nativeCreate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nativeKeys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nativeKeys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nativeKeys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nativeKeys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nativeKeysIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nativeKeysIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nativeKeysIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nativeKeysIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nodeUtil.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nodeUtil.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_nodeUtil.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_nodeUtil.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_overArg.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_overArg.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_overArg.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_overArg.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_parent.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_parent.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_parent.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_parent.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reEscape.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reEscape.js new file mode 100644 index 00000000..7f47eda6 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reEscape.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEscape = /<%-([\s\S]+?)%>/g; + +module.exports = reEscape; diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reEvaluate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reEvaluate.js new file mode 100644 index 00000000..6adfc312 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reEvaluate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reEvaluate = /<%([\s\S]+?)%>/g; + +module.exports = reEvaluate; diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reInterpolate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reInterpolate.js new file mode 100644 index 00000000..d02ff0b2 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reInterpolate.js @@ -0,0 +1,4 @@ +/** Used to match template delimiters. */ +var reInterpolate = /<%=([\s\S]+?)%>/g; + +module.exports = reInterpolate; diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_realNames.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_realNames.js new file mode 100644 index 00000000..aa0d5292 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_realNames.js @@ -0,0 +1,4 @@ +/** Used to lookup unminified function names. */ +var realNames = {}; + +module.exports = realNames; diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_reorder.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reorder.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_reorder.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_reorder.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_replaceHolders.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_replaceHolders.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_replaceHolders.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_replaceHolders.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_root.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_root.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_root.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_root.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setCacheAdd.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setCacheAdd.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setCacheAdd.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setCacheAdd.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setCacheHas.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setCacheHas.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setCacheHas.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setCacheHas.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setData.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setData.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setData.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setData.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setToArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setToArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setToArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setToArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setToPairs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setToPairs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setToPairs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setToPairs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setWrapToString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setWrapToString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_setWrapToString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_setWrapToString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackClear.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackClear.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackClear.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackClear.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackDelete.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackDelete.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackDelete.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackDelete.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackGet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackGet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackGet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackGet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackHas.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackHas.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackHas.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackHas.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stackSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stackSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stringSize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stringSize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stringSize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stringSize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stringToArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stringToArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stringToArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stringToArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stringToPath.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stringToPath.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_stringToPath.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_stringToPath.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_toKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_toKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_toKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_toKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_toSource.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_toSource.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_toSource.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_toSource.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unescapeHtmlChar.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unescapeHtmlChar.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unescapeHtmlChar.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unescapeHtmlChar.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unicodeSize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unicodeSize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unicodeSize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unicodeSize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unicodeToArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unicodeToArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unicodeToArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unicodeToArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unicodeWords.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unicodeWords.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_unicodeWords.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_unicodeWords.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_updateWrapDetails.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_updateWrapDetails.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_updateWrapDetails.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_updateWrapDetails.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_wrapperClone.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_wrapperClone.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/_wrapperClone.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/_wrapperClone.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/add.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/add.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/add.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/add.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/after.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/after.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/after.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/after.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/array.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/array.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/array.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/array.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/ary.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/ary.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/ary.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/ary.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assign.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assign.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assign.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assign.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assignIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assignIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assignIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assignIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assignInWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assignInWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assignInWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assignInWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assignWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assignWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/assignWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/assignWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/at.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/at.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/at.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/at.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/attempt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/attempt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/attempt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/attempt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/before.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/before.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/before.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/before.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/bind.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/bind.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/bind.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/bind.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/bindAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/bindAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/bindAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/bindAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/bindKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/bindKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/bindKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/bindKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/camelCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/camelCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/camelCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/camelCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/capitalize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/capitalize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/capitalize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/capitalize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/castArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/castArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/castArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/castArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/ceil.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/ceil.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/ceil.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/ceil.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/chain.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/chain.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/chain.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/chain.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/chunk.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/chunk.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/chunk.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/chunk.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/clamp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/clamp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/clamp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/clamp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/clone.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/clone.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/clone.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/clone.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cloneDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cloneDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cloneDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cloneDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cloneDeepWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cloneDeepWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cloneDeepWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cloneDeepWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cloneWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cloneWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cloneWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cloneWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/collection.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/collection.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/collection.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/collection.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/commit.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/commit.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/commit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/commit.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/compact.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/compact.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/compact.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/compact.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/concat.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/concat.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/concat.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/concat.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cond.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cond.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/cond.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/cond.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/conforms.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/conforms.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/conforms.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/conforms.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/conformsTo.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/conformsTo.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/conformsTo.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/conformsTo.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/constant.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/constant.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/constant.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/constant.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/core.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/core.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/core.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/core.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/core.min.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/core.min.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/core.min.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/core.min.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/countBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/countBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/countBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/countBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/create.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/create.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/create.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/create.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/curry.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/curry.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/curry.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/curry.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/curryRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/curryRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/curryRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/curryRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/date.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/date.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/date.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/date.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/debounce.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/debounce.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/debounce.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/debounce.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/deburr.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/deburr.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/deburr.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/deburr.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defaultTo.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defaultTo.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defaultTo.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defaultTo.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defaults.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defaults.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defaults.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defaults.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defaultsDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defaultsDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defaultsDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defaultsDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/defer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/defer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/delay.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/delay.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/delay.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/delay.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/difference.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/difference.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/difference.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/difference.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/differenceBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/differenceBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/differenceBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/differenceBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/differenceWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/differenceWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/differenceWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/differenceWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/divide.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/divide.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/divide.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/divide.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/drop.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/drop.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/drop.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/drop.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/dropRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/dropRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/dropRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/dropRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/dropRightWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/dropRightWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/dropRightWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/dropRightWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/dropWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/dropWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/dropWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/dropWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/each.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/each.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/each.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/each.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/eachRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/eachRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/eachRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/eachRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/endsWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/endsWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/endsWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/endsWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/entries.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/entries.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/entries.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/entries.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/entriesIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/entriesIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/entriesIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/entriesIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/eq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/eq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/eq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/eq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/escape.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/escape.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/escape.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/escape.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/escapeRegExp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/escapeRegExp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/escapeRegExp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/escapeRegExp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/every.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/every.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/every.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/every.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/extend.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/extend.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/extend.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/extend.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/extendWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/extendWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/extendWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/extendWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fill.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fill.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fill.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fill.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/filter.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/filter.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/filter.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/filter.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/find.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/find.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/find.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/find.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findLast.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findLast.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findLast.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findLast.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findLastIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findLastIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findLastIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findLastIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findLastKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findLastKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/findLastKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/findLastKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/first.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/first.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/first.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/first.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatMapDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatMapDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatMapDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatMapDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatMapDepth.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatMapDepth.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatMapDepth.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatMapDepth.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatten.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatten.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flatten.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flatten.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flattenDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flattenDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flattenDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flattenDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flattenDepth.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flattenDepth.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flattenDepth.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flattenDepth.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flip.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flip.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flip.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flip.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/floor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/floor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/floor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/floor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flow.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flow.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flow.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flow.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flowRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flowRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/flowRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/flowRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forEach.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forEach.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forEach.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forEach.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forEachRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forEachRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forEachRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forEachRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forInRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forInRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forInRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forInRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forOwn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forOwn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forOwn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forOwn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forOwnRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forOwnRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/forOwnRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/forOwnRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/F.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/F.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/F.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/F.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/T.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/T.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/T.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/T.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/__.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/__.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/__.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/__.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_baseConvert.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_baseConvert.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_baseConvert.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_baseConvert.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_convertBrowser.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_convertBrowser.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_convertBrowser.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_convertBrowser.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_falseOptions.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_falseOptions.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_falseOptions.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_falseOptions.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_mapping.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_mapping.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_mapping.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_mapping.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_util.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_util.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/_util.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/_util.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/add.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/add.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/add.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/add.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/after.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/after.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/after.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/after.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/all.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/all.js new file mode 100644 index 00000000..d0839f77 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/all.js @@ -0,0 +1 @@ +module.exports = require('./every'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/allPass.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/allPass.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/allPass.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/allPass.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/always.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/always.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/always.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/always.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/any.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/any.js new file mode 100644 index 00000000..900ac25e --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/any.js @@ -0,0 +1 @@ +module.exports = require('./some'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/anyPass.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/anyPass.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/anyPass.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/anyPass.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/apply.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/apply.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/apply.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/apply.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/array.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/array.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/array.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/array.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/ary.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/ary.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/ary.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/ary.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assign.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assign.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assign.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assign.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignAllWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignAllWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignAllWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignAllWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignInAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignInAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignInAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignInAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignInAllWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignInAllWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignInAllWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignInAllWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignInWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignInWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignInWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignInWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assignWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assignWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assoc.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assoc.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assoc.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assoc.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assocPath.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assocPath.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/assocPath.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/assocPath.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/at.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/at.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/at.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/at.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/attempt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/attempt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/attempt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/attempt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/before.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/before.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/before.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/before.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/bind.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/bind.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/bind.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/bind.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/bindAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/bindAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/bindAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/bindAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/bindKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/bindKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/bindKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/bindKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/camelCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/camelCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/camelCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/camelCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/capitalize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/capitalize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/capitalize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/capitalize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/castArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/castArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/castArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/castArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/ceil.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/ceil.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/ceil.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/ceil.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/chain.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/chain.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/chain.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/chain.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/chunk.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/chunk.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/chunk.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/chunk.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/clamp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/clamp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/clamp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/clamp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/clone.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/clone.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/clone.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/clone.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cloneDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cloneDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cloneDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cloneDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cloneDeepWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cloneDeepWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cloneDeepWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cloneDeepWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cloneWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cloneWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cloneWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cloneWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/collection.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/collection.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/collection.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/collection.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/commit.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/commit.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/commit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/commit.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/compact.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/compact.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/compact.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/compact.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/complement.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/complement.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/complement.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/complement.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/compose.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/compose.js new file mode 100644 index 00000000..1954e942 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/compose.js @@ -0,0 +1 @@ +module.exports = require('./flowRight'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/concat.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/concat.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/concat.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/concat.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cond.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cond.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/cond.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/cond.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/conforms.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/conforms.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/conforms.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/conforms.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/conformsTo.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/conformsTo.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/conformsTo.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/conformsTo.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/constant.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/constant.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/constant.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/constant.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/contains.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/contains.js new file mode 100644 index 00000000..594722af --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/contains.js @@ -0,0 +1 @@ +module.exports = require('./includes'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/convert.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/convert.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/convert.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/convert.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/countBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/countBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/countBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/countBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/create.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/create.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/create.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/create.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curry.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curry.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curry.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curry.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curryN.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curryN.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curryN.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curryN.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curryRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curryRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curryRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curryRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curryRightN.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curryRightN.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/curryRightN.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/curryRightN.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/date.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/date.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/date.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/date.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/debounce.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/debounce.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/debounce.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/debounce.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/deburr.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/deburr.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/deburr.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/deburr.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultTo.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultTo.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultTo.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultTo.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaults.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaults.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaults.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaults.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultsAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultsAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultsAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultsAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultsDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultsDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultsDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultsDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultsDeepAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultsDeepAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defaultsDeepAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defaultsDeepAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/defer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/defer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/delay.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/delay.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/delay.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/delay.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/difference.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/difference.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/difference.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/difference.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/differenceBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/differenceBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/differenceBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/differenceBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/differenceWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/differenceWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/differenceWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/differenceWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dissoc.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dissoc.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dissoc.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dissoc.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dissocPath.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dissocPath.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dissocPath.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dissocPath.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/divide.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/divide.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/divide.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/divide.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/drop.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/drop.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/drop.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/drop.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropLast.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropLast.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropLast.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropLast.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropLastWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropLastWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropLastWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropLastWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropRightWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropRightWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropRightWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropRightWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/dropWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/dropWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/each.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/each.js new file mode 100644 index 00000000..8800f420 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/each.js @@ -0,0 +1 @@ +module.exports = require('./forEach'); diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/eachRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/eachRight.js new file mode 100644 index 00000000..3252b2ab --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/eachRight.js @@ -0,0 +1 @@ +module.exports = require('./forEachRight'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/endsWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/endsWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/endsWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/endsWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/entries.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/entries.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/entries.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/entries.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/entriesIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/entriesIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/entriesIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/entriesIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/eq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/eq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/eq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/eq.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/equals.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/equals.js new file mode 100644 index 00000000..e6a5ce0c --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/equals.js @@ -0,0 +1 @@ +module.exports = require('./isEqual'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/escape.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/escape.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/escape.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/escape.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/escapeRegExp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/escapeRegExp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/escapeRegExp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/escapeRegExp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/every.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/every.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/every.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/every.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extend.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extend.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extend.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extend.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extendAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extendAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extendAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extendAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extendAllWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extendAllWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extendAllWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extendAllWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extendWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extendWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/extendWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/extendWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/fill.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/fill.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/fill.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/fill.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/filter.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/filter.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/filter.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/filter.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/find.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/find.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/find.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/find.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findIndexFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findIndexFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findIndexFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findIndexFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLast.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLast.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLast.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLast.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastIndexFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastIndexFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastIndexFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastIndexFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastKey.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastKey.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/findLastKey.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/findLastKey.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/first.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/first.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/first.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/first.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatMapDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatMapDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatMapDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatMapDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatMapDepth.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatMapDepth.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatMapDepth.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatMapDepth.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatten.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatten.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flatten.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flatten.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flattenDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flattenDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flattenDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flattenDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flattenDepth.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flattenDepth.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flattenDepth.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flattenDepth.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flip.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flip.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flip.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flip.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/floor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/floor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/floor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/floor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flow.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flow.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flow.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flow.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flowRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flowRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/flowRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/flowRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forEach.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forEach.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forEach.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forEach.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forEachRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forEachRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forEachRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forEachRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forInRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forInRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forInRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forInRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forOwn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forOwn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forOwn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forOwn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forOwnRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forOwnRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/forOwnRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/forOwnRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/fromPairs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/fromPairs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/fromPairs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/fromPairs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/function.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/function.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/function.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/function.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/functions.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/functions.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/functions.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/functions.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/functionsIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/functionsIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/functionsIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/functionsIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/get.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/get.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/get.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/get.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/getOr.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/getOr.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/getOr.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/getOr.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/groupBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/groupBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/groupBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/groupBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/gt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/gt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/gt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/gt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/gte.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/gte.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/gte.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/gte.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/has.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/has.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/has.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/has.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/hasIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/hasIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/hasIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/hasIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/head.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/head.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/head.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/head.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/identical.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/identical.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/identical.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/identical.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/identity.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/identity.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/identity.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/identity.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/inRange.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/inRange.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/inRange.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/inRange.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/includes.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/includes.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/includes.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/includes.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/includesFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/includesFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/includesFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/includesFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/indexBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/indexBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/indexBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/indexBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/indexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/indexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/indexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/indexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/indexOfFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/indexOfFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/indexOfFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/indexOfFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/init.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/init.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/init.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/init.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/initial.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/initial.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/initial.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/initial.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/intersection.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/intersection.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/intersection.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/intersection.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/intersectionBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/intersectionBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/intersectionBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/intersectionBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/intersectionWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/intersectionWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/intersectionWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/intersectionWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invert.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invert.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invert.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invert.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invertBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invertBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invertBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invertBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invertObj.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invertObj.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invertObj.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invertObj.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invoke.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invoke.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invoke.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invoke.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invokeArgs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invokeArgs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invokeArgs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invokeArgs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invokeArgsMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invokeArgsMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invokeArgsMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invokeArgsMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invokeMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invokeMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/invokeMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/invokeMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArguments.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArguments.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArguments.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArguments.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArrayBuffer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArrayBuffer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArrayBuffer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArrayBuffer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArrayLike.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArrayLike.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArrayLike.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArrayLike.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArrayLikeObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArrayLikeObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isArrayLikeObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isArrayLikeObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isBoolean.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isBoolean.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isBoolean.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isBoolean.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isBuffer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isBuffer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isBuffer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isBuffer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isDate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isDate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isDate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isDate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isElement.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isElement.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isElement.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isElement.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isEmpty.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isEmpty.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isEmpty.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isEmpty.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isEqual.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isEqual.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isEqual.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isEqual.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isEqualWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isEqualWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isEqualWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isEqualWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isError.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isError.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isError.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isError.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isFinite.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isFinite.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isFinite.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isFinite.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isFunction.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isFunction.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isFunction.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isFunction.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isLength.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isLength.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isLength.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isLength.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isMatch.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isMatch.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isMatch.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isMatch.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isMatchWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isMatchWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isMatchWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isMatchWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNaN.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNaN.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNaN.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNaN.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNative.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNative.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNative.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNative.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNil.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNil.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNil.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNil.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNull.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNull.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNull.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNull.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNumber.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNumber.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isNumber.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isNumber.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isObjectLike.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isObjectLike.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isObjectLike.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isObjectLike.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isPlainObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isPlainObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isPlainObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isPlainObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isRegExp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isRegExp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isRegExp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isRegExp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isSafeInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isSafeInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isSafeInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isSafeInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isSymbol.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isSymbol.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isSymbol.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isSymbol.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isTypedArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isTypedArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isTypedArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isTypedArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isUndefined.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isUndefined.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isUndefined.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isUndefined.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isWeakMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isWeakMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isWeakMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isWeakMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isWeakSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isWeakSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/isWeakSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/isWeakSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/iteratee.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/iteratee.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/iteratee.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/iteratee.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/join.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/join.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/join.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/join.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/juxt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/juxt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/juxt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/juxt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/kebabCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/kebabCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/kebabCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/kebabCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/keyBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/keyBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/keyBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/keyBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/keys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/keys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/keys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/keys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/keysIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/keysIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/keysIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/keysIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lang.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lang.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lang.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lang.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/last.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/last.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/last.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/last.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lastIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lastIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lastIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lastIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lastIndexOfFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lastIndexOfFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lastIndexOfFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lastIndexOfFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lowerCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lowerCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lowerCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lowerCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lowerFirst.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lowerFirst.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lowerFirst.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lowerFirst.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lte.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lte.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/lte.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/lte.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/map.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/map.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/map.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/map.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mapKeys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mapKeys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mapKeys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mapKeys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mapValues.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mapValues.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mapValues.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mapValues.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/matches.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/matches.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/matches.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/matches.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/matchesProperty.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/matchesProperty.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/matchesProperty.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/matchesProperty.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/math.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/math.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/math.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/math.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/max.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/max.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/max.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/max.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/maxBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/maxBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/maxBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/maxBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mean.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mean.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mean.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mean.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/meanBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/meanBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/meanBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/meanBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/memoize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/memoize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/memoize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/memoize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/merge.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/merge.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/merge.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/merge.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mergeAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mergeAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mergeAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mergeAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mergeAllWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mergeAllWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mergeAllWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mergeAllWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mergeWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mergeWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mergeWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mergeWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/method.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/method.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/method.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/method.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/methodOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/methodOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/methodOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/methodOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/min.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/min.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/min.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/min.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/minBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/minBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/minBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/minBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mixin.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mixin.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/mixin.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/mixin.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/multiply.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/multiply.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/multiply.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/multiply.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/nAry.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/nAry.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/nAry.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/nAry.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/negate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/negate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/negate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/negate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/next.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/next.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/next.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/next.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/noop.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/noop.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/noop.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/noop.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/now.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/now.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/now.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/now.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/nth.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/nth.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/nth.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/nth.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/nthArg.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/nthArg.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/nthArg.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/nthArg.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/number.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/number.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/number.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/number.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/object.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/object.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/object.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/object.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/omit.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/omit.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/omit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/omit.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/omitAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/omitAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/omitAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/omitAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/omitBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/omitBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/omitBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/omitBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/once.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/once.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/once.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/once.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/orderBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/orderBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/orderBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/orderBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/over.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/over.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/over.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/over.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/overArgs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/overArgs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/overArgs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/overArgs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/overEvery.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/overEvery.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/overEvery.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/overEvery.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/overSome.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/overSome.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/overSome.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/overSome.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pad.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pad.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pad.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pad.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padChars.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padChars.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padChars.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padChars.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padCharsEnd.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padCharsEnd.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padCharsEnd.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padCharsEnd.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padCharsStart.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padCharsStart.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padCharsStart.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padCharsStart.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padEnd.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padEnd.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padEnd.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padEnd.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padStart.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padStart.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/padStart.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/padStart.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/parseInt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/parseInt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/parseInt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/parseInt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/partial.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/partial.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/partial.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/partial.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/partialRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/partialRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/partialRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/partialRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/partition.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/partition.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/partition.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/partition.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/path.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/path.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/path.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/path.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pathEq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pathEq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pathEq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pathEq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pathOr.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pathOr.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pathOr.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pathOr.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/paths.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/paths.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/paths.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/paths.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pick.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pick.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pick.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pick.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pickAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pickAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pickAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pickAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pickBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pickBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pickBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pickBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pipe.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pipe.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pipe.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pipe.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/placeholder.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/placeholder.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/placeholder.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/placeholder.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/plant.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/plant.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/plant.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/plant.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pluck.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pluck.js new file mode 100644 index 00000000..0d1e1abf --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pluck.js @@ -0,0 +1 @@ +module.exports = require('./map'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/prop.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/prop.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/prop.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/prop.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/propEq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/propEq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/propEq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/propEq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/propOr.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/propOr.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/propOr.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/propOr.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/property.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/property.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/property.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/property.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/propertyOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/propertyOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/propertyOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/propertyOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/props.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/props.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/props.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/props.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pull.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pull.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pull.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pull.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAllBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAllBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAllBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAllBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAllWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAllWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAllWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAllWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/pullAt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/pullAt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/random.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/random.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/random.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/random.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/range.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/range.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/range.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/range.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/rangeRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/rangeRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/rangeRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/rangeRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/rearg.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/rearg.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/rearg.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/rearg.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reduce.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reduce.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reduce.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reduce.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reduceRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reduceRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reduceRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reduceRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/remove.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/remove.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/remove.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/remove.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/repeat.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/repeat.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/repeat.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/repeat.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/replace.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/replace.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/replace.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/replace.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/rest.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/rest.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/rest.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/rest.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/restFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/restFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/restFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/restFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/result.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/result.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/result.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/result.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reverse.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reverse.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/reverse.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/reverse.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/round.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/round.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/round.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/round.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sample.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sample.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sample.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sample.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sampleSize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sampleSize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sampleSize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sampleSize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/seq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/seq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/seq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/seq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/set.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/set.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/set.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/set.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/setWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/setWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/setWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/setWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/shuffle.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/shuffle.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/shuffle.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/shuffle.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/size.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/size.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/size.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/size.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/slice.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/slice.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/slice.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/slice.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/snakeCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/snakeCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/snakeCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/snakeCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/some.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/some.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/some.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/some.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedIndexBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedIndexBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedIndexBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedIndexBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedLastIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedLastIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedLastIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedLastIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedLastIndexBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedLastIndexBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedLastIndexBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedLastIndexBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedLastIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedLastIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedLastIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedLastIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedUniq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedUniq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedUniq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedUniq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedUniqBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedUniqBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sortedUniqBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sortedUniqBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/split.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/split.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/split.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/split.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/spread.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/spread.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/spread.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/spread.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/spreadFrom.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/spreadFrom.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/spreadFrom.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/spreadFrom.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/startCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/startCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/startCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/startCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/startsWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/startsWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/startsWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/startsWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/string.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/string.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/string.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/string.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubFalse.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubFalse.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubFalse.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubFalse.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubTrue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubTrue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/stubTrue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/stubTrue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/subtract.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/subtract.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/subtract.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/subtract.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sum.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sum.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sum.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sum.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sumBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sumBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/sumBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/sumBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/symmetricDifference.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/symmetricDifference.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/symmetricDifference.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/symmetricDifference.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/symmetricDifferenceBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/symmetricDifferenceBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/symmetricDifferenceBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/symmetricDifferenceBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/symmetricDifferenceWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/symmetricDifferenceWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/symmetricDifferenceWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/symmetricDifferenceWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/tail.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/tail.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/tail.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/tail.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/take.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/take.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/take.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/take.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeLast.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeLast.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeLast.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeLast.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeLastWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeLastWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeLastWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeLastWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeRightWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeRightWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeRightWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeRightWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/takeWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/takeWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/tap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/tap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/tap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/tap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/template.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/template.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/template.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/template.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/templateSettings.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/templateSettings.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/templateSettings.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/templateSettings.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/throttle.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/throttle.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/throttle.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/throttle.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/thru.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/thru.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/thru.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/thru.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/times.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/times.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/times.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/times.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toFinite.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toFinite.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toFinite.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toFinite.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toIterator.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toIterator.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toIterator.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toIterator.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toJSON.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toJSON.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toJSON.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toJSON.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toLength.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toLength.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toLength.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toLength.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toLower.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toLower.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toLower.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toLower.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toNumber.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toNumber.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toNumber.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toNumber.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPairs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPairs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPairs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPairs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPairsIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPairsIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPairsIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPairsIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPath.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPath.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPath.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPath.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPlainObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPlainObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toPlainObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toPlainObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toSafeInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toSafeInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toSafeInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toSafeInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toUpper.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toUpper.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/toUpper.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/toUpper.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/transform.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/transform.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/transform.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/transform.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trim.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trim.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trim.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trim.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimChars.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimChars.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimChars.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimChars.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimCharsEnd.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimCharsEnd.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimCharsEnd.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimCharsEnd.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimCharsStart.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimCharsStart.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimCharsStart.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimCharsStart.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimEnd.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimEnd.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimEnd.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimEnd.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimStart.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimStart.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/trimStart.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/trimStart.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/truncate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/truncate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/truncate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/truncate.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unapply.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unapply.js new file mode 100644 index 00000000..c5dfe779 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unapply.js @@ -0,0 +1 @@ +module.exports = require('./rest'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unary.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unary.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unary.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unary.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unescape.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unescape.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unescape.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unescape.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/union.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/union.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/union.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/union.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unionBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unionBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unionBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unionBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unionWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unionWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unionWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unionWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniqBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniqBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniqBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniqBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniqWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniqWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniqWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniqWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniqueId.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniqueId.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/uniqueId.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/uniqueId.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unnest.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unnest.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unnest.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unnest.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unset.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unset.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unset.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unset.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unzip.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unzip.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unzip.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unzip.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unzipWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unzipWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/unzipWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/unzipWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/update.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/update.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/update.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/update.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/updateWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/updateWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/updateWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/updateWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/upperCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/upperCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/upperCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/upperCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/upperFirst.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/upperFirst.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/upperFirst.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/upperFirst.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/useWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/useWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/useWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/useWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/util.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/util.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/util.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/util.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/value.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/value.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/value.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/value.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/valueOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/valueOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/valueOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/valueOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/values.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/values.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/values.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/values.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/valuesIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/valuesIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/valuesIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/valuesIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/where.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/where.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/where.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/where.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/whereEq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/whereEq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/whereEq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/whereEq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/without.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/without.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/without.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/without.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/words.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/words.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/words.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/words.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperAt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperAt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperAt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperAt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperChain.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperChain.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperChain.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperChain.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperLodash.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperLodash.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperLodash.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperLodash.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperReverse.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperReverse.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperReverse.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperReverse.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperValue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperValue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/wrapperValue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/wrapperValue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/xor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/xor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/xor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/xor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/xorBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/xorBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/xorBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/xorBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/xorWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/xorWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/xorWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/xorWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zip.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zip.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zip.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zip.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipObj.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipObj.js new file mode 100644 index 00000000..f4a34531 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipObj.js @@ -0,0 +1 @@ +module.exports = require('./zipObject'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipObjectDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipObjectDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipObjectDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipObjectDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fp/zipWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fp/zipWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fromPairs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fromPairs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/fromPairs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/fromPairs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/function.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/function.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/function.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/function.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/functions.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/functions.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/functions.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/functions.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/functionsIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/functionsIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/functionsIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/functionsIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/get.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/get.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/get.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/get.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/groupBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/groupBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/groupBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/groupBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/gt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/gt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/gt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/gt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/gte.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/gte.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/gte.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/gte.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/has.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/has.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/has.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/has.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/hasIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/hasIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/hasIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/hasIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/head.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/head.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/head.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/head.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/identity.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/identity.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/identity.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/identity.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/inRange.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/inRange.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/inRange.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/inRange.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/includes.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/includes.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/includes.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/includes.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/index.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/index.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/index.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/index.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/indexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/indexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/indexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/indexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/initial.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/initial.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/initial.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/initial.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/intersection.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/intersection.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/intersection.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/intersection.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/intersectionBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/intersectionBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/intersectionBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/intersectionBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/intersectionWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/intersectionWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/intersectionWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/intersectionWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invert.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invert.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invert.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invert.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invertBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invertBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invertBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invertBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invoke.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invoke.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invoke.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invoke.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invokeMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invokeMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/invokeMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/invokeMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArguments.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArguments.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArguments.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArguments.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArrayBuffer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArrayBuffer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArrayBuffer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArrayBuffer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArrayLike.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArrayLike.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArrayLike.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArrayLike.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArrayLikeObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArrayLikeObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isArrayLikeObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isArrayLikeObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isBoolean.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isBoolean.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isBoolean.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isBoolean.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isBuffer.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isBuffer.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isBuffer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isBuffer.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isDate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isDate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isDate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isDate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isElement.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isElement.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isElement.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isElement.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isEmpty.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isEmpty.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isEmpty.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isEmpty.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isEqual.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isEqual.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isEqual.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isEqual.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isEqualWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isEqualWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isEqualWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isEqualWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isError.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isError.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isError.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isError.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isFinite.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isFinite.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isFinite.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isFinite.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isFunction.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isFunction.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isFunction.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isFunction.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isLength.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isLength.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isLength.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isLength.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isMatch.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isMatch.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isMatch.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isMatch.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isMatchWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isMatchWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isMatchWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isMatchWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNaN.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNaN.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNaN.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNaN.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNative.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNative.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNative.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNative.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNil.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNil.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNil.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNil.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNull.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNull.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNull.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNull.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNumber.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNumber.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isNumber.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isNumber.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isObjectLike.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isObjectLike.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isObjectLike.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isObjectLike.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isPlainObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isPlainObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isPlainObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isPlainObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isRegExp.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isRegExp.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isRegExp.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isRegExp.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isSafeInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isSafeInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isSafeInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isSafeInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isSymbol.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isSymbol.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isSymbol.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isSymbol.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isTypedArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isTypedArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isTypedArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isTypedArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isUndefined.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isUndefined.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isUndefined.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isUndefined.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isWeakMap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isWeakMap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isWeakMap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isWeakMap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isWeakSet.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isWeakSet.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/isWeakSet.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/isWeakSet.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/iteratee.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/iteratee.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/iteratee.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/iteratee.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/join.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/join.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/join.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/join.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/kebabCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/kebabCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/kebabCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/kebabCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/keyBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/keyBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/keyBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/keyBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/keys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/keys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/keys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/keys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/keysIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/keysIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/keysIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/keysIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lang.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lang.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lang.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lang.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/last.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/last.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/last.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/last.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lastIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lastIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lastIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lastIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lodash.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lodash.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lodash.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lodash.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lodash.min.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lodash.min.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lodash.min.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lodash.min.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lowerCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lowerCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lowerCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lowerCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lowerFirst.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lowerFirst.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lowerFirst.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lowerFirst.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lte.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lte.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/lte.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/lte.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/map.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/map.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/map.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/map.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mapKeys.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mapKeys.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mapKeys.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mapKeys.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mapValues.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mapValues.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mapValues.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mapValues.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/matches.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/matches.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/matches.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/matches.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/matchesProperty.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/matchesProperty.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/matchesProperty.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/matchesProperty.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/math.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/math.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/math.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/math.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/max.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/max.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/max.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/max.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/maxBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/maxBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/maxBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/maxBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mean.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mean.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mean.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mean.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/meanBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/meanBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/meanBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/meanBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/memoize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/memoize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/memoize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/memoize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/merge.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/merge.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/merge.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/merge.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mergeWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mergeWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mergeWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mergeWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/method.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/method.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/method.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/method.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/methodOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/methodOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/methodOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/methodOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/min.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/min.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/min.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/min.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/minBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/minBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/minBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/minBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mixin.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mixin.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/mixin.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/mixin.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/multiply.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/multiply.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/multiply.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/multiply.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/negate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/negate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/negate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/negate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/next.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/next.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/next.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/next.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/noop.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/noop.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/noop.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/noop.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/now.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/now.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/now.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/now.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/nth.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/nth.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/nth.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/nth.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/nthArg.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/nthArg.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/nthArg.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/nthArg.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/number.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/number.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/number.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/number.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/object.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/object.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/object.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/object.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/omit.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/omit.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/omit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/omit.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/omitBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/omitBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/omitBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/omitBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/once.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/once.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/once.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/once.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/orderBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/orderBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/orderBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/orderBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/over.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/over.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/over.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/over.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/overArgs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/overArgs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/overArgs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/overArgs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/overEvery.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/overEvery.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/overEvery.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/overEvery.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/overSome.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/overSome.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/overSome.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/overSome.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/package.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/package.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/package.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/package.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pad.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pad.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pad.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pad.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/padEnd.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/padEnd.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/padEnd.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/padEnd.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/padStart.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/padStart.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/padStart.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/padStart.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/parseInt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/parseInt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/parseInt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/parseInt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/partial.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/partial.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/partial.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/partial.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/partialRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/partialRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/partialRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/partialRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/partition.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/partition.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/partition.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/partition.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pick.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pick.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pick.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pick.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pickBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pickBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pickBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pickBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/plant.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/plant.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/plant.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/plant.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/property.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/property.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/property.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/property.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/propertyOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/propertyOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/propertyOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/propertyOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pull.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pull.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pull.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pull.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAll.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAll.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAll.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAll.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAllBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAllBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAllBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAllBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAllWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAllWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAllWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAllWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/pullAt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/pullAt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/random.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/random.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/random.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/random.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/range.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/range.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/range.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/range.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/rangeRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/rangeRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/rangeRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/rangeRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/rearg.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/rearg.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/rearg.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/rearg.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reduce.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reduce.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reduce.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reduce.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reduceRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reduceRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reduceRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reduceRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/remove.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/remove.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/remove.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/remove.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/repeat.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/repeat.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/repeat.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/repeat.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/replace.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/replace.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/replace.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/replace.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/rest.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/rest.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/rest.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/rest.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/result.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/result.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/result.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/result.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reverse.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reverse.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/reverse.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/reverse.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/round.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/round.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/round.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/round.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sample.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sample.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sample.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sample.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sampleSize.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sampleSize.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sampleSize.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sampleSize.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/seq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/seq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/seq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/seq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/set.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/set.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/set.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/set.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/setWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/setWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/setWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/setWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/shuffle.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/shuffle.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/shuffle.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/shuffle.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/size.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/size.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/size.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/size.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/slice.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/slice.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/slice.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/slice.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/snakeCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/snakeCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/snakeCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/snakeCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/some.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/some.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/some.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/some.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedIndexBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedIndexBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedIndexBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedIndexBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedLastIndex.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedLastIndex.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedLastIndex.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedLastIndex.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedLastIndexBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedLastIndexBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedLastIndexBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedLastIndexBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedLastIndexOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedLastIndexOf.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedLastIndexOf.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedLastIndexOf.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedUniq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedUniq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedUniq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedUniq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedUniqBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedUniqBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sortedUniqBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sortedUniqBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/split.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/split.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/split.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/split.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/spread.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/spread.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/spread.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/spread.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/startCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/startCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/startCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/startCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/startsWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/startsWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/startsWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/startsWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/string.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/string.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/string.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/string.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubFalse.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubFalse.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubFalse.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubFalse.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubTrue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubTrue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/stubTrue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/stubTrue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/subtract.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/subtract.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/subtract.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/subtract.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sum.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sum.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sum.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sum.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sumBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sumBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/sumBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/sumBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/tail.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/tail.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/tail.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/tail.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/take.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/take.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/take.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/take.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/takeRight.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/takeRight.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/takeRight.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/takeRight.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/takeRightWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/takeRightWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/takeRightWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/takeRightWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/takeWhile.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/takeWhile.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/takeWhile.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/takeWhile.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/tap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/tap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/tap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/tap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/template.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/template.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/template.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/template.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/templateSettings.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/templateSettings.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/templateSettings.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/templateSettings.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/throttle.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/throttle.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/throttle.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/throttle.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/thru.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/thru.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/thru.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/thru.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/times.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/times.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/times.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/times.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toArray.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toArray.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toArray.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toArray.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toFinite.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toFinite.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toFinite.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toFinite.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toIterator.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toIterator.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toIterator.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toIterator.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toJSON.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toJSON.js new file mode 100644 index 00000000..5e751a2c --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toJSON.js @@ -0,0 +1 @@ +module.exports = require('./wrapperValue'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toLength.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toLength.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toLength.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toLength.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toLower.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toLower.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toLower.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toLower.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toNumber.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toNumber.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toNumber.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toNumber.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPairs.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPairs.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPairs.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPairs.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPairsIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPairsIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPairsIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPairsIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPath.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPath.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPath.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPath.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPlainObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPlainObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toPlainObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toPlainObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toSafeInteger.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toSafeInteger.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toSafeInteger.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toSafeInteger.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toString.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toUpper.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toUpper.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/toUpper.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/toUpper.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/transform.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/transform.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/transform.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/transform.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/trim.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/trim.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/trim.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/trim.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/trimEnd.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/trimEnd.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/trimEnd.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/trimEnd.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/trimStart.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/trimStart.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/trimStart.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/trimStart.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/truncate.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/truncate.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/truncate.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/truncate.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unary.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unary.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unary.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unary.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unescape.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unescape.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unescape.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unescape.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/union.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/union.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/union.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/union.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unionBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unionBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unionBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unionBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unionWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unionWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unionWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unionWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniq.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniq.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniq.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniq.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniqBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniqBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniqBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniqBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniqWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniqWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniqWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniqWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniqueId.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniqueId.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/uniqueId.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/uniqueId.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unset.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unset.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unset.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unset.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unzip.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unzip.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unzip.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unzip.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unzipWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unzipWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/unzipWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/unzipWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/update.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/update.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/update.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/update.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/updateWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/updateWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/updateWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/updateWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/upperCase.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/upperCase.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/upperCase.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/upperCase.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/upperFirst.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/upperFirst.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/upperFirst.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/upperFirst.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/util.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/util.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/util.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/util.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/value.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/value.js new file mode 100644 index 00000000..5e751a2c --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/value.js @@ -0,0 +1 @@ +module.exports = require('./wrapperValue'); diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/valueOf.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/valueOf.js new file mode 100644 index 00000000..5e751a2c --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/valueOf.js @@ -0,0 +1 @@ +module.exports = require('./wrapperValue'); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/values.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/values.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/values.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/values.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/valuesIn.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/valuesIn.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/valuesIn.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/valuesIn.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/without.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/without.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/without.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/without.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/words.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/words.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/words.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/words.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrap.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrap.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrap.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrap.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperAt.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperAt.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperAt.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperAt.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperChain.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperChain.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperChain.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperChain.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperLodash.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperLodash.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperLodash.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperLodash.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperReverse.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperReverse.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperReverse.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperReverse.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperValue.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperValue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/wrapperValue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/wrapperValue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/xor.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/xor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/xor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/xor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/xorBy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/xorBy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/xorBy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/xorBy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/xorWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/xorWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/xorWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/xorWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zip.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zip.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zip.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zip.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zipObject.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zipObject.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zipObject.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zipObject.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zipObjectDeep.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zipObjectDeep.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zipObjectDeep.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zipObjectDeep.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zipWith.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zipWith.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/lodash/zipWith.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/lodash/zipWith.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/.npmignore b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/.npmignore similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/.npmignore rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/.npmignore diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/LICENSE b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/LICENSE similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/LICENSE rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/LICENSE diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/Makefile b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/Makefile similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/Makefile rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/Makefile diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/README.md b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/README.md similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/README.md rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/README.md diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/create-pipes.coffee b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/create-pipes.coffee similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/create-pipes.coffee rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/create-pipes.coffee diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/proxy.coffee b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/proxy.coffee similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/proxy.coffee rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/proxy.coffee diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/read-pipes.coffee b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/read-pipes.coffee similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/read-pipes.coffee rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/read-pipes.coffee diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/timeout.coffee b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/timeout.coffee similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/lib/timeout.coffee rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/lib/timeout.coffee diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/sync-exec.coffee b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/sync-exec.coffee similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/coffee/sync-exec.coffee rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/coffee/sync-exec.coffee diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/create-pipes.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/create-pipes.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/create-pipes.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/create-pipes.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/proxy.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/proxy.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/proxy.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/proxy.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/read-pipes.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/read-pipes.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/read-pipes.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/read-pipes.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/timeout.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/timeout.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/lib/timeout.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/lib/timeout.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/sync-exec.js b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/sync-exec.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/js/sync-exec.js rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/js/sync-exec.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/package.json b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/package.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/package.json rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/package.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/test/example.coffee b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/test/example.coffee similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/test/example.coffee rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/test/example.coffee diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/test/sh/err.sh b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/test/sh/err.sh similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/test/sh/err.sh rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/test/sh/err.sh diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/test/sh/out.sh b/.vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/test/sh/out.sh similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/node_modules/sync-exec/test/sh/out.sh rename to .vscode/extensions/vscodevim.vim-0.2.0/node_modules/sync-exec/test/sh/out.sh diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/extension.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/extension.js similarity index 95% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/extension.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/extension.js index 49337bd6..21c01038 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/extension.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/extension.js @@ -105,9 +105,6 @@ function activate(context) { }, 0); }); registerCommand(context, 'type', (args) => __awaiter(this, void 0, void 0, function* () { - if (!vscode.window.activeTextEditor) { - return; - } taskQueue.enqueueTask({ promise: () => __awaiter(this, void 0, void 0, function* () { const mh = yield getAndUpdateModeHandler(); @@ -122,9 +119,6 @@ function activate(context) { }); })); registerCommand(context, 'replacePreviousChar', (args) => __awaiter(this, void 0, void 0, function* () { - if (!vscode.window.activeTextEditor) { - return; - } taskQueue.enqueueTask({ promise: () => __awaiter(this, void 0, void 0, function* () { const mh = yield getAndUpdateModeHandler(); @@ -144,9 +138,6 @@ function activate(context) { }); })); registerCommand(context, 'compositionStart', (args) => __awaiter(this, void 0, void 0, function* () { - if (!vscode.window.activeTextEditor) { - return; - } taskQueue.enqueueTask({ promise: () => __awaiter(this, void 0, void 0, function* () { const mh = yield getAndUpdateModeHandler(); @@ -156,9 +147,6 @@ function activate(context) { }); })); registerCommand(context, 'compositionEnd', (args) => __awaiter(this, void 0, void 0, function* () { - if (!vscode.window.activeTextEditor) { - return; - } taskQueue.enqueueTask({ promise: () => __awaiter(this, void 0, void 0, function* () { const mh = yield getAndUpdateModeHandler(); @@ -185,7 +173,16 @@ function activate(context) { } exports.activate = activate; function registerCommand(context, command, callback) { - let disposable = vscode.commands.registerCommand(command, callback); + let disposable = vscode.commands.registerCommand(command, (args) => __awaiter(this, void 0, void 0, function* () { + if (!vscode.window.activeTextEditor) { + return; + } + if (vscode.window.activeTextEditor.document && vscode.window.activeTextEditor.document.uri.toString() === "debug:input") { + yield vscode.commands.executeCommand("default:" + command, args); + return; + } + callback(args); + })); context.subscriptions.push(disposable); } function handleKeyEvent(key) { diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/actions/actions.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/actions/actions.js similarity index 88% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/actions/actions.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/actions/actions.js index 032bc147..f7ec2295 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/actions/actions.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/actions/actions.js @@ -386,6 +386,46 @@ let CommandRegister = class CommandRegister extends BaseCommand { CommandRegister = __decorate([ RegisterAction ], CommandRegister); +let CommandInsertRegisterContent = class CommandInsertRegisterContent extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert]; + this.keys = ["ctrl+r", ""]; + this.isCompleteAction = false; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + vimState.recordedState.registerName = this.keysPressed[1]; + const register = yield register_1.Register.get(vimState); + let text; + if (register.text instanceof Array) { + text = register.text.join("\n"); + } + else { + text = register.text; + } + if (register.registerMode === register_1.RegisterMode.LineWise) { + text += "\n"; + } + yield textEditor_1.TextEditor.insertAt(text, position); + vimState.currentMode = mode_1.ModeName.Insert; + vimState.cursorStartPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + vimState.cursorPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + return vimState; + }); + } + doesActionApply(vimState, keysPressed) { + const register = keysPressed[1]; + return super.doesActionApply(vimState, keysPressed) && register_1.Register.isValidRegister(register); + } + couldActionApply(vimState, keysPressed) { + const register = keysPressed[1]; + return super.couldActionApply(vimState, keysPressed) && register_1.Register.isValidRegister(register); + } +}; +CommandInsertRegisterContent = __decorate([ + RegisterAction +], CommandInsertRegisterContent); let CommandEsc = class CommandEsc extends BaseCommand { constructor(...args) { super(...args); @@ -395,8 +435,7 @@ let CommandEsc = class CommandEsc extends BaseCommand { mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlockInsertMode, mode_1.ModeName.VisualBlock, - mode_1.ModeName.SearchInProgressMode, - mode_1.ModeName.Replace + mode_1.ModeName.SearchInProgressMode ]; this.keys = [""]; } @@ -419,6 +458,29 @@ let CommandEsc = class CommandEsc extends BaseCommand { CommandEsc = __decorate([ RegisterAction ], CommandEsc); +let CommandEscReplaceMode = class CommandEscReplaceMode extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Replace]; + this.keys = [""]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + const timesToRepeat = vimState.replaceState.timesToRepeat; + for (let i = 1; i < timesToRepeat; i++) { + yield textEditor_1.TextEditor.insert(vimState.replaceState.newChars.join(""), position); + position = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + } + vimState.cursorStartPosition = position.getLeft(); + vimState.cursorPosition = position.getLeft(); + vimState.currentMode = mode_1.ModeName.Normal; + return vimState; + }); + } +}; +CommandEscReplaceMode = __decorate([ + RegisterAction +], CommandEscReplaceMode); let CommandCtrlOpenBracket = class CommandCtrlOpenBracket extends CommandEsc { constructor(...args) { super(...args); @@ -446,38 +508,215 @@ let CommandCtrlW = class CommandCtrlW extends BaseCommand { CommandCtrlW = __decorate([ RegisterAction ], CommandCtrlW); -let CommandCtrlE = class CommandCtrlE extends BaseCommand { +class CommandEditorScroll extends BaseCommand { constructor(...args) { super(...args); this.modes = [mode_1.ModeName.Normal]; + this.canBePrefixedWithCount = true; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + vimState.postponedCodeViewChanges.push({ + command: "editorScroll", + args: { + to: this.to, + by: this.by, + value: 1, + revealCursor: true + } + }); + return vimState; + }); + } + execCount(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + let timesToRepeat = this.canBePrefixedWithCount ? vimState.recordedState.count || 1 : 1; + vimState.postponedCodeViewChanges.push({ + command: "editorScroll", + args: { + to: this.to, + by: this.by, + value: timesToRepeat, + revealCursor: true + } + }); + return vimState; + }); + } +} +let CommandInsertBelowChar = class CommandInsertBelowChar extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert]; this.keys = [""]; } exec(position, vimState) { return __awaiter(this, void 0, void 0, function* () { - yield vscode.commands.executeCommand("scrollLineDown"); + if (textEditor_1.TextEditor.isLastLine(position)) { + return vimState; + } + const charBelowCursorPosition = position.getDownByCount(1); + if (charBelowCursorPosition.isLineEnd()) { + return vimState; + } + const char = textEditor_1.TextEditor.getText(new vscode.Range(charBelowCursorPosition, charBelowCursorPosition.getRight())); + yield textEditor_1.TextEditor.insert(char, position); + vimState.cursorStartPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + vimState.cursorPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); return vimState; }); } }; +CommandInsertBelowChar = __decorate([ + RegisterAction +], CommandInsertBelowChar); +let CommandInsertIndentInCurrentLine = class CommandInsertIndentInCurrentLine extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert]; + this.keys = [""]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + const originalText = textEditor_1.TextEditor.getLineAt(position).text; + const indentationWidth = textEditor_1.TextEditor.getIndentationLevel(originalText); + const tabSize = configuration_1.Configuration.getInstance().tabstop; + const newIndentationWidth = (indentationWidth / tabSize + 1) * tabSize; + yield textEditor_1.TextEditor.replace(new vscode.Range(position.getLineBegin(), position.getLineEnd()), textEditor_1.TextEditor.setIndentationLevel(originalText, newIndentationWidth)); + const cursorPosition = position_1.Position.FromVSCodePosition(position.with(position.line, position.character + (newIndentationWidth - indentationWidth) / tabSize)); + vimState.cursorPosition = cursorPosition; + vimState.cursorStartPosition = cursorPosition; + vimState.currentMode = mode_1.ModeName.Insert; + return vimState; + }); + } +}; +CommandInsertIndentInCurrentLine = __decorate([ + RegisterAction +], CommandInsertIndentInCurrentLine); +let CommandDeleteIndentInCurrentLine = class CommandDeleteIndentInCurrentLine extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert]; + this.keys = [""]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + const originalText = textEditor_1.TextEditor.getLineAt(position).text; + const indentationWidth = textEditor_1.TextEditor.getIndentationLevel(originalText); + if (indentationWidth === 0) { + return vimState; + } + const tabSize = configuration_1.Configuration.getInstance().tabstop; + const newIndentationWidth = (indentationWidth / tabSize - 1) * tabSize; + yield textEditor_1.TextEditor.replace(new vscode.Range(position.getLineBegin(), position.getLineEnd()), textEditor_1.TextEditor.setIndentationLevel(originalText, newIndentationWidth < 0 ? 0 : newIndentationWidth)); + const cursorPosition = position_1.Position.FromVSCodePosition(position.with(position.line, position.character + (newIndentationWidth - indentationWidth) / tabSize)); + vimState.cursorPosition = cursorPosition; + vimState.cursorStartPosition = cursorPosition; + vimState.currentMode = mode_1.ModeName.Insert; + return vimState; + }); + } +}; +CommandDeleteIndentInCurrentLine = __decorate([ + RegisterAction +], CommandDeleteIndentInCurrentLine); +let CommandCtrlE = class CommandCtrlE extends CommandEditorScroll { + constructor(...args) { + super(...args); + this.keys = [""]; + this.to = "down"; + this.by = "line"; + } +}; CommandCtrlE = __decorate([ RegisterAction ], CommandCtrlE); -let CommandCtrlY = class CommandCtrlY extends BaseCommand { +let CommandCtrlY = class CommandCtrlY extends CommandEditorScroll { constructor(...args) { super(...args); - this.modes = [mode_1.ModeName.Normal]; this.keys = [""]; - } - exec(position, vimState) { - return __awaiter(this, void 0, void 0, function* () { - yield vscode.commands.executeCommand("scrollLineUp"); - return vimState; - }); + this.to = "up"; + this.by = "line"; } }; CommandCtrlY = __decorate([ RegisterAction ], CommandCtrlY); +let CommandMoveFullPageUp = class CommandMoveFullPageUp extends CommandEditorScroll { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlock]; + this.keys = [""]; + this.to = "up"; + this.by = "page"; + } +}; +CommandMoveFullPageUp = __decorate([ + RegisterAction +], CommandMoveFullPageUp); +let CommandMoveFullPageDown = class CommandMoveFullPageDown extends CommandEditorScroll { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlock]; + this.keys = [""]; + this.to = "down"; + this.by = "page"; + } +}; +CommandMoveFullPageDown = __decorate([ + RegisterAction +], CommandMoveFullPageDown); +let CommandMoveHalfPageDown = class CommandMoveHalfPageDown extends CommandEditorScroll { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlock]; + this.keys = [""]; + this.to = "down"; + this.by = "halfPage"; + } +}; +CommandMoveHalfPageDown = __decorate([ + RegisterAction +], CommandMoveHalfPageDown); +let CommandMoveHalfPageUp = class CommandMoveHalfPageUp extends CommandEditorScroll { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlock]; + this.keys = [""]; + this.to = "up"; + this.by = "halfPage"; + } +}; +CommandMoveHalfPageUp = __decorate([ + RegisterAction +], CommandMoveHalfPageUp); +let CommandInsertAboveChar = class CommandInsertAboveChar extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert]; + this.keys = ["ctrl+y"]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + if (textEditor_1.TextEditor.isFirstLine(position)) { + return vimState; + } + const charAboveCursorPosition = position.getUpByCount(1); + if (charAboveCursorPosition.isLineEnd()) { + return vimState; + } + const char = textEditor_1.TextEditor.getText(new vscode.Range(charAboveCursorPosition, charAboveCursorPosition.getRight())); + yield textEditor_1.TextEditor.insert(char, position); + vimState.cursorStartPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + vimState.cursorPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + return vimState; + }); + } +}; +CommandInsertAboveChar = __decorate([ + RegisterAction +], CommandInsertAboveChar); let CommandCtrlC = class CommandCtrlC extends CommandEsc { constructor(...args) { super(...args); @@ -504,12 +743,12 @@ let CommandInsertAtCursor = class CommandInsertAtCursor extends BaseCommand { CommandInsertAtCursor = __decorate([ RegisterAction ], CommandInsertAtCursor); -let CommandReplacecAtCursor = class CommandReplacecAtCursor extends BaseCommand { +let CommandReplaceAtCursor = class CommandReplaceAtCursor extends BaseCommand { constructor(...args) { super(...args); this.modes = [mode_1.ModeName.Normal]; this.keys = ["R"]; - this.mustBeFirstKey = true; + this.canBePrefixedWithCount = true; } exec(position, vimState) { return __awaiter(this, void 0, void 0, function* () { @@ -518,10 +757,18 @@ let CommandReplacecAtCursor = class CommandReplacecAtCursor extends BaseCommand return vimState; }); } + execCount(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + let timesToRepeat = this.canBePrefixedWithCount ? vimState.recordedState.count || 1 : 1; + vimState.currentMode = mode_1.ModeName.Replace; + vimState.replaceState = new modeHandler_1.ReplaceState(position, timesToRepeat); + return vimState; + }); + } }; -CommandReplacecAtCursor = __decorate([ +CommandReplaceAtCursor = __decorate([ RegisterAction -], CommandReplacecAtCursor); +], CommandReplaceAtCursor); let CommandReplaceInReplaceMode = class CommandReplaceInReplaceMode extends BaseCommand { constructor(...args) { super(...args); @@ -550,12 +797,14 @@ let CommandReplaceInReplaceMode = class CommandReplaceInReplaceMode extends Base vimState.cursorPosition = leftPosition; vimState.cursorStartPosition = leftPosition; } + replaceState.newChars.pop(); } else { if (!position.isLineEnd()) { vimState = yield new DeleteOperator().run(vimState, position, position); } yield textEditor_1.TextEditor.insertAt(char, position); + replaceState.newChars.push(char); vimState.cursorStartPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); vimState.cursorPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); } @@ -802,6 +1051,44 @@ let CommandInsertInInsertMode = class CommandInsertInInsertMode extends BaseComm CommandInsertInInsertMode = __decorate([ RegisterAction ], CommandInsertInInsertMode); +let CommandCtrlHInInsertMode = class CommandCtrlHInInsertMode extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert]; + this.keys = ["ctrl+h"]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + const newPosition = yield textEditor_1.TextEditor.backspace(position); + vimState.cursorPosition = newPosition; + vimState.cursorStartPosition = newPosition; + return vimState; + }); + } +}; +CommandCtrlHInInsertMode = __decorate([ + RegisterAction +], CommandCtrlHInInsertMode); +let CommandCtrlUInInsertMode = class CommandCtrlUInInsertMode extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert]; + this.keys = ["ctrl+u"]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + const start = position.getLineBegin(); + const stop = position.getLineEnd(); + yield textEditor_1.TextEditor.delete(new vscode.Range(start, stop)); + vimState.cursorPosition = start; + vimState.cursorStartPosition = start; + return vimState; + }); + } +}; +CommandCtrlUInInsertMode = __decorate([ + RegisterAction +], CommandCtrlUInInsertMode); let CommandSearchForwards = class CommandSearchForwards extends BaseCommand { constructor(...args) { super(...args); @@ -902,7 +1189,8 @@ let DeleteOperator = class DeleteOperator extends BaseOperator { } let text = vscode.window.activeTextEditor.document.getText(new vscode.Range(start, end)); if (registerMode === register_1.RegisterMode.LineWise) { - text = text.slice(0, -1); // slice final newline in linewise mode - linewise put will add it back. + // slice final newline in linewise mode - linewise put will add it back. + text = text.endsWith("\r\n") ? text.slice(0, -2) : text.slice(0, -1); } if (yank) { register_1.Register.put(text, vimState); @@ -972,6 +1260,10 @@ let YankOperator = class YankOperator extends BaseOperator { end = tmp; end = new position_1.Position(end.line, end.character + 1); } + if (vimState.currentRegisterMode === register_1.RegisterMode.LineWise) { + start = start.getLineBegin(); + end = end.getLineEnd(); + } let text = textEditor_1.TextEditor.getText(new vscode.Range(start, end)); // If we selected the newline character, add it as well. if (vimState.currentMode === mode_1.ModeName.Visual && @@ -1485,7 +1777,7 @@ exports.PutBeforeWithIndentCommand = PutBeforeWithIndentCommand; let CommandShowCommandLine = class CommandShowCommandLine extends BaseCommand { constructor(...args) { super(...args); - this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine]; + this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlock]; this.keys = [":"]; } exec(position, vimState) { @@ -1627,6 +1919,50 @@ let CommandCenterScroll = class CommandCenterScroll extends BaseCommand { CommandCenterScroll = __decorate([ RegisterAction ], CommandCenterScroll); +let CommandTopScroll = class CommandTopScroll extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Normal]; + this.keys = ["z", "t"]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + vimState.postponedCodeViewChanges.push({ + command: "revealLine", + args: { + lineNumber: position.line, + at: "top" + } + }); + return vimState; + }); + } +}; +CommandTopScroll = __decorate([ + RegisterAction +], CommandTopScroll); +let CommandBottomScroll = class CommandBottomScroll extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Normal]; + this.keys = ["z", "b"]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + vimState.postponedCodeViewChanges.push({ + command: "revealLine", + args: { + lineNumber: position.line, + at: "bottom" + } + }); + return vimState; + }); + } +}; +CommandBottomScroll = __decorate([ + RegisterAction +], CommandBottomScroll); let CommandGoToOtherEndOfHighlightedText = class CommandGoToOtherEndOfHighlightedText extends BaseCommand { constructor(...args) { super(...args); @@ -1684,71 +2020,12 @@ let CommandRedo = class CommandRedo extends BaseCommand { CommandRedo = __decorate([ RegisterAction ], CommandRedo); -let CommandMoveFullPageDown = class CommandMoveFullPageDown extends BaseCommand { - constructor(...args) { - super(...args); - this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlock]; - this.keys = [""]; - } - exec(position, vimState) { - return __awaiter(this, void 0, void 0, function* () { - yield vscode.commands.executeCommand("cursorPageDown"); - return vimState; - }); - } -}; -CommandMoveFullPageDown = __decorate([ - RegisterAction -], CommandMoveFullPageDown); -let CommandMoveFullPageUp = class CommandMoveFullPageUp extends BaseCommand { - constructor(...args) { - super(...args); - this.modes = [mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine, mode_1.ModeName.VisualBlock]; - this.keys = [""]; - } - exec(position, vimState) { - return __awaiter(this, void 0, void 0, function* () { - yield vscode.commands.executeCommand("cursorPageUp"); - return vimState; - }); - } -}; -CommandMoveFullPageUp = __decorate([ - RegisterAction -], CommandMoveFullPageUp); -let CommandMoveHalfPageDown = class CommandMoveHalfPageDown extends BaseMovement { - constructor(...args) { - super(...args); - this.keys = [""]; - } - execAction(position, vimState) { - return __awaiter(this, void 0, void 0, function* () { - return new position_1.Position(Math.min(textEditor_1.TextEditor.getLineCount() - 1, position.line + configuration_1.Configuration.getInstance().scroll), position.character); - }); - } -}; -CommandMoveHalfPageDown = __decorate([ - RegisterAction -], CommandMoveHalfPageDown); -let CommandMoveHalfPageUp = class CommandMoveHalfPageUp extends BaseMovement { - constructor(...args) { - super(...args); - this.keys = [""]; - } - execAction(position, vimState) { - return __awaiter(this, void 0, void 0, function* () { - return new position_1.Position(Math.max(0, position.line - configuration_1.Configuration.getInstance().scroll), position.character); - }); - } -}; -CommandMoveHalfPageUp = __decorate([ - RegisterAction -], CommandMoveHalfPageUp); let CommandDeleteToLineEnd = class CommandDeleteToLineEnd extends BaseCommand { constructor(...args) { super(...args); this.modes = [mode_1.ModeName.Normal]; this.keys = ["D"]; + this.canBeRepeatedWithDot = true; } exec(position, vimState) { return __awaiter(this, void 0, void 0, function* () { @@ -2183,8 +2460,10 @@ let MoveToRightPane = class MoveToRightPane extends BaseCommand { } exec(position, vimState) { return __awaiter(this, void 0, void 0, function* () { - vimState.focusChanged = true; - yield vscode.commands.executeCommand("workbench.action.focusNextGroup"); + vimState.postponedCodeViewChanges.push({ + command: "workbench.action.focusNextGroup", + args: {} + }); return vimState; }); } @@ -2200,8 +2479,10 @@ let MoveToLeftPane = class MoveToLeftPane extends BaseCommand { } exec(position, vimState) { return __awaiter(this, void 0, void 0, function* () { - vimState.focusChanged = true; - yield vscode.commands.executeCommand("workbench.action.focusPreviousGroup"); + vimState.postponedCodeViewChanges.push({ + command: "workbench.action.focusPreviousGroup", + args: {} + }); return vimState; }); } @@ -2234,6 +2515,15 @@ let CommandTabNext = class CommandTabNext extends BaseTabCommand { CommandTabNext = __decorate([ RegisterAction ], CommandTabNext); +let CommandCtrlPagedown = class CommandCtrlPagedown extends CommandTabNext { + constructor(...args) { + super(...args); + this.keys = [""]; + } +}; +CommandCtrlPagedown = __decorate([ + RegisterAction +], CommandCtrlPagedown); let CommandTabPrevious = class CommandTabPrevious extends BaseTabCommand { constructor(...args) { super(...args); @@ -2252,6 +2542,15 @@ let CommandTabPrevious = class CommandTabPrevious extends BaseTabCommand { CommandTabPrevious = __decorate([ RegisterAction ], CommandTabPrevious); +let CommandCtrlPageup = class CommandCtrlPageup extends CommandTabPrevious { + constructor(...args) { + super(...args); + this.keys = [""]; + } +}; +CommandCtrlPageup = __decorate([ + RegisterAction +], CommandCtrlPageup); let MoveDownNonBlank = class MoveDownNonBlank extends BaseMovement { constructor(...args) { super(...args); @@ -2578,7 +2877,7 @@ let MoveScreenLineEnd = class MoveScreenLineEnd extends MoveByScreenLine { MoveScreenLineEnd = __decorate([ RegisterAction ], MoveScreenLineEnd); -let MoveScreenLienEndNonBlank = class MoveScreenLienEndNonBlank extends MoveByScreenLine { +let MoveScreenLineEndNonBlank = class MoveScreenLineEndNonBlank extends MoveByScreenLine { constructor(...args) { super(...args); this.keys = ["g", "_"]; @@ -2593,9 +2892,9 @@ let MoveScreenLienEndNonBlank = class MoveScreenLienEndNonBlank extends MoveBySc }); } }; -MoveScreenLienEndNonBlank = __decorate([ +MoveScreenLineEndNonBlank = __decorate([ RegisterAction -], MoveScreenLienEndNonBlank); +], MoveScreenLineEndNonBlank); let MoveScreenLineCenter = class MoveScreenLineCenter extends MoveByScreenLine { constructor(...args) { super(...args); @@ -2632,6 +2931,58 @@ let MoveDownByScreenLine = class MoveDownByScreenLine extends MoveByScreenLine { MoveDownByScreenLine = __decorate([ RegisterAction ], MoveDownByScreenLine); +let MoveScreenToRight = class MoveScreenToRight extends MoveByScreenLine { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert, mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine]; + this.keys = ["z", "h"]; + this.movementType = "right"; + this.by = "character"; + this.value = 1; + } +}; +MoveScreenToRight = __decorate([ + RegisterAction +], MoveScreenToRight); +let MoveScreenToLeft = class MoveScreenToLeft extends MoveByScreenLine { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert, mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine]; + this.keys = ["z", "l"]; + this.movementType = "left"; + this.by = "character"; + this.value = 1; + } +}; +MoveScreenToLeft = __decorate([ + RegisterAction +], MoveScreenToLeft); +let MoveScreenToRightHalf = class MoveScreenToRightHalf extends MoveByScreenLine { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert, mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine]; + this.keys = ["z", "H"]; + this.movementType = "right"; + this.by = "halfLine"; + this.value = 1; + } +}; +MoveScreenToRightHalf = __decorate([ + RegisterAction +], MoveScreenToRightHalf); +let MoveScreenToLeftHalf = class MoveScreenToLeftHalf extends MoveByScreenLine { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Insert, mode_1.ModeName.Normal, mode_1.ModeName.Visual, mode_1.ModeName.VisualLine]; + this.keys = ["z", "L"]; + this.movementType = "left"; + this.by = "halfLine"; + this.value = 1; + } +}; +MoveScreenToLeftHalf = __decorate([ + RegisterAction +], MoveScreenToLeftHalf); let MoveToLineFromViewPortTop = class MoveToLineFromViewPortTop extends MoveByScreenLine { constructor(...args) { super(...args); @@ -2743,7 +3094,7 @@ let MoveNonBlankLast = class MoveNonBlankLast extends BaseMovement { stop = new position_1.Position(textEditor_1.TextEditor.getLineCount() - 1, 0); } else { - stop = new position_1.Position(count - 1, 0); + stop = new position_1.Position(Math.min(count, textEditor_1.TextEditor.getLineCount()) - 1, 0); } return { start: vimState.cursorStartPosition, @@ -3043,6 +3394,10 @@ let ActionDeleteChar = class ActionDeleteChar extends BaseCommand { } exec(position, vimState) { return __awaiter(this, void 0, void 0, function* () { + // If only EOL do nothing + if (textEditor_1.TextEditor.getLineAt(position).text.length < 1) { + return vimState; + } const state = yield new DeleteOperator().run(vimState, position, position); state.currentMode = mode_1.ModeName.Normal; return state; @@ -3119,7 +3474,7 @@ let ActionJoin = class ActionJoin extends BaseCommand { position.getNextLineBegin().getLineEnd().getLeft() : position.getLineEnd()); yield textEditor_1.TextEditor.insert(resultLine, position); - newState.cursorPosition = new position_1.Position(position.line, lineOne.length + (addSpace ? 1 : 0) + (isParenthesisPair ? 1 : 0) - 1); + newState.cursorPosition = new position_1.Position(position.line, lineOne.length + (addSpace ? 1 : 0) + (isParenthesisPair ? 1 : 0) - 1 + (oneEndsWithWhitespace ? 1 : 0)); return newState; }); } @@ -3127,6 +3482,33 @@ let ActionJoin = class ActionJoin extends BaseCommand { ActionJoin = __decorate([ RegisterAction ], ActionJoin); +let ActionJoinVisualMode = class ActionJoinVisualMode extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Visual]; + this.keys = ["J"]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + let actionJoin = new ActionJoin(); + let start = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + let end = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.end); + if (start.line === end.line) { + return vimState; + } + if (start.isAfter(end)) { + [start, end] = [end, start]; + } + for (let i = start.line; i < end.line; i++) { + vimState = yield actionJoin.exec(start, vimState); + } + return vimState; + }); + } +}; +ActionJoinVisualMode = __decorate([ + RegisterAction +], ActionJoinVisualMode); let ActionJoinNoWhitespace = class ActionJoinNoWhitespace extends BaseCommand { constructor(...args) { super(...args); @@ -3157,12 +3539,40 @@ let ActionJoinNoWhitespace = class ActionJoinNoWhitespace extends BaseCommand { ActionJoinNoWhitespace = __decorate([ RegisterAction ], ActionJoinNoWhitespace); +let ActionJoinNoWhitespaceVisualMode = class ActionJoinNoWhitespaceVisualMode extends BaseCommand { + constructor(...args) { + super(...args); + this.modes = [mode_1.ModeName.Visual]; + this.keys = ["g", "J"]; + } + exec(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + let actionJoin = new ActionJoinNoWhitespace(); + let start = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.start); + let end = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.end); + if (start.line === end.line) { + return vimState; + } + if (start.isAfter(end)) { + [start, end] = [end, start]; + } + for (let i = start.line; i < end.line; i++) { + vimState = yield actionJoin.exec(start, vimState); + } + return vimState; + }); + } +}; +ActionJoinNoWhitespaceVisualMode = __decorate([ + RegisterAction +], ActionJoinNoWhitespaceVisualMode); let ActionReplaceCharacter = class ActionReplaceCharacter extends BaseCommand { constructor(...args) { super(...args); this.modes = [mode_1.ModeName.Normal]; this.keys = ["r", ""]; this.canBeRepeatedWithDot = true; + this.canBePrefixedWithCount = true; } exec(position, vimState) { return __awaiter(this, void 0, void 0, function* () { @@ -3173,6 +3583,19 @@ let ActionReplaceCharacter = class ActionReplaceCharacter extends BaseCommand { return state; }); } + execCount(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + let timesToRepeat = this.canBePrefixedWithCount ? vimState.recordedState.count || 1 : 1; + if (position.character + timesToRepeat > position.getLineEnd().character) { + return vimState; + } + for (let i = 0; i < timesToRepeat; i++) { + vimState = yield this.exec(position, vimState); + position = position.getRight(); + } + return vimState; + }); + } }; ActionReplaceCharacter = __decorate([ RegisterAction @@ -3792,6 +4215,73 @@ let SelectInnerSentence = class SelectInnerSentence extends TextObjectMovement { SelectInnerSentence = __decorate([ RegisterAction ], SelectInnerSentence); +let SelectParagraph = class SelectParagraph extends TextObjectMovement { + constructor(...args) { + super(...args); + this.keys = ["a", "p"]; + } + execAction(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + let start; + const currentParagraphBegin = position.getCurrentParagraphBeginning(); + if (position.isLineBeginning() && position.isLineEnd()) { + // The cursor is at an empty line, it can be both the start of next paragraph and the end of previous paragraph + start = position.getCurrentParagraphBeginning().getCurrentParagraphEnd(); + } + else { + if (currentParagraphBegin.isLineBeginning() && currentParagraphBegin.isLineEnd()) { + start = currentParagraphBegin.getRightThroughLineBreaks(); + } + else { + start = currentParagraphBegin; + } + } + return { + start: start, + stop: position.getCurrentParagraphEnd() + }; + }); + } +}; +SelectParagraph = __decorate([ + RegisterAction +], SelectParagraph); +let SelectInnerParagraph = class SelectInnerParagraph extends TextObjectMovement { + constructor(...args) { + super(...args); + this.keys = ["i", "p"]; + } + execAction(position, vimState) { + return __awaiter(this, void 0, void 0, function* () { + let start; + let stop = position.getCurrentParagraphEnd(); + if (stop.isLineBeginning() && stop.isLineEnd()) { + stop = stop.getLeftThroughLineBreaks(); + } + const currentParagraphBegin = position.getCurrentParagraphBeginning(); + if (position.isLineBeginning() && position.isLineEnd()) { + // The cursor is at an empty line, it can be both the start of next paragraph and the end of previous paragraph + start = position.getCurrentParagraphBeginning().getCurrentParagraphEnd(); + stop = position.getCurrentParagraphEnd().getCurrentParagraphBeginning(); + } + else { + if (currentParagraphBegin.isLineBeginning() && currentParagraphBegin.isLineEnd()) { + start = currentParagraphBegin.getRightThroughLineBreaks(); + } + else { + start = currentParagraphBegin; + } + } + return { + start: start, + stop: stop + }; + }); + } +}; +SelectInnerParagraph = __decorate([ + RegisterAction +], SelectInnerParagraph); let MoveToMatchingBracket = class MoveToMatchingBracket extends BaseMovement { constructor(...args) { super(...args); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/actions/notation.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/actions/notation.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/actions/notation.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/actions/notation.js diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/deleteRange.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/deleteRange.js new file mode 100644 index 00000000..34aba607 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/deleteRange.js @@ -0,0 +1,81 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const vscode = require("vscode"); +const node = require("../node"); +const token = require('../token'); +const textEditor_1 = require("../../textEditor"); +const register_1 = require('../../register/register'); +const position_1 = require('../../motion/position'); +class DeleteRangeCommand extends node.CommandBase { + constructor(args) { + super(); + this._name = 'delete'; + this._shortName = 'd'; + this._arguments = args; + } + get arguments() { + return this._arguments; + } + deleteRange(start, end) { + return __awaiter(this, void 0, void 0, function* () { + start = start.getLineBegin(); + end = end.getLineEnd(); + end = position_1.Position.FromVSCodePosition(end.with(end.line, end.character + 1)); + const isOnLastLine = end.line === textEditor_1.TextEditor.getLineCount() - 1; + if (end.character === textEditor_1.TextEditor.getLineAt(end).text.length + 1) { + end = end.getDown(0); + } + if (isOnLastLine && start.line !== 0) { + start = start.getPreviousLineBegin().getLineEnd(); + } + let text = vscode.window.activeTextEditor.document.getText(new vscode.Range(start, end)); + text = text.endsWith("\r\n") ? text.slice(0, -2) : text.slice(0, -1); + yield textEditor_1.TextEditor.delete(new vscode.Range(start, end)); + let resultPosition = position_1.Position.EarlierOf(start, end); + if (start.character > textEditor_1.TextEditor.getLineAt(start).text.length) { + resultPosition = start.getLeft(); + } + else { + resultPosition = start; + } + resultPosition = resultPosition.getLineBegin(); + vscode.window.activeTextEditor.selection = new vscode.Selection(resultPosition, resultPosition); + return text; + }); + } + execute() { + return __awaiter(this, void 0, void 0, function* () { + if (!vscode.window.activeTextEditor) { + return; + } + let cursorPosition = position_1.Position.FromVSCodePosition(vscode.window.activeTextEditor.selection.active); + let text = yield this.deleteRange(cursorPosition, cursorPosition); + register_1.Register.putByKey(text, this._arguments.register, register_1.RegisterMode.LineWise); + }); + } + executeWithRange(modeHandler, range) { + return __awaiter(this, void 0, void 0, function* () { + let start; + let end; + if (range.left[0].type === token.TokenType.Percent) { + start = new vscode.Position(0, 0); + end = new vscode.Position(textEditor_1.TextEditor.getLineCount() - 1, 0); + } + else { + start = range.lineRefToPosition(vscode.window.activeTextEditor, range.left, modeHandler); + end = range.lineRefToPosition(vscode.window.activeTextEditor, range.right, modeHandler); + } + let text = yield this.deleteRange(position_1.Position.FromVSCodePosition(start), position_1.Position.FromVSCodePosition(end)); + register_1.Register.putByKey(text, this._arguments.register, register_1.RegisterMode.LineWise); + }); + } +} +exports.DeleteRangeCommand = DeleteRangeCommand; +//# sourceMappingURL=deleteRange.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/file.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/file.js similarity index 94% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/file.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/file.js index 3a4cbed1..8822c997 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/file.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/file.js @@ -60,7 +60,9 @@ class FileCommand extends node.CommandBase { return; } let currentFilePath = vscode.window.activeTextEditor.document.uri.path; - let newFilePath = path.join(path.dirname(currentFilePath), this._arguments.name); + let newFilePath = path.isAbsolute(this._arguments.name) ? + this._arguments.name : + path.join(path.dirname(currentFilePath), this._arguments.name); if (newFilePath !== currentFilePath) { let folder = vscode.Uri.file(newFilePath); yield vscode.commands.executeCommand("vscode.open", folder, this._arguments.position === FilePosition.NewWindow ? this.getViewColumnToRight() : this.getActiveViewColumn()); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/quit.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/quit.js similarity index 84% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/quit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/quit.js index ce4b380f..1214020d 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/quit.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/quit.js @@ -32,7 +32,12 @@ class QuitCommand extends node.CommandBase { if (this.activeTextEditor.document.isDirty && !this.arguments.bang) { throw error.VimError.fromCode(error.ErrorCode.E37); } - yield vscode.commands.executeCommand('workbench.action.closeActiveEditor'); + if (this._arguments.quitAll) { + yield vscode.commands.executeCommand('workbench.action.closeAllEditors'); + } + else { + yield vscode.commands.executeCommand('workbench.action.closeActiveEditor'); + } }); } } diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/read.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/read.js new file mode 100644 index 00000000..477e5e87 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/read.js @@ -0,0 +1,91 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const node = require("../node"); +const fs_1 = require('fs'); +const child_process_1 = require('child_process'); +const textEditor_1 = require('../../textEditor'); +// +// Implements :read and :read! +// http://vimdoc.sourceforge.net/htmldoc/insert.html#:read +// http://vimdoc.sourceforge.net/htmldoc/insert.html#:read! +// +class ReadCommand extends node.CommandBase { + constructor(args) { + super(); + this._name = 'read'; + this._shortName = 'r'; + this._arguments = args; + } + get arguments() { + return this._arguments; + } + execute() { + return __awaiter(this, void 0, void 0, function* () { + const textToInsert = yield this.getTextToInsert(); + if (textToInsert) { + yield textEditor_1.TextEditor.insert(textToInsert); + } + }); + } + getTextToInsert() { + return __awaiter(this, void 0, void 0, function* () { + if (this.arguments.file && this.arguments.file.length > 0) { + return yield this.getTextToInsertFromFile(); + } + else if (this.arguments.cmd && this.arguments.cmd.length > 0) { + return yield this.getTextToInsertFromCmd(); + } + else { + throw Error('Invalid arguments'); + } + }); + } + getTextToInsertFromFile() { + return __awaiter(this, void 0, void 0, function* () { + // TODO: Read encoding from ++opt argument. + return new Promise((resolve, reject) => { + try { + fs_1.readFile(this.arguments.file, 'utf8', (err, data) => { + if (err) { + reject(err); + } + else { + resolve(data); + } + }); + } + catch (e) { + reject(e); + } + }); + }); + } + getTextToInsertFromCmd() { + return __awaiter(this, void 0, void 0, function* () { + return new Promise((resolve, reject) => { + try { + child_process_1.exec(this.arguments.cmd, (err, stdout, stderr) => { + if (err) { + reject(err); + } + else { + resolve(stdout); + } + }); + } + catch (e) { + reject(e); + } + }); + }); + } +} +exports.ReadCommand = ReadCommand; +//# sourceMappingURL=read.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/register.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/register.js new file mode 100644 index 00000000..b3f0941c --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/register.js @@ -0,0 +1,46 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const vscode = require("vscode"); +const node = require("../node"); +const register_1 = require('../../register/register'); +class RegisterCommand extends node.CommandBase { + constructor(args) { + super(); + this._name = 'register'; + this._shortName = 'reg'; + this._arguments = args; + } + get arguments() { + return this._arguments; + } + displayRegisterValue(register) { + return __awaiter(this, void 0, void 0, function* () { + let result = (yield register_1.Register.getByKey(register)).text; + if (result instanceof Array) { + result = result.join("\n").substr(0, 100); + } + vscode.window.showInformationMessage(`${register} ${result}`); + }); + } + execute(modeHandler) { + return __awaiter(this, void 0, void 0, function* () { + if (this.arguments.arg !== undefined && this.arguments.arg.length > 0) { + yield this.displayRegisterValue(this.arguments.arg); + } + else { + vscode.window.showQuickPick(register_1.Register.getKeys()).then((val) => __awaiter(this, void 0, void 0, function* () { + yield this.displayRegisterValue(val); + })); + } + }); + } +} +exports.RegisterCommand = RegisterCommand; +//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/setoptions.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/setoptions.js similarity index 74% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/setoptions.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/setoptions.js index fcdb0358..b1a1b9d3 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/setoptions.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/setoptions.js @@ -8,6 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }); }; const node = require("../node"); +const util = require('../../util'); const configuration_1 = require('../../configuration/configuration'); (function (SetOptionOperator) { /* @@ -76,6 +77,27 @@ class SetOptionsCommand extends node.CommandBase { case SetOptionOperator.Invert: configuration_1.Configuration.getInstance()[this._arguments.name] = !configuration_1.Configuration.getInstance()[this._arguments.name]; break; + case SetOptionOperator.Append: + configuration_1.Configuration.getInstance()[this._arguments.name] += this._arguments.value; + break; + case SetOptionOperator.Subtract: + if (typeof this._arguments.value === "number") { + configuration_1.Configuration.getInstance()[this._arguments.name] -= this._arguments.value; + } + else { + let initialValue = configuration_1.Configuration.getInstance()[this._arguments.name]; + configuration_1.Configuration.getInstance()[this._arguments.name] = initialValue.split(this._arguments.value).join(''); + } + break; + case SetOptionOperator.Info: + let value = configuration_1.Configuration.getInstance()[this._arguments.name]; + if (value === undefined) { + yield util.showError(`E518 Unknown option: ${this._arguments.name}`); + } + else { + yield util.showInfo(`${this._arguments.name}=${value}`); + } + break; default: break; } diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/substitute.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/substitute.js similarity index 98% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/substitute.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/substitute.js index ccce8454..76845189 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/substitute.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/substitute.js @@ -90,8 +90,8 @@ class SubstituteCommand extends node.CommandBase { endLine = new vscode.Position(textEditor_1.TextEditor.getLineCount() - 1, 0); } else { - startLine = range.lineRefToPosition(vscode.window.activeTextEditor, range.left); - endLine = range.lineRefToPosition(vscode.window.activeTextEditor, range.right); + startLine = range.lineRefToPosition(vscode.window.activeTextEditor, range.left, modeHandler); + endLine = range.lineRefToPosition(vscode.window.activeTextEditor, range.right, modeHandler); } if (this._arguments.count && this._arguments.count >= 0) { startLine = endLine; diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/tab.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/tab.js similarity index 81% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/tab.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/tab.js index 7f64764c..db169820 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/tab.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/tab.js @@ -1,6 +1,7 @@ "use strict"; const vscode = require("vscode"); const node = require("../node"); +const path = require("path"); (function (Tab) { Tab[Tab["Next"] = 0] = "Next"; Tab[Tab["Previous"] = 1] = "Previous"; @@ -55,7 +56,19 @@ class TabCommand extends node.CommandBase { this.executeCommandWithCount(1, "workbench.action.openLastEditorInGroup"); break; case Tab.New: - this.executeCommandWithCount(1, "workbench.action.files.newUntitledFile"); + if (this.arguments.file) { + let currentFilePath = vscode.window.activeTextEditor.document.uri.path; + let newFilePath = path.isAbsolute(this._arguments.file) ? + this._arguments.file : + path.join(path.dirname(currentFilePath), this._arguments.file); + if (newFilePath !== currentFilePath) { + let folder = vscode.Uri.file(newFilePath); + vscode.commands.executeCommand("vscode.open", folder); + } + } + else { + this.executeCommandWithCount(1, "workbench.action.files.newUntitledFile"); + } break; case Tab.Close: // Navigate the correct position diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/wall.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/wall.js new file mode 100644 index 00000000..85a19836 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/wall.js @@ -0,0 +1,34 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator.throw(value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments)).next()); + }); +}; +const vscode = require("vscode"); +const node = require("../node"); +// +// Implements :wall (write all) +// http://vimdoc.sourceforge.net/htmldoc/editing.html#:wall +// +class WallCommand extends node.CommandBase { + constructor(args) { + super(); + this._name = 'wall'; + this._shortName = 'wa'; + this._arguments = args; + } + get arguments() { + return this._arguments; + } + execute() { + return __awaiter(this, void 0, void 0, function* () { + // TODO : overwrite readonly files when bang? == true + yield vscode.workspace.saveAll(false); + }); + } +} +exports.WallCommand = WallCommand; +//# sourceMappingURL=wall.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/write.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/write.js similarity index 95% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/write.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/write.js index 290e0504..c4362912 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/write.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/write.js @@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge // XXX: use graceful-fs ?? const fs = require('fs'); const path = require('path'); +const vscode = require('vscode'); const node = require('../node'); const util = require('../../util'); -const error = require('../../error'); // // Implements :write // http://vimdoc.sourceforge.net/htmldoc/editing.html#:write @@ -46,7 +46,8 @@ class WriteCommand extends node.CommandBase { return; } if (this.activeTextEditor.document.isUntitled) { - throw error.VimError.fromCode(error.ErrorCode.E32); + yield vscode.commands.executeCommand("workbench.action.files.save"); + return; } try { fs.accessSync(this.activeTextEditor.document.fileName, fs.W_OK); diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/writequit.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/writequit.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/commands/writequit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/commands/writequit.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/lexer.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/lexer.js similarity index 85% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/lexer.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/lexer.js index 8446a206..acdff258 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/lexer.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/lexer.js @@ -28,6 +28,7 @@ var LexerFunctions; var c = state.next(); switch (c) { case ",": + case ";": tokens.push(emitToken(token_1.TokenType.Comma, state)); continue; case "%": @@ -60,6 +61,12 @@ var LexerFunctions; case "-": tokens.push(emitToken(token_1.TokenType.Minus, state)); continue; + case "*": + state.emit(); + tokens.push(new token_1.Token(token_1.TokenType.SelectionFirstLine, '<')); + tokens.push(new token_1.Token(token_1.TokenType.Comma, ',')); + tokens.push(new token_1.Token(token_1.TokenType.SelectionLastLine, '>')); + continue; case "'": return lexMark; default: @@ -71,23 +78,28 @@ var LexerFunctions; LexerFunctions.lexRange = lexRange; function lexMark(state, tokens) { // The first token has already been lexed. - while (true) { - if (state.isAtEof) { - return null; - } - var c = state.next(); - switch (c) { - case '<': - tokens.push(emitToken(token_1.TokenType.SelectionFirstLine, state)); - break; - case '>': - tokens.push(emitToken(token_1.TokenType.SelectionLastLine, state)); - break; - default: - state.backup(); - return lexRange; - } + if (state.isAtEof) { + return null; } + var c = state.next(); + switch (c) { + case '<': + tokens.push(emitToken(token_1.TokenType.SelectionFirstLine, state)); + break; + case '>': + tokens.push(emitToken(token_1.TokenType.SelectionLastLine, state)); + break; + default: + if (/[a-zA-Z]/.test(c)) { + state.emit(); + tokens.push(new token_1.Token(token_1.TokenType.Mark, c)); + } + else { + state.backup(); + } + break; + } + return lexRange; } function lexLineRef(state, tokens) { // The first digit has already been lexed. diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/main.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/main.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/main.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/main.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/node.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/node.js similarity index 82% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/node.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/node.js index 2a3aef89..835a59a5 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/node.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/node.js @@ -40,15 +40,15 @@ class LineRange { toString() { return this.left.toString() + this.separator.content + this.right.toString(); } - execute(document) { + execute(document, modeHandler) { if (this.isEmpty) { return; } var lineRef = this.right.length === 0 ? this.left : this.right; - var pos = this.lineRefToPosition(document, lineRef); + var pos = this.lineRefToPosition(document, lineRef, modeHandler); document.selection = new vscode.Selection(pos, pos); } - lineRefToPosition(doc, toks) { + lineRefToPosition(doc, toks, modeHandler) { var first = toks[0]; switch (first.type) { case token.TokenType.Dollar: @@ -62,11 +62,13 @@ class LineRange { line = Math.min(doc.document.lineCount, line); return new vscode.Position(line, 0); case token.TokenType.SelectionFirstLine: - let start = doc.selection.start.isBeforeOrEqual(doc.selection.end) ? doc.selection.start : doc.selection.end; - return new vscode.Position(start.line, 0); + let startLine = Math.min.apply(null, doc.selections.map(selection => selection.start.isBeforeOrEqual(selection.end) ? selection.start.line : selection.end.line)); + return new vscode.Position(startLine, 0); case token.TokenType.SelectionLastLine: - let end = doc.selection.start.isAfter(doc.selection.end) ? doc.selection.start : doc.selection.end; - return new vscode.Position(end.line, 0); + let endLine = Math.max.apply(null, doc.selections.map(selection => selection.start.isAfter(selection.end) ? selection.start.line : selection.end.line)); + return new vscode.Position(endLine, 0); + case token.TokenType.Mark: + return modeHandler.vimState.historyTracker.getMark(first.content).position; default: throw new Error("not implemented"); } @@ -86,7 +88,7 @@ class CommandLine { execute(document, modeHandler) { return __awaiter(this, void 0, void 0, function* () { if (!this.command) { - this.range.execute(document); + this.range.execute(document, modeHandler); return; } if (this.range.isEmpty) { diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/parser.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/parser.js similarity index 98% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/parser.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/parser.js index 107a5e81..2592af92 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/parser.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/parser.js @@ -26,6 +26,7 @@ function parseLineRange(state, commandLine) { case token.TokenType.LineNumber: case token.TokenType.SelectionFirstLine: case token.TokenType.SelectionLastLine: + case token.TokenType.Mark: commandLine.range.addToken(tok); continue; case token.TokenType.CommandName: diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/scanner.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/scanner.js similarity index 94% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/scanner.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/scanner.js index 448b6733..8a3b7ea7 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/scanner.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/scanner.js @@ -52,6 +52,13 @@ class Scanner { this.ignore(); return s; } + // Returns the text from the current position to the end. + remaining() { + while (!this.isAtEof) { + this.next(); + } + return this.emit(); + } backup() { this.pos--; } diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparser.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparser.js similarity index 76% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparser.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparser.js index a89dad09..51b194be 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparser.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparser.js @@ -1,17 +1,25 @@ "use strict"; const quit_1 = require('./subparsers/quit'); const write_1 = require('./subparsers/write'); +const wall_1 = require('./subparsers/wall'); const writequit_1 = require('./subparsers/writequit'); const tabCmd = require('./subparsers/tab'); const fileCmd = require('./subparsers/file'); const setoptions_1 = require('./subparsers/setoptions'); const substitute_1 = require('./subparsers/substitute'); +const read_1 = require('./subparsers/read'); +const register_1 = require('./subparsers/register'); +const deleteRange_1 = require('./subparsers/deleteRange'); // maps command names to parsers for said commands. exports.commandParsers = { w: write_1.parseWriteCommandArgs, write: write_1.parseWriteCommandArgs, + wa: wall_1.parseWallCommandArgs, + wall: wall_1.parseWallCommandArgs, quit: quit_1.parseQuitCommandArgs, q: quit_1.parseQuitCommandArgs, + qa: quit_1.parseQuitAllCommandArgs, + qall: quit_1.parseQuitAllCommandArgs, wq: writequit_1.parseWriteQuitCommandArgs, writequit: writequit_1.parseWriteQuitCommandArgs, tabn: tabCmd.parseTabNCommandArgs, @@ -39,6 +47,10 @@ exports.commandParsers = { vne: fileCmd.parseEditNewFileInNewWindowCommandArgs, vnew: fileCmd.parseEditNewFileInNewWindowCommandArgs, set: setoptions_1.parseOptionsCommandArgs, - se: setoptions_1.parseOptionsCommandArgs + se: setoptions_1.parseOptionsCommandArgs, + read: read_1.parseReadCommandArgs, + r: read_1.parseReadCommandArgs, + reg: register_1.parseRegisterCommandArgs, + d: deleteRange_1.parseDeleteRangeLinesCommandArgs, }; //# sourceMappingURL=subparser.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/deleteRange.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/deleteRange.js new file mode 100644 index 00000000..ef0b2f4c --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/deleteRange.js @@ -0,0 +1,15 @@ +"use strict"; +const node = require("../commands/deleteRange"); +const scanner_1 = require('../scanner'); +function parseDeleteRangeLinesCommandArgs(args) { + if (!args) { + return new node.DeleteRangeCommand({}); + } + let scanner = new scanner_1.Scanner(args); + let register = scanner.nextWord(); + return new node.DeleteRangeCommand({ + register: register + }); +} +exports.parseDeleteRangeLinesCommandArgs = parseDeleteRangeLinesCommandArgs; +//# sourceMappingURL=deleteRange.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/file.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/file.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/file.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/file.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/quit.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/quit.js similarity index 79% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/quit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/quit.js index 6c19eba6..905ea78a 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/quit.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/quit.js @@ -23,4 +23,10 @@ function parseQuitCommandArgs(args) { return new node.QuitCommand(scannedArgs); } exports.parseQuitCommandArgs = parseQuitCommandArgs; +function parseQuitAllCommandArgs(args) { + let command = parseQuitCommandArgs(args); + command.arguments.quitAll = true; + return command; +} +exports.parseQuitAllCommandArgs = parseQuitAllCommandArgs; //# sourceMappingURL=quit.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/read.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/read.js new file mode 100644 index 00000000..cabedda7 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/read.js @@ -0,0 +1,30 @@ +"use strict"; +const read_1 = require('../commands/read'); +const scanner_1 = require('../scanner'); +function parseReadCommandArgs(args) { + if (!args) { + throw Error('Expected arguments.'); + } + var scannedArgs = {}; + var scanner = new scanner_1.Scanner(args); + scanner.skipWhiteSpace(); + let c = scanner.next(); + // read command has 2 forms - 'read ' and 'read! ' + if (c === '!') { + scanner.ignore(); + scanner.skipWhiteSpace(); + scannedArgs.cmd = scanner.remaining(); + if (!scannedArgs.cmd || scannedArgs.cmd.length === 0) { + throw Error('Expected shell command.'); + } + } + else { + scannedArgs.file = scanner.remaining(); + if (!scannedArgs.file || scannedArgs.file.length === 0) { + throw Error('Expected file path.'); + } + } + return new read_1.ReadCommand(scannedArgs); +} +exports.parseReadCommandArgs = parseReadCommandArgs; +//# sourceMappingURL=read.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/register.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/register.js new file mode 100644 index 00000000..fffaf745 --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/register.js @@ -0,0 +1,15 @@ +"use strict"; +const node = require("../commands/register"); +const scanner_1 = require('../scanner'); +function parseRegisterCommandArgs(args) { + if (!args) { + return new node.RegisterCommand({}); + } + let scanner = new scanner_1.Scanner(args); + let name = scanner.nextWord(); + return new node.RegisterCommand({ + arg: name + }); +} +exports.parseRegisterCommandArgs = parseRegisterCommandArgs; +//# sourceMappingURL=register.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/setoptions.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/setoptions.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/setoptions.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/setoptions.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/substitute.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/substitute.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/substitute.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/substitute.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/tab.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/tab.js similarity index 93% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/tab.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/tab.js index 2a407640..5cd36acf 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/tab.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/tab.js @@ -67,9 +67,14 @@ exports.parseTabLastCommandArgs = parseTabLastCommandArgs; * :tabnew Open a new tab page with an empty window, after the current tab page. */ function parseTabNewCommandArgs(args) { - // TODO: Tab New takes parameter file name. + let name = ""; + if (args) { + let scanner = new scanner_1.Scanner(args); + name = scanner.nextWord(); + } return new node.TabCommand({ - tab: node.Tab.New + tab: node.Tab.New, + file: name }); } exports.parseTabNewCommandArgs = parseTabNewCommandArgs; diff --git a/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/wall.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/wall.js new file mode 100644 index 00000000..db0b9cfb --- /dev/null +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/wall.js @@ -0,0 +1,26 @@ +"use strict"; +const node = require("../commands/wall"); +const scanner_1 = require('../scanner'); +const error_1 = require('../../error'); +function parseWallCommandArgs(args) { + if (!args) { + return new node.WallCommand({}); + } + var scannedArgs = {}; + var scanner = new scanner_1.Scanner(args); + const c = scanner.next(); + if (c === '!') { + scannedArgs.bang = true; + scanner.ignore(); + } + else if (c !== ' ') { + throw error_1.VimError.fromCode(error_1.ErrorCode.E488); + } + scanner.skipWhiteSpace(); + if (!scanner.isAtEof) { + throw error_1.VimError.fromCode(error_1.ErrorCode.E488); + } + return new node.WallCommand(scannedArgs); +} +exports.parseWallCommandArgs = parseWallCommandArgs; +//# sourceMappingURL=wall.js.map \ No newline at end of file diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/write.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/write.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/write.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/write.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/writequit.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/writequit.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/subparsers/writequit.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/subparsers/writequit.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/token.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/token.js similarity index 96% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/token.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/token.js index abbbdba6..0cb26d3b 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/cmd_line/token.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/cmd_line/token.js @@ -21,6 +21,7 @@ */ TokenType[TokenType["SelectionFirstLine"] = 14] = "SelectionFirstLine"; TokenType[TokenType["SelectionLastLine"] = 15] = "SelectionLastLine"; + TokenType[TokenType["Mark"] = 16] = "Mark"; })(exports.TokenType || (exports.TokenType = {})); var TokenType = exports.TokenType; class Token { diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/configuration/configuration.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/configuration/configuration.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/configuration/configuration.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/configuration/configuration.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/error.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/error.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/error.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/error.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/globals.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/globals.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/globals.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/globals.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/history/historyTracker.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/history/historyTracker.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/history/historyTracker.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/history/historyTracker.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/matching/matcher.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/matching/matcher.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/matching/matcher.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/matching/matcher.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/matching/quoteMatcher.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/matching/quoteMatcher.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/matching/quoteMatcher.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/matching/quoteMatcher.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/matching/tagMatcher.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/matching/tagMatcher.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/matching/tagMatcher.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/matching/tagMatcher.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/mode.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/mode.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/mode.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/mode.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeHandler.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeHandler.js similarity index 97% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeHandler.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeHandler.js index 8edd3add..48d55fed 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeHandler.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeHandler.js @@ -35,6 +35,9 @@ const globals_1 = require('../../src/globals'); VimSpecialCommands[VimSpecialCommands["Dot"] = 2] = "Dot"; })(exports.VimSpecialCommands || (exports.VimSpecialCommands = {})); var VimSpecialCommands = exports.VimSpecialCommands; +class ViewChange { +} +exports.ViewChange = ViewChange; /** * The VimState class holds permanent state that carries over from action * to action. @@ -62,6 +65,12 @@ class VimState { this.alteredHistory = false; this.isRunningDotCommand = false; this.focusChanged = false; + /** + * Every time we invoke a VS Code command which might trigger Code's view update, + * we should postpone its view updating phase to avoid conflicting with our internal view updating mechanism. + * This array is used to cache every VS Code view updating event and they will be triggered once we run the inhouse `viewUpdate`. + */ + this.postponedCodeViewChanges = []; /** * Used to prevent non-recursive remappings from looping. */ @@ -256,9 +265,11 @@ SearchState.MAX_SEARCH_RANGES = 1000; SearchState.specialCharactersRegex = /[\-\[\]{}()*+?.,\\\^$|#\s]/g; exports.SearchState = SearchState; class ReplaceState { - constructor(startPosition) { + constructor(startPosition, timesToRepeat = 1) { this.originalChars = []; + this.newChars = []; this._replaceCursorStartPosition = startPosition; + this.timesToRepeat = timesToRepeat; let text = textEditor_1.TextEditor.getLineAt(startPosition).text.substring(startPosition.character); for (let [key, value] of text.split("").entries()) { this.originalChars[key + startPosition.character] = value; @@ -840,6 +851,11 @@ class ModeHandler { } } vscode.window.activeTextEditor.setDecorations(this._caretDecoration, rangesToDraw); + for (let i = 0; i < this.vimState.postponedCodeViewChanges.length; i++) { + let viewChange = this.vimState.postponedCodeViewChanges[i]; + yield vscode.commands.executeCommand(viewChange.command, viewChange.args); + } + this.vimState.postponedCodeViewChanges = []; if (this.currentMode.name === mode_1.ModeName.SearchInProgressMode) { this.setupStatusBarItem(`Searching for: ${this.vimState.searchState.searchString}`); } diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeInsert.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeInsert.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeInsert.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeInsert.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeInsertVisualBlock.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeInsertVisualBlock.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeInsertVisualBlock.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeInsertVisualBlock.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeNormal.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeNormal.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeNormal.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeNormal.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeReplace.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeReplace.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeReplace.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeReplace.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeSearchInProgress.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeSearchInProgress.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeSearchInProgress.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeSearchInProgress.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeVisual.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeVisual.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeVisual.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeVisual.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeVisualBlock.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeVisualBlock.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeVisualBlock.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeVisualBlock.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeVisualLine.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeVisualLine.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/modeVisualLine.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/modeVisualLine.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/remapper.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/remapper.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/mode/remapper.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/mode/remapper.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/motion/position.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/motion/position.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/motion/position.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/motion/position.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/notation.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/notation.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/notation.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/notation.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/number/numericString.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/number/numericString.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/number/numericString.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/number/numericString.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/register/register.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/register/register.js similarity index 83% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/register/register.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/register/register.js index 6324eda9..0b8201e9 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/register/register.js +++ b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/register/register.js @@ -43,6 +43,19 @@ class Register { registerMode: vimState.effectiveRegisterMode(), }; } + static putByKey(content, register, registerMode) { + register = register || '"'; + if (!Register.isValidRegister(register)) { + throw new Error(`Invalid register ${register}`); + } + if (register === '*') { + clipboard.copy(content); + } + Register.registers[register] = { + text: content, + registerMode: registerMode || RegisterMode.FigureItOutFromCurrentMode, + }; + } /** * Gets content from a register. If none is specified, uses the default * register ". @@ -50,6 +63,11 @@ class Register { static get(vimState) { return __awaiter(this, void 0, void 0, function* () { const register = vimState.recordedState.registerName; + return Register.getByKey(register); + }); + } + static getByKey(register) { + return __awaiter(this, void 0, void 0, function* () { if (!Register.isValidRegister(register)) { throw new Error(`Invalid register ${register}`); } @@ -71,6 +89,9 @@ class Register { return Register.registers[register]; }); } + static getKeys() { + return Object.keys(Register.registers); + } } /** * The '"' is the unnamed register. diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/taskQueue.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/taskQueue.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/taskQueue.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/taskQueue.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/textEditor.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/textEditor.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/textEditor.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/textEditor.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/out/src/util.js b/.vscode/extensions/vscodevim.vim-0.2.0/out/src/util.js similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/out/src/util.js rename to .vscode/extensions/vscodevim.vim-0.2.0/out/src/util.js diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/package.json b/.vscode/extensions/vscodevim.vim-0.2.0/package.json similarity index 70% rename from .vscode/extensions/vscodevim.vim-0.1.10/package.json rename to .vscode/extensions/vscodevim.vim-0.2.0/package.json index b019752b..91f1472c 100644 --- a/.vscode/extensions/vscodevim.vim-0.1.10/package.json +++ b/.vscode/extensions/vscodevim.vim-0.2.0/package.json @@ -3,7 +3,7 @@ "displayName": "Vim", "description": "Vim emulation for Visual Studio Code", "icon": "images/icon.png", - "version": "0.1.10", + "version": "0.2.0", "publisher": "vscodevim", "galleryBanner": { "color": "#a5c9a2", @@ -13,8 +13,7 @@ "keywords": [ "vim", "vi", - "vscodevim", - "vsc-vim" + "vscodevim" ], "repository": { "type": "git", @@ -45,107 +44,127 @@ { "key": "Escape", "command": "extension.vim_escape", - "when": "editorTextFocus" + "when": "editorTextFocus && !inDebugRepl" }, { "key": "Backspace", "command": "extension.vim_backspace", - "when": "editorTextFocus" + "when": "editorTextFocus && !inDebugRepl" }, { "key": "Delete", "command": "extension.vim_delete", - "when": "editorTextFocus && vim.mode == 'Normal Mode'" + "when": "editorTextFocus && vim.mode == 'Normal Mode' && !inDebugRepl" }, { "key": "tab", "command": "extension.vim_tab", - "when": "editorFocus && vim.mode == 'Normal Mode'" + "when": "editorFocus && vim.mode == 'Normal Mode' && !inDebugRepl" }, { "key": "ctrl+r", "command": "extension.vim_ctrl+r", - "when": "editorTextFocus" + "when": "editorTextFocus && !inDebugRepl" }, { "key": "ctrl+f", "command": "extension.vim_ctrl+f", - "when": "editorTextFocus && vim.useCtrlKeys" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+b", "command": "extension.vim_ctrl+b", - "when": "editorTextFocus && vim.mode != 'Insert Mode'" + "when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl" + }, + { + "key": "ctrl+h", + "command": "extension.vim_ctrl+h", + "when": "editorTextFocus && vim.mode == 'Insert Mode' && !inDebugRepl" }, { "key": "ctrl+e", "command": "extension.vim_ctrl+e", - "when": "editorTextFocus && vim.useCtrlKeys" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+y", "command": "extension.vim_ctrl+y", - "when": "editorTextFocus && vim.useCtrlKeys" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+u", "command": "extension.vim_ctrl+u", - "when": "editorTextFocus" + "when": "editorTextFocus && !inDebugRepl" }, { "key": "ctrl+v", "command": "extension.vim_ctrl+v", - "when": "editorTextFocus && vim.mode != 'Insert Mode' && vim.useCtrlKeys" + "when": "editorTextFocus && vim.mode != 'Insert Mode' && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+d", "command": "extension.vim_ctrl+d", - "when": "editorTextFocus" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+[", "command": "extension.vim_ctrl+[", - "when": "editorTextFocus && vim.useCtrlKeys" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+w", "command": "extension.vim_ctrl+w", - "when": "editorTextFocus" + "when": "editorTextFocus && !inDebugRepl" }, { "key": "ctrl+c", "command": "extension.vim_ctrl+c", - "when": "editorTextFocus && vim.useCtrlKeys" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+a", "command": "extension.vim_ctrl+a", - "when": "editorTextFocus && vim.useCtrlKeys" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "ctrl+x", "command": "extension.vim_ctrl+x", - "when": "editorTextFocus && vim.useCtrlKeys" + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" + }, + { + "key": "ctrl+t", + "command": "extension.vim_ctrl+t", + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" + }, + { + "key": "ctrl+pagedown", + "command": "extension.vim_ctrl+pagedown", + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" + }, + { + "key": "ctrl+pageup", + "command": "extension.vim_ctrl+pageup", + "when": "editorTextFocus && vim.useCtrlKeys && !inDebugRepl" }, { "key": "left", "command": "extension.vim_left", - "when": "editorTextFocus && vim.mode != 'Insert Mode'" + "when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl" }, { "key": "right", "command": "extension.vim_right", - "when": "editorTextFocus && vim.mode != 'Insert Mode'" + "when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl" }, { "key": "up", "command": "extension.vim_up", - "when": "editorTextFocus && vim.mode != 'Insert Mode'" + "when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl && !suggestWidgetVisible" }, { "key": "down", "command": "extension.vim_down", - "when": "editorTextFocus && vim.mode != 'Insert Mode'" + "when": "editorTextFocus && vim.mode != 'Insert Mode' && !inDebugRepl && !suggestWidgetVisible" } ], "configuration": { @@ -206,6 +225,11 @@ "type": "boolean", "description": "When there is a previous search pattern, highlight all its matches.", "default": false + }, + "vim.autoindent": { + "type": "boolean", + "description": "Copy indent from current line when starting a new line.", + "default": true } } } @@ -217,6 +241,7 @@ "postinstall": "node ./node_modules/vscode/bin/install && gulp init" }, "dependencies": { + "child-process": "^1.0.2", "copy-paste": "^1.3.0", "diff-match-patch": "^1.0.0", "lodash": "^4.12.0" @@ -224,14 +249,13 @@ "devDependencies": { "gulp": "^3.9.1", "gulp-bump": "^2.1.0", - "gulp-filter": "^4.0.0", "gulp-git": "^1.7.1", "gulp-inject-string": "^1.1.0", "gulp-shell": "^0.5.2", "gulp-soften": "^0.0.1", "gulp-tag-version": "^1.3.0", "gulp-trimlines": "^1.0.0", - "gulp-tslint": "^5.0.0", + "gulp-tslint": "^6.1.1", "gulp-typescript": "^2.13.4", "gulp-typings": "^2.0.0", "merge-stream": "^1.0.0", diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/tsd.json b/.vscode/extensions/vscodevim.vim-0.2.0/tsd.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/tsd.json rename to .vscode/extensions/vscodevim.vim-0.2.0/tsd.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/tslint.json b/.vscode/extensions/vscodevim.vim-0.2.0/tslint.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/tslint.json rename to .vscode/extensions/vscodevim.vim-0.2.0/tslint.json diff --git a/.vscode/extensions/vscodevim.vim-0.1.10/typings.json b/.vscode/extensions/vscodevim.vim-0.2.0/typings.json similarity index 100% rename from .vscode/extensions/vscodevim.vim-0.1.10/typings.json rename to .vscode/extensions/vscodevim.vim-0.2.0/typings.json