diff --git a/alfred/Alfred.alfredpreferences/workflows/alfred-mvns b/alfred/Alfred.alfredpreferences/workflows/alfred-mvns new file mode 120000 index 0000000..edcc215 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/alfred-mvns @@ -0,0 +1 @@ +/Users/junwei.zhao/.nvm/versions/node/v10.20.1/lib/node_modules/alfred-mvns \ No newline at end of file diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/README.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/README.md new file mode 100644 index 0000000..f0b1c64 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/README.md @@ -0,0 +1,47 @@ +# alfred-mvns +[![NPM](https://nodei.co/npm/alfred-mvns.png)](https://nodei.co/npm/alfred-mvns/) + +## Install + +``` +$ npm install -g alfred-mvns +``` + +*Requires [Node.js](https://nodejs.org) 4+ and the Alfred [Powerpack](https://www.alfredapp.com/powerpack/).* + + +## Usage + +In Alfred, type `mvn`, and your query, to search for java libraries at maven central repository. + +Select a item and press enter to copy `maven dependency` to clipboard.
+ +Hold alt and press enter to copy `gradle dependency` to clipboard.
+ +## Demo + +![mvn.png](mvn.png) + +press enter get: + +``` + + org.nd4j + jackson + 0.9.1 + +``` +Hold alt and press enter get: + +``` +compile 'org.nd4j:jackson:0.9.1' +``` + +## Related + +- [alfy](https://github.com/sindresorhus/alfy) - Create Alfred workflows with ease + + +## License + +MIT © diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/icon.png b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/icon.png new file mode 100644 index 0000000..ad5f538 Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/icon.png differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/index.js new file mode 100644 index 0000000..d74f3c2 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/index.js @@ -0,0 +1,48 @@ +'use strict'; +const alfy = require('alfy'); +const dateFormat = require('date-format'); + +let q = alfy.input; +const s = q.split(':'); + +if (s.length > 1) { + q = 'g:'+s[0]; + if (s[1]) { + q = q+' AND '+'a:'+s[1]; + } + if (s.length > 2 && s[2]) { + q = q+' AND '+'v:'+s[2]; + } +} + +alfy.fetch('http://search.maven.org/solrsearch/select', { + query: { + q, + start: 0, + rows: 20 + } +}).then(data => { + const items = data.response.docs + .map(x => { + const v = x.v?x.v:x.latestVersion; + const mvn = `\n ${x.g}\n ${x.a}\n ${v}\n`; + const gradle = `compile '${x.g}:${x.a}:${v}'`; + return { + title: `${x.g}:${x.a}:${v}`, + subtitle: `updated at ${dateFormat('yyyy-dd-MM', new Date(x.timestamp))}`, + arg: mvn, + mods: { + cmd: { + arg: mvn, + subtitle: `copy maven dependency to clipboard` + }, + alt: { + arg: gradle, + subtitle: `copy gradle dependency to clipboard` + } + } + }; + }); + + alfy.output(items); +}); \ No newline at end of file diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/info.plist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/info.plist new file mode 100644 index 0000000..a2bd7c3 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/info.plist @@ -0,0 +1,124 @@ + + + + + bundleid + com.xfslove.mvns + category + Tools + connections + + 0726E1E0-396C-4D34-BCCA-1845023FDDD8 + + + destinationuid + 50B7B6A5-8381-4941-B19A-52654E0EFE56 + modifiers + 0 + modifiersubtext + + vitoclose + + + + + createdby + hanwen.huang + description + Alfred 3 workflow to search for java libraries at central repo + disabled + + name + mvns + objects + + + config + + alfredfiltersresults + + alfredfiltersresultsmatchmode + 0 + argumenttrimmode + 0 + argumenttype + 0 + escaping + 102 + keyword + mvn + queuedelaycustom + 3 + queuedelayimmediatelyinitially + + queuedelaymode + 0 + queuemode + 1 + runningsubtext + Searching... + script + ./node_modules/.bin/run-node index.js "$1" + scriptargtype + 1 + scriptfile + + subtext + + title + Search for java libraries + type + 0 + withspace + + + type + alfred.workflow.input.scriptfilter + uid + 0726E1E0-396C-4D34-BCCA-1845023FDDD8 + version + 2 + + + config + + autopaste + + clipboardtext + {query} + transient + + + type + alfred.workflow.output.clipboard + uid + 50B7B6A5-8381-4941-B19A-52654E0EFE56 + version + 2 + + + readme + + uidata + + 0726E1E0-396C-4D34-BCCA-1845023FDDD8 + + xpos + 20 + ypos + 10 + + 50B7B6A5-8381-4941-B19A-52654E0EFE56 + + xpos + 170 + ypos + 10 + + + version + 1.0.2 + webaddress + https://github.com/xfslove/alfred-mvns#readme + + diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfred-link b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfred-link new file mode 100755 index 0000000..1668e4b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfred-link @@ -0,0 +1,16 @@ +#!/usr/bin/env node +'use strict'; +const alfredLink = require('./'); + +const npmGlobal = process.env.npm_config_global; + +if (npmGlobal === '') { + // Prevent linking if the script was part of a non-global npm (install) command + process.exit(0); +} + +// Only transform if `alfred-link` is called from `npm -g` +alfredLink.link({transform: npmGlobal}).catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfred-unlink b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfred-unlink new file mode 100755 index 0000000..3acc265 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfred-unlink @@ -0,0 +1,8 @@ +#!/usr/bin/env node +'use strict'; +const alfredLink = require('./'); + +alfredLink.unlink().catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfy-cleanup b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfy-cleanup new file mode 100755 index 0000000..ea8c30b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfy-cleanup @@ -0,0 +1,11 @@ +#!/usr/bin/env node +'use strict'; +const execa = require('execa'); +const npmRunPath = require('npm-run-path'); + +const env = npmRunPath.env({cwd: __dirname}); + +execa('alfred-unlink', {env}).catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfy-init b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfy-init new file mode 100755 index 0000000..5528778 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/alfy-init @@ -0,0 +1,11 @@ +#!/usr/bin/env node +'use strict'; +const execa = require('execa'); +const npmRunPath = require('npm-run-path'); + +const env = npmRunPath.env({cwd: __dirname}); + +execa('alfred-link', {env}).catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/mkdirp b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/mkdirp new file mode 100755 index 0000000..d95de15 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/mkdirp @@ -0,0 +1,33 @@ +#!/usr/bin/env node + +var mkdirp = require('../'); +var minimist = require('minimist'); +var fs = require('fs'); + +var argv = minimist(process.argv.slice(2), { + alias: { m: 'mode', h: 'help' }, + string: [ 'mode' ] +}); +if (argv.help) { + fs.createReadStream(__dirname + '/usage.txt').pipe(process.stdout); + return; +} + +var paths = argv._.slice(); +var mode = argv.mode ? parseInt(argv.mode, 8) : undefined; + +(function next () { + if (paths.length === 0) return; + var p = paths.shift(); + + if (mode === undefined) mkdirp(p, cb) + else mkdirp(p, mode, cb) + + function cb (err) { + if (err) { + console.error(err.message); + process.exit(1); + } + else next(); + } +})(); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/rc b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/rc new file mode 100755 index 0000000..ab05b60 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/rc @@ -0,0 +1,4 @@ +#! /usr/bin/env node +var rc = require('./index') + +console.log(JSON.stringify(rc(process.argv[2]), false, 2)) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/rimraf b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/rimraf new file mode 100755 index 0000000..0d1e17b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/rimraf @@ -0,0 +1,50 @@ +#!/usr/bin/env node + +var rimraf = require('./') + +var help = false +var dashdash = false +var noglob = false +var args = process.argv.slice(2).filter(function(arg) { + if (dashdash) + return !!arg + else if (arg === '--') + dashdash = true + else if (arg === '--no-glob' || arg === '-G') + noglob = true + else if (arg === '--glob' || arg === '-g') + noglob = false + else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/)) + help = true + else + return !!arg +}) + +if (help || args.length === 0) { + // If they didn't ask for help, then this is not a "success" + var log = help ? console.log : console.error + log('Usage: rimraf [ ...]') + log('') + log(' Deletes all files and folders at "path" recursively.') + log('') + log('Options:') + log('') + log(' -h, --help Display this usage info') + log(' -G, --no-glob Do not expand glob patterns in arguments') + log(' -g, --glob Expand glob patterns in arguments (default)') + process.exit(help ? 0 : 1) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + var options = {} + if (noglob) + options = { glob: false } + rimraf(args[n], options, function (er) { + if (er) + throw er + go(n+1) + }) +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/run-node b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/run-node new file mode 100755 index 0000000..bff9d95 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/run-node @@ -0,0 +1,49 @@ +#!/bin/bash + +if [[ -z "$alfred_workflow_cache" ]]; then + echo "This script must be called from Alfred, \$alfred_workflow_cache is missing. Make sure a Bundle ID is set." + exit 1 +fi + +if [[ ! -d "$alfred_workflow_cache" ]]; then + mkdir -p "$alfred_workflow_cache" +fi + +PATH_CACHE="$alfred_workflow_cache"/node_path + +get_user_path() { + eval $(/usr/libexec/path_helper -s) + echo "$($SHELL -i -l -c 'echo -e "\n"PATH=\"$PATH:\$PATH\""\n"' 2>/dev/null | grep "^PATH=")" > "$PATH_CACHE" +} + +set_path() { + if [[ -f "$PATH_CACHE" ]]; then + . "$PATH_CACHE" + else + get_user_path + . "$PATH_CACHE" + fi + + export PATH +} + +has_node() { + command -v node >/dev/null 2>&1 +} + +# check if we have node, otherwise inherit path from user shell +if ! has_node; then + set_path + + # retry by deleting old path cache + if ! has_node; then + rm "$PATH_CACHE" + set_path + fi +fi + +if has_node; then + node "$@" +else + echo $'{"items":[{"title": "Couldn\'t find the `node` binary", "subtitle": "Symlink it to `/usr/local/bin`"}]}' +fi diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/semver b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/semver new file mode 100755 index 0000000..9100ed4 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/semver @@ -0,0 +1,153 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +var argv = process.argv.slice(2) + , versions = [] + , range = [] + , gt = [] + , lt = [] + , eq = [] + , inc = null + , version = require("../package.json").version + , loose = false + , includePrerelease = false + , coerce = false + , identifier = undefined + , semver = require("../semver") + , reverse = false + , options = {} + +main() + +function main () { + if (!argv.length) return help() + while (argv.length) { + var a = argv.shift() + var i = a.indexOf('=') + if (i !== -1) { + a = a.slice(0, i) + argv.unshift(a.slice(i + 1)) + } + switch (a) { + case "-rv": case "-rev": case "--rev": case "--reverse": + reverse = true + break + case "-l": case "--loose": + loose = true + break + case "-p": case "--include-prerelease": + includePrerelease = true + break + case "-v": case "--version": + versions.push(argv.shift()) + break + case "-i": case "--inc": case "--increment": + switch (argv[0]) { + case "major": case "minor": case "patch": case "prerelease": + case "premajor": case "preminor": case "prepatch": + inc = argv.shift() + break + default: + inc = "patch" + break + } + break + case "--preid": + identifier = argv.shift() + break + case "-r": case "--range": + range.push(argv.shift()) + break + case "-c": case "--coerce": + coerce = true + break + case "-h": case "--help": case "-?": + return help() + default: + versions.push(a) + break + } + } + + var options = { loose: loose, includePrerelease: includePrerelease } + + versions = versions.map(function (v) { + return coerce ? (semver.coerce(v) || {version: v}).version : v + }).filter(function (v) { + return semver.valid(v) + }) + if (!versions.length) return fail() + if (inc && (versions.length !== 1 || range.length)) + return failInc() + + for (var i = 0, l = range.length; i < l ; i ++) { + versions = versions.filter(function (v) { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) return fail() + } + return success(versions) +} + +function failInc () { + console.error("--inc can only be used on a single version with no range") + fail() +} + +function fail () { process.exit(1) } + +function success () { + var compare = reverse ? "rcompare" : "compare" + versions.sort(function (a, b) { + return semver[compare](a, b, options) + }).map(function (v) { + return semver.clean(v, options) + }).map(function (v) { + return inc ? semver.inc(v, inc, options, identifier) : v + }).forEach(function (v,i,_) { console.log(v) }) +} + +function help () { + console.log(["SemVer " + version + ,"" + ,"A JavaScript implementation of the http://semver.org/ specification" + ,"Copyright Isaac Z. Schlueter" + ,"" + ,"Usage: semver [options] [ [...]]" + ,"Prints valid versions sorted by SemVer precedence" + ,"" + ,"Options:" + ,"-r --range " + ," Print versions that match the specified range." + ,"" + ,"-i --increment []" + ," Increment a version by the specified level. Level can" + ," be one of: major, minor, patch, premajor, preminor," + ," prepatch, or prerelease. Default level is 'patch'." + ," Only one version may be specified." + ,"" + ,"--preid " + ," Identifier to be used to prefix premajor, preminor," + ," prepatch or prerelease version increments." + ,"" + ,"-l --loose" + ," Interpret versions and ranges loosely" + ,"" + ,"-p --include-prerelease" + ," Always include prerelease versions in range matching" + ,"" + ,"-c --coerce" + ," Coerce a string into SemVer if possible" + ," (does not imply --loose)" + ,"" + ,"Program exits successfully if any valid version satisfies" + ,"all supplied ranges, and prints all satisfying versions." + ,"" + ,"If no satisfying versions are found, then exits failure." + ,"" + ,"Versions are printed in ascending order, so supplying" + ,"multiple versions to the utility will just sort them." + ].join("\n")) +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/which b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/which new file mode 100755 index 0000000..7cee372 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/.bin/which @@ -0,0 +1,52 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) + usage() + +function usage () { + console.error('usage: which [-as] program ...') + process.exit(1) +} + +var all = false +var silent = false +var dashdash = false +var args = process.argv.slice(2).filter(function (arg) { + if (dashdash || !/^-/.test(arg)) + return true + + if (arg === '--') { + dashdash = true + return false + } + + var flags = arg.substr(1).split('') + for (var f = 0; f < flags.length; f++) { + var flag = flags[f] + switch (flag) { + case 's': + silent = true + break + case 'a': + all = true + break + default: + console.error('which: illegal option -- ' + flag) + usage() + } + } + return false +}) + +process.exit(args.reduce(function (pv, current) { + try { + var f = which.sync(current, { all: all }) + if (all) + f = f.join('\n') + if (!silent) + console.log(f) + return pv; + } catch (e) { + return 1; + } +}, 0)) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/index.js new file mode 100644 index 0000000..f1412a9 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/index.js @@ -0,0 +1,57 @@ +'use strict'; +const path = require('path'); +const pathExists = require('path-exists'); +const readPkgUp = require('read-pkg-up'); +const resolveAlfredPrefs = require('resolve-alfred-prefs'); +const sudoBlock = require('sudo-block'); +const plistTransform = require('./lib/plist-transform'); +const link = require('./lib/link'); +const unlink = require('./lib/unlink'); + +// Prevent running as `sudo` +sudoBlock(); + +const getWorkflowDir = () => resolveAlfredPrefs().then(prefs => path.join(prefs, 'workflows')); + +const readPkg = workflowDir => pathExists(workflowDir) + .then(exists => { + if (!exists) { + throw new Error(`Workflow directory \`${workflowDir}\` does not exist`); + } + + return readPkgUp(); + }); + +exports.link = opts => { + const options = Object.assign({ + transform: true + }, opts); + + let workflowDir; + + return getWorkflowDir() + .then(dir => { + workflowDir = dir; + + return readPkg(dir); + }) + .then(result => { + const pkg = result.pkg; + const filePath = result.path; + + const src = path.dirname(filePath); + const dest = path.join(workflowDir, pkg.name.replace('/', '-')); + + if (!options.transform) { + return link(src, dest); + } + + return plistTransform(path.dirname(filePath), pkg) + .then(() => link(src, dest)); + }); +}; + +exports.unlink = () => getWorkflowDir() + .then(dir => readPkg(dir) + .then(res => unlink(path.join(dir, res.pkg.name.replace('/', '-')))) + ); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/link.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/link.js new file mode 100644 index 0000000..c9d4bb8 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/link.js @@ -0,0 +1,8 @@ +'use strict'; +const fs = require('fs'); +const pify = require('pify'); +const del = require('del'); + +const fsP = pify(fs); + +module.exports = (src, dest) => del(dest, {force: true}).then(() => fsP.symlink(src, dest)); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/plist-transform.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/plist-transform.js new file mode 100644 index 0000000..87280c8 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/plist-transform.js @@ -0,0 +1,40 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const plist = require('plist'); +const pify = require('pify'); + +const fsP = pify(fs); + +// Fixes some inconsistencies when running `plist.parse` +// https://github.com/TooTallNate/plist.js/issues/75 +const fix = obj => { + for (const key of Object.keys(obj)) { + const val = obj[key]; + + if (val === null || val === undefined) { + obj[key] = ''; + } else if (Array.isArray(val)) { + obj[key] = val.map(fix); + } else if (typeof val === 'object') { + obj[key] = fix(val); + } + } + + return obj; +}; + +module.exports = (dir, pkg) => { + const file = path.join(dir, 'info.plist'); + + return fsP.readFile(file, 'utf8') + .then(content => { + const data = fix(plist.parse(content)); + data.version = pkg.version || ''; + data.description = pkg.description || ''; + data.webaddress = pkg.homepage || pkg.author.url || ''; + data.createdby = pkg.author.name || ''; + + return fsP.writeFile(file, plist.build(data)); + }); +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/unlink.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/unlink.js new file mode 100644 index 0000000..fde0eca --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/lib/unlink.js @@ -0,0 +1,25 @@ +/* eslint-disable indent */ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const del = require('del'); +const pify = require('pify'); +const userHome = require('user-home'); + +const fsP = pify(fs); + +const idRegexp = /bundleid<\/key>[\s]*(.*?)<\/string>/; + +// Remove the symlink +const unlink = dir => del(path.join(dir), {force: true}); + +// Cleanup config and cache data +const cleanup = dir => fsP.readFile(path.join(dir, 'info.plist'), 'utf8') + .then(content => idRegexp.exec(content)[1]) + .then(bundleid => Promise.all([ + unlink(path.join(userHome, 'Library/Application Support/Alfred 3/Workflow Data', bundleid)), + unlink(path.join(userHome, 'Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data', bundleid)) + ])); + +module.exports = dir => cleanup(dir) + .then(unlink(dir)); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/license new file mode 100644 index 0000000..78b0855 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sam Verschueren (github.com/SamVerschueren) + +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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/link.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/link.js new file mode 100755 index 0000000..1668e4b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/link.js @@ -0,0 +1,16 @@ +#!/usr/bin/env node +'use strict'; +const alfredLink = require('./'); + +const npmGlobal = process.env.npm_config_global; + +if (npmGlobal === '') { + // Prevent linking if the script was part of a non-global npm (install) command + process.exit(0); +} + +// Only transform if `alfred-link` is called from `npm -g` +alfredLink.link({transform: npmGlobal}).catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/package.json new file mode 100644 index 0000000..cbffcf5 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/package.json @@ -0,0 +1,91 @@ +{ + "_from": "alfred-link@^0.2.0", + "_id": "alfred-link@0.2.1", + "_inBundle": false, + "_integrity": "sha1-RizB/M0t7dwmdqsZxX5YS4gicQo=", + "_location": "/alfred-mvns/alfred-link", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "alfred-link@^0.2.0", + "name": "alfred-link", + "escapedName": "alfred-link", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfy" + ], + "_resolved": "https://registry.npmjs.org/alfred-link/-/alfred-link-0.2.1.tgz", + "_shasum": "462cc1fccd2deddc2676ab19c57e584b8822710a", + "_spec": "alfred-link@^0.2.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfy", + "author": { + "name": "Sam Verschueren", + "email": "sam.verschueren@gmail.com", + "url": "github.com/SamVerschueren" + }, + "bin": { + "alfred-link": "link.js", + "alfred-unlink": "unlink.js" + }, + "bugs": { + "url": "https://github.com/SamVerschueren/alfred-link/issues" + }, + "bundleDependencies": false, + "dependencies": { + "del": "^2.2.2", + "path-exists": "^3.0.0", + "pify": "^2.3.0", + "plist": "^2.0.1", + "read-pkg-up": "^1.0.1", + "resolve-alfred-prefs": "^1.0.0", + "sudo-block": "^1.2.0", + "user-home": "^2.0.0" + }, + "deprecated": false, + "description": "Make your Alfred workflows installable from npm", + "devDependencies": { + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "link.js", + "unlink.js", + "lib" + ], + "homepage": "https://github.com/SamVerschueren/alfred-link#readme", + "keywords": [ + "cli-app", + "cli", + "alfred", + "link", + "symlink", + "packal" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + } + ], + "name": "alfred-link", + "repository": { + "type": "git", + "url": "git+https://github.com/SamVerschueren/alfred-link.git" + }, + "scripts": { + "test": "xo" + }, + "version": "0.2.1", + "xo": { + "esnext": true + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/readme.md new file mode 100644 index 0000000..524985b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/readme.md @@ -0,0 +1,70 @@ +# alfred-link [![Build Status](https://travis-ci.org/SamVerschueren/alfred-link.svg?branch=master)](https://travis-ci.org/SamVerschueren/alfred-link) + +> Make your [Alfred](https://www.alfredapp.com/) workflows installable from npm + + +## Install + +``` +$ npm install --save alfred-link +``` + + +## Usage + +Add the `alfred-link` command as `postinstall` script of your Alfred package and add `alfred-unlink` as `preuninstall` script to clean up the resources when the workflow gets uninstalled. + +```json +{ + "name": "alfred-unicorn", + "scripts": { + "postinstall": "alfred-link", + "preuninstall": "alfred-unlink" + } +} +``` + +You can now install the `alfred-unicorn` package like this + +``` +$ npm install -g alfred-unicorn. +``` + +This will update `info.plist` with the information from `package.json` and creates a `unicorn` symlink inside the Alfred workflows directory that points to the location of the `alfred-unicorn` module. + + +## info.plist + +This package will update the `info.plist` file when the workflow is being installed. The following properties in `info.plist` can be safely omitted. The corresponding values in `package.json` are added to the plist file. + +| info.plist | package.json | +|-------------|--------------| +| version | version | +| description | description | +| webaddress | homepage | +| createdby | author.name | + + +## Development + +When developing an Alfred workflow, you can call `alfred-link` directly from your cli. Either by installing `alfred-link` globally or by calling `alfred-link` from your `node_modules/.bin` directory. This will create a symlink in the Alfred workflows directory pointing to your development location without transforming `info.plist`. + +``` +$ ./node_modules/.bin/alfred-link +``` + +To remove the symlink afterwards, you can call `alfred-unlink`. + +``` +$ ./node_modules/.bin/alfred-unlink +``` + + +## Related + +- [alfy](https://github.com/sindresorhus/alfy) - Create Alfred workflows with ease + + +## License + +MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/unlink.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/unlink.js new file mode 100755 index 0000000..3acc265 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-link/unlink.js @@ -0,0 +1,8 @@ +#!/usr/bin/env node +'use strict'; +const alfredLink = require('./'); + +alfredLink.unlink().catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/check.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/check.js new file mode 100755 index 0000000..69124eb --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/check.js @@ -0,0 +1,39 @@ +#!/usr/bin/env node +'use strict'; +const readPkg = require('read-pkg'); +const latestVersion = require('latest-version'); +const semver = require('semver'); +const execa = require('execa'); +const CacheConf = require('cache-conf'); +const notify = require('./lib/notify'); +const pkg = require('./package.json'); + +const ONE_DAY = 86400000; + +const workflowPath = process.cwd(); +const conf = new CacheConf({projectName: pkg.name}); + +const checkNpm = pkg => latestVersion(pkg.name).then(version => ({ + latest: version, + current: pkg.version, + name: pkg.name +})); + +readPkg(workflowPath) + .then(pkg => { + if (conf.has(pkg.name)) { + // Skip checking if a valid entry exists + return; + } + + return checkNpm(pkg).then(res => { + // Store the latest version in the cache for one day + conf.set(res.name, res.latest, {maxAge: ONE_DAY}); + + if (!semver.eq(res.latest, res.current)) { + // Overwrite `info.plist` and reload the workflows + return notify(workflowPath, `Update available: ${res.current} → ${res.latest}. Run \`npm install -g ${res.name}\``) + .then(() => execa('open', ['-n', '-a', 'Alfred 3'])); + } + }); + }); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/index.js new file mode 100644 index 0000000..bd2f14b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/index.js @@ -0,0 +1,11 @@ +'use strict'; +const path = require('path'); +const cp = require('child_process'); + +module.exports = () => { + const subProcess = cp.spawn(path.join(__dirname, 'check.js'), [], { + detached: true, + stdio: 'ignore' + }); + subProcess.unref(); +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/lib/notify.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/lib/notify.js new file mode 100644 index 0000000..b35eef9 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/lib/notify.js @@ -0,0 +1,42 @@ +'use strict'; +const path = require('path'); +const fs = require('fs'); +const plist = require('plist'); +const pify = require('pify'); + +const fsP = pify(fs); + +// Fixes some inconsistencies when running `plist.parse` +// https://github.com/TooTallNate/plist.js/issues/75 +const fix = obj => { + for (const key of Object.keys(obj)) { + const val = obj[key]; + + if (val === null || val === undefined) { + obj[key] = ''; + } else if (Array.isArray(val)) { + obj[key] = val.map(fix); + } else if (typeof val === 'object') { + obj[key] = fix(val); + } + } + + return obj; +}; + +module.exports = (dir, message) => { + const file = path.join(dir, 'info.plist'); + + return fsP.readFile(file, 'utf8') + .then(content => { + const data = fix(plist.parse(content)); + + for (const obj of data.objects) { + if (obj.config.subtext !== undefined) { + obj.config.subtext = message; + } + } + + return fsP.writeFile(file, plist.build(data)); + }); +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/license new file mode 100644 index 0000000..78b0855 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sam Verschueren (github.com/SamVerschueren) + +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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/index.js new file mode 100644 index 0000000..d9fa3d2 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/index.js @@ -0,0 +1,86 @@ +'use strict'; +const path = require('path'); +const Conf = require('conf'); +const pkgUp = require('pkg-up'); + +const parentDir = path.dirname(module.parent.filename); + +class CacheConf extends Conf { + + constructor(options) { + const pkgPath = pkgUp.sync(parentDir); + + options = Object.assign({ + projectName: pkgPath && require(pkgPath).name // eslint-disable-line import/no-dynamic-require + }, options); + + super(options); + + this.version = options.version; + } + + get(key, options) { + options = options || {}; + + if (options.ignoreMaxAge !== true && this.isExpired(key)) { + super.delete(key); + return; + } + + const item = super.get(key); + + return item && item.data; + } + + set(key, val, opts) { + opts = opts || {}; + + if (typeof key === 'object') { + opts = val || {}; + + const timestamp = typeof opts.maxAge === 'number' ? Date.now() + opts.maxAge : undefined; + + Object.keys(key).forEach(k => { + super.set(k, { + timestamp, + version: this.version, + data: key[k] + }); + }); + } else { + super.set(key, { + timestamp: typeof opts.maxAge === 'number' ? Date.now() + opts.maxAge : undefined, + version: this.version, + data: val + }); + } + } + + has(key) { + if (!super.has(key)) { + return false; + } + + if (this.isExpired(key)) { + super.delete(key); + return false; + } + + return true; + } + + isExpired(key) { + const item = super.get(key); + + if (!item) { + return false; + } + + const invalidTimestamp = item.timestamp && item.timestamp < Date.now(); + const invalidVersion = item.version !== this.version; + + return Boolean(invalidTimestamp || invalidVersion); + } +} + +module.exports = CacheConf; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/license new file mode 100644 index 0000000..78b0855 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sam Verschueren (github.com/SamVerschueren) + +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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/package.json new file mode 100644 index 0000000..3062d99 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/package.json @@ -0,0 +1,86 @@ +{ + "_from": "cache-conf@^0.5.0", + "_id": "cache-conf@0.5.0", + "_inBundle": false, + "_integrity": "sha1-aBxC7Rdx6tK8I2MqddPNjceUXFk=", + "_location": "/alfred-mvns/alfred-notifier/cache-conf", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cache-conf@^0.5.0", + "name": "cache-conf", + "escapedName": "cache-conf", + "rawSpec": "^0.5.0", + "saveSpec": null, + "fetchSpec": "^0.5.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier" + ], + "_resolved": "https://registry.npmjs.org/cache-conf/-/cache-conf-0.5.0.tgz", + "_shasum": "681c42ed1771ead2bc23632a75d3cd8dc7945c59", + "_spec": "cache-conf@^0.5.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier", + "author": { + "name": "Sam Verschueren", + "email": "sam.verschueren@gmail.com", + "url": "github.com/SamVerschueren" + }, + "bugs": { + "url": "https://github.com/SamVerschueren/cache-conf/issues" + }, + "bundleDependencies": false, + "dependencies": { + "conf": "^0.12.0", + "pkg-up": "^1.0.0" + }, + "deprecated": false, + "description": "Simple cache config handling for your app or module", + "devDependencies": { + "ava": "*", + "delay": "^1.3.1", + "tempfile": "^1.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/SamVerschueren/cache-conf#readme", + "keywords": [ + "cache", + "caching", + "config", + "store", + "app", + "storage", + "conf", + "configuration", + "settings", + "preferences", + "json", + "data", + "persist", + "persistent", + "save", + "load", + "read", + "write" + ], + "license": "MIT", + "name": "cache-conf", + "repository": { + "type": "git", + "url": "git+https://github.com/SamVerschueren/cache-conf.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "0.5.0", + "xo": { + "esnext": true + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/readme.md new file mode 100644 index 0000000..6668def --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/cache-conf/readme.md @@ -0,0 +1,96 @@ +# cache-conf [![Build Status](https://travis-ci.org/SamVerschueren/cache-conf.svg?branch=master)](https://travis-ci.org/SamVerschueren/cache-conf) + +> Simple cache config handling for your app or module + +If you don't need caching, you should use [conf](https://github.com/sindresorhus/conf) instead. This module extends that module and +abstracts away the caching mechanism. + + +## Install + +``` +$ npm install --save cache-conf +``` + + +## Usage + +```js +const delay = require('delay'); +const CacheConf = require('cache-conf'); +const config = new CacheConf(); + +config.set('unicorn', '🦄', {maxAge: 5000}); +console.log(config.get('unicorn')); +//=> '🦄' + +// Wait 5 seconds +await delay(5000); + +console.log(config.get('unicorn')); +//=> undefined +``` + + +## API + +### CacheConf([options]) + +Returns a new instance. + +#### options + +Any of the [conf options](https://github.com/sindresorhus/conf#options). + +### Instance + +An extended [conf](https://github.com/sindresorhus/conf#instance) instance. + +#### get(key, [options]) + +Get an item. + +##### options + +###### ignoreMaxAge + +Type: `boolean`
+Default: `false` + +Get the item for the `key` provided without taking the `maxAge` of the item into account. + +#### set(key, value, [options]) + +Set an item. + +#### set(object, [options]) + +Set multiple items at once. + +##### options + +###### maxAge + +Type: `number` + +Number of milliseconds the cached value is valid. + +###### version + +Type: `string` + +Version number of the data. If the version provided is not the same as the version of the cached data, the data will be invalid. + +#### isExpired(key) + +Boolean indicating if the cached data is expired. + + +## Related + +- [conf](https://github.com/sindresorhus/conf) - Simple config handling for your app or module + + +## License + +MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/index.js new file mode 100644 index 0000000..3b2e412 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/index.js @@ -0,0 +1,105 @@ +'use strict'; +const fs = require('fs'); +const path = require('path'); +const dotProp = require('dot-prop'); +const mkdirp = require('mkdirp'); +const pkgUp = require('pkg-up'); +const envPaths = require('env-paths'); + +const obj = () => Object.create(null); + +// Prevent caching of this module so module.parent is always accurate +delete require.cache[__filename]; +const parentDir = path.dirname(module.parent.filename); + +class Conf { + constructor(opts) { + const pkgPath = pkgUp.sync(parentDir); + + opts = Object.assign({ + // If the package.json was not found, avoid breaking with `require(null)` + projectName: pkgPath && require(pkgPath).name // eslint-disable-line import/no-dynamic-require + }, opts); + + if (!opts.projectName && !opts.cwd) { + throw new Error('Project name could not be inferred. Please specify the `projectName` option.'); + } + + opts = Object.assign({ + configName: 'config' + }, opts); + + if (!opts.cwd) { + opts.cwd = envPaths(opts.projectName).config; + } + + this.path = path.resolve(opts.cwd, `${opts.configName}.json`); + this.store = Object.assign(obj(), opts.defaults, this.store); + } + get(key) { + return dotProp.get(this.store, key); + } + set(key, val) { + if (typeof key !== 'string' && typeof key !== 'object') { + throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof key}`); + } + + const store = this.store; + + if (typeof key === 'object') { + Object.keys(key).forEach(k => { + dotProp.set(store, k, key[k]); + }); + } else { + dotProp.set(store, key, val); + } + + this.store = store; + } + has(key) { + return dotProp.has(this.store, key); + } + delete(key) { + const store = this.store; + dotProp.delete(store, key); + this.store = store; + } + clear() { + this.store = obj(); + } + get size() { + return Object.keys(this.store).length; + } + get store() { + try { + return Object.assign(obj(), JSON.parse(fs.readFileSync(this.path, 'utf8'))); + } catch (err) { + if (err.code === 'ENOENT') { + mkdirp.sync(path.dirname(this.path)); + return obj(); + } + + if (err.name === 'SyntaxError') { + return obj(); + } + + throw err; + } + } + set store(val) { + // Ensure the directory exists as it could have been deleted in the meantime + mkdirp.sync(path.dirname(this.path)); + + fs.writeFileSync(this.path, JSON.stringify(val, null, '\t')); + } + // TODO: Use `Object.entries()` here at some point + * [Symbol.iterator]() { + const store = this.store; + + for (const key of Object.keys(store)) { + yield [key, store[key]]; + } + } +} + +module.exports = Conf; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/package.json new file mode 100644 index 0000000..874c438 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/package.json @@ -0,0 +1,81 @@ +{ + "_from": "conf@^0.12.0", + "_id": "conf@0.12.0", + "_inBundle": false, + "_integrity": "sha1-hJjFmeJIf+xwNQXRgcETh1uMMQw=", + "_location": "/alfred-mvns/alfred-notifier/conf", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "conf@^0.12.0", + "name": "conf", + "escapedName": "conf", + "rawSpec": "^0.12.0", + "saveSpec": null, + "fetchSpec": "^0.12.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier/cache-conf" + ], + "_resolved": "https://registry.npmjs.org/conf/-/conf-0.12.0.tgz", + "_shasum": "8498c599e2487fec703505d181c113875b8c310c", + "_spec": "conf@^0.12.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier/node_modules/cache-conf", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/conf/issues" + }, + "bundleDependencies": false, + "dependencies": { + "dot-prop": "^4.1.0", + "env-paths": "^1.0.0", + "mkdirp": "^0.5.1", + "pkg-up": "^1.0.0" + }, + "deprecated": false, + "description": "Simple config handling for your app or module", + "devDependencies": { + "ava": "*", + "del": "^2.2.1", + "tempfile": "^1.1.1", + "xo": "*" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/conf#readme", + "keywords": [ + "config", + "store", + "app", + "storage", + "conf", + "configuration", + "settings", + "preferences", + "json", + "data", + "persist", + "persistent", + "save", + "load", + "read", + "write", + "cache" + ], + "license": "MIT", + "name": "conf", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/conf.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "0.12.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/readme.md new file mode 100644 index 0000000..ce5cad3 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/conf/readme.md @@ -0,0 +1,143 @@ +# conf [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/conf.svg?branch=master)](https://travis-ci.org/sindresorhus/conf) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/n88jwh3aju39i0p2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/conf/branch/master) + +> Simple config handling for your app or module + +All you have to care about is what to persist. This module will handle all the dull details like where and how. + + +## Install + +``` +$ npm install --save conf +``` + + +## Usage + +```js +const Conf = require('conf'); +const config = new Conf(); + +config.set('unicorn', '🦄'); +console.log(config.get('unicorn')); +//=> '🦄' + +// Use dot-notation to access nested properties +config.set('foo.bar', true); +console.log(config.get('foo')); +//=> {bar: true} + +config.delete('unicorn'); +console.log(config.get('unicorn')); +//=> undefined +``` + +Or [create a subclass](https://github.com/sindresorhus/electron-config/blob/master/index.js). + + +## API + +### Conf([options]) + +Returns a new instance. + +### options + +#### defaults + +Type: `Object` + +Default config. + +#### configName + +Type: `string`
+Default: `config` + +Name of the config file (without extension). + +Useful if you need multiple config files for your app or module. For example, different config files between two major versions. + +#### projectName + +Type: `string`
+Default: The `name` field in your package.json + +You only need to specify this if you don't have a package.json file in your project. + +#### cwd + +Type: `string`
+Default: System default [user config directory](https://github.com/sindresorhus/env-paths#pathsconfig) + +**You most likely don't need this.** + +Overrides `projectName`. + +The only use-case I can think of is having the config located in the app directory or on some external storage. + +### Instance + +You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a `key` to access nested properties. + +The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. + +#### .set(key, value) + +Set an item. + +#### .set(object) + +Set multiple items at once. + +#### .get(key) + +Get an item. + +#### .has(key) + +Check if an item exists. + +#### .delete(key) + +Delete an item. + +#### .clear() + +Delete all items. + +#### .size + +Get the item count. + +#### .store + +Get all the config as an object or replace the current config with an object: + +```js +conf.store = { + hello: 'world' +}; +``` + +#### .path + +Get the path to the config file. + + + +## FAQ + +### How is this different from [`configstore`](https://github.com/yeoman/configstore)? + +I'm also the author of `configstore`. While it's pretty good, I did make some mistakes early on that are hard to change at this point. This module is the result of everything I learned from making `configstore`. Mainly where config is stored. In `configstore`, the config is stored in `~/.config` (which is mainly a Linux convention) on all systems, while `conf` stores config in the system default [user config directory](https://github.com/sindresorhus/env-paths#pathsconfig). The `~/.config` directory, it turns out, often have an incorrect permission on macOS and Windows, which has caused a lot of grief for users. + + +## Related + +- [electron-config](https://github.com/sindresorhus/electron-config) - Simple config handling for your Electron app or module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/index.js new file mode 100644 index 0000000..a691594 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/index.js @@ -0,0 +1,314 @@ +'use strict'; +const childProcess = require('child_process'); +const util = require('util'); +const crossSpawn = require('cross-spawn'); +const stripEof = require('strip-eof'); +const npmRunPath = require('npm-run-path'); +const isStream = require('is-stream'); +const _getStream = require('get-stream'); +const pFinally = require('p-finally'); +const onExit = require('signal-exit'); +const errname = require('./lib/errname'); +const stdio = require('./lib/stdio'); + +const TEN_MEGABYTES = 1000 * 1000 * 10; + +function handleArgs(cmd, args, opts) { + let parsed; + + opts = Object.assign({ + extendEnv: true, + env: {} + }, opts); + + if (opts.extendEnv) { + opts.env = Object.assign({}, process.env, opts.env); + } + + if (opts.__winShell === true) { + delete opts.__winShell; + parsed = { + command: cmd, + args, + options: opts, + file: cmd, + original: cmd + }; + } else { + parsed = crossSpawn._parse(cmd, args, opts); + } + + opts = Object.assign({ + maxBuffer: TEN_MEGABYTES, + stripEof: true, + preferLocal: true, + localDir: parsed.options.cwd || process.cwd(), + encoding: 'utf8', + reject: true, + cleanup: true + }, parsed.options); + + opts.stdio = stdio(opts); + + if (opts.preferLocal) { + opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir})); + } + + return { + cmd: parsed.command, + args: parsed.args, + opts, + parsed + }; +} + +function handleInput(spawned, opts) { + const input = opts.input; + + if (input === null || input === undefined) { + return; + } + + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); + } +} + +function handleOutput(opts, val) { + if (val && opts.stripEof) { + val = stripEof(val); + } + + return val; +} + +function handleShell(fn, cmd, opts) { + let file = '/bin/sh'; + let args = ['-c', cmd]; + + opts = Object.assign({}, opts); + + if (process.platform === 'win32') { + opts.__winShell = true; + file = process.env.comspec || 'cmd.exe'; + args = ['/s', '/c', `"${cmd}"`]; + opts.windowsVerbatimArguments = true; + } + + if (opts.shell) { + file = opts.shell; + delete opts.shell; + } + + return fn(file, args, opts); +} + +function getStream(process, stream, encoding, maxBuffer) { + if (!process[stream]) { + return null; + } + + let ret; + + if (encoding) { + ret = _getStream(process[stream], { + encoding, + maxBuffer + }); + } else { + ret = _getStream.buffer(process[stream], {maxBuffer}); + } + + return ret.catch(err => { + err.stream = stream; + err.message = `${stream} ${err.message}`; + throw err; + }); +} + +module.exports = (cmd, args, opts) => { + let joinedCmd = cmd; + + if (Array.isArray(args) && args.length > 0) { + joinedCmd += ' ' + args.join(' '); + } + + const parsed = handleArgs(cmd, args, opts); + const encoding = parsed.opts.encoding; + const maxBuffer = parsed.opts.maxBuffer; + + let spawned; + try { + spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts); + } catch (err) { + return Promise.reject(err); + } + + let removeExitHandler; + if (parsed.opts.cleanup) { + removeExitHandler = onExit(() => { + spawned.kill(); + }); + } + + let timeoutId = null; + let timedOut = false; + + const cleanupTimeout = () => { + if (timeoutId) { + clearTimeout(timeoutId); + timeoutId = null; + } + }; + + if (parsed.opts.timeout > 0) { + timeoutId = setTimeout(() => { + timeoutId = null; + timedOut = true; + spawned.kill(parsed.opts.killSignal); + }, parsed.opts.timeout); + } + + const processDone = new Promise(resolve => { + spawned.on('exit', (code, signal) => { + cleanupTimeout(); + resolve({code, signal}); + }); + + spawned.on('error', err => { + cleanupTimeout(); + resolve({err}); + }); + + if (spawned.stdin) { + spawned.stdin.on('error', err => { + cleanupTimeout(); + resolve({err}); + }); + } + }); + + function destroy() { + if (spawned.stdout) { + spawned.stdout.destroy(); + } + + if (spawned.stderr) { + spawned.stderr.destroy(); + } + } + + const handlePromise = () => pFinally(Promise.all([ + processDone, + getStream(spawned, 'stdout', encoding, maxBuffer), + getStream(spawned, 'stderr', encoding, maxBuffer) + ]).then(arr => { + const result = arr[0]; + const stdout = arr[1]; + const stderr = arr[2]; + + let err = result.err; + const code = result.code; + const signal = result.signal; + + if (removeExitHandler) { + removeExitHandler(); + } + + if (err || code !== 0 || signal !== null) { + if (!err) { + let output = ''; + + if (Array.isArray(parsed.opts.stdio)) { + if (parsed.opts.stdio[2] !== 'inherit') { + output += output.length > 0 ? stderr : `\n${stderr}`; + } + + if (parsed.opts.stdio[1] !== 'inherit') { + output += `\n${stdout}`; + } + } else if (parsed.opts.stdio !== 'inherit') { + output = `\n${stderr}${stdout}`; + } + + err = new Error(`Command failed: ${joinedCmd}${output}`); + err.code = code < 0 ? errname(code) : code; + } + + // TODO: missing some timeout logic for killed + // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203 + // err.killed = spawned.killed || killed; + err.killed = err.killed || spawned.killed; + + err.stdout = stdout; + err.stderr = stderr; + err.failed = true; + err.signal = signal || null; + err.cmd = joinedCmd; + err.timedOut = timedOut; + + if (!parsed.opts.reject) { + return err; + } + + throw err; + } + + return { + stdout: handleOutput(parsed.opts, stdout), + stderr: handleOutput(parsed.opts, stderr), + code: 0, + failed: false, + killed: false, + signal: null, + cmd: joinedCmd, + timedOut: false + }; + }), destroy); + + crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed); + + handleInput(spawned, parsed.opts); + + spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected); + spawned.catch = onrejected => handlePromise().catch(onrejected); + + return spawned; +}; + +module.exports.stdout = function () { + // TODO: set `stderr: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stdout); +}; + +module.exports.stderr = function () { + // TODO: set `stdout: 'ignore'` when that option is implemented + return module.exports.apply(null, arguments).then(x => x.stderr); +}; + +module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts); + +module.exports.sync = (cmd, args, opts) => { + const parsed = handleArgs(cmd, args, opts); + + if (isStream(parsed.opts.input)) { + throw new TypeError('The `input` option cannot be a stream in sync mode'); + } + + const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts); + + if (result.error || result.status !== 0) { + throw (result.error || new Error(result.stderr === '' ? result.stdout : result.stderr)); + } + + result.stdout = handleOutput(parsed.opts, result.stdout); + result.stderr = handleOutput(parsed.opts, result.stderr); + + return result; +}; + +module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts); + +module.exports.spawn = util.deprecate(module.exports, 'execa.spawn() is deprecated. Use execa() instead.'); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/lib/errname.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/lib/errname.js new file mode 100644 index 0000000..328f3e3 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/lib/errname.js @@ -0,0 +1,37 @@ +'use strict'; +// The Node team wants to deprecate `process.bind(...)`. +// https://github.com/nodejs/node/pull/2768 +// +// However, we need the 'uv' binding for errname support. +// This is a defensive wrapper around it so `execa` will not fail entirely if it stops working someday. +// +// If this ever stops working. See: https://github.com/sindresorhus/execa/issues/31#issuecomment-215939939 for another possible solution. +let uv; + +try { + uv = process.binding('uv'); + + if (typeof uv.errname !== 'function') { + throw new TypeError('uv.errname is not a function'); + } +} catch (err) { + console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err); + uv = null; +} + +function errname(uv, code) { + if (uv) { + return uv.errname(code); + } + + if (!(code < 0)) { + throw new Error('err >= 0'); + } + + return `Unknown system error ${code}`; +} + +module.exports = code => errname(uv, code); + +// Used for testing the fallback behavior +module.exports.__test__ = errname; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/lib/stdio.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/lib/stdio.js new file mode 100644 index 0000000..a82d468 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/lib/stdio.js @@ -0,0 +1,41 @@ +'use strict'; +const alias = ['stdin', 'stdout', 'stderr']; + +const hasAlias = opts => alias.some(x => Boolean(opts[x])); + +module.exports = opts => { + if (!opts) { + return null; + } + + if (opts.stdio && hasAlias(opts)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`); + } + + if (typeof opts.stdio === 'string') { + return opts.stdio; + } + + const stdio = opts.stdio || []; + + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + } + + const result = []; + const len = Math.max(stdio.length, alias.length); + + for (let i = 0; i < len; i++) { + let value = null; + + if (stdio[i] !== undefined) { + value = stdio[i]; + } else if (opts[alias[i]] !== undefined) { + value = opts[alias[i]]; + } + + result[i] = value; + } + + return result; +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/package.json new file mode 100644 index 0000000..2c58456 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/package.json @@ -0,0 +1,108 @@ +{ + "_from": "execa@^0.8.0", + "_id": "execa@0.8.0", + "_inBundle": false, + "_integrity": "sha1-2NdrvBtVIX7RkP1t1J08d07PyNo=", + "_location": "/alfred-mvns/alfred-notifier/execa", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "execa@^0.8.0", + "name": "execa", + "escapedName": "execa", + "rawSpec": "^0.8.0", + "saveSpec": null, + "fetchSpec": "^0.8.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier" + ], + "_resolved": "https://registry.npmjs.org/execa/-/execa-0.8.0.tgz", + "_shasum": "d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da", + "_spec": "execa@^0.8.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/execa/issues" + }, + "bundleDependencies": false, + "dependencies": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "deprecated": false, + "description": "A better `child_process`", + "devDependencies": { + "ava": "*", + "cat-names": "^1.0.2", + "coveralls": "^2.11.9", + "delay": "^2.0.0", + "is-running": "^2.0.0", + "nyc": "^11.0.2", + "tempfile": "^2.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "lib" + ], + "homepage": "https://github.com/sindresorhus/execa#readme", + "keywords": [ + "exec", + "child", + "process", + "execute", + "fork", + "execfile", + "spawn", + "file", + "shell", + "bin", + "binary", + "binaries", + "npm", + "path", + "local" + ], + "license": "MIT", + "maintainers": [ + { + "name": "James Talmage", + "email": "james@talmage.io", + "url": "github.com/jamestalmage" + } + ], + "name": "execa", + "nyc": { + "reporter": [ + "text", + "lcov" + ], + "exclude": [ + "**/fixtures/**", + "**/test.js", + "**/test/**" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/execa.git" + }, + "scripts": { + "test": "xo && nyc ava" + }, + "version": "0.8.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/readme.md new file mode 100644 index 0000000..18c808a --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/execa/readme.md @@ -0,0 +1,279 @@ +# execa [![Build Status: Linux](https://travis-ci.org/sindresorhus/execa.svg?branch=master)](https://travis-ci.org/sindresorhus/execa) [![Build status: Windows](https://ci.appveyor.com/api/projects/status/x5ajamxtjtt93cqv/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/execa/branch/master) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/execa/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/execa?branch=master) + +> A better [`child_process`](https://nodejs.org/api/child_process.html) + + +## Why + +- Promise interface. +- [Strips EOF](https://github.com/sindresorhus/strip-eof) from the output so you don't have to `stdout.trim()`. +- Supports [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) binaries cross-platform. +- [Improved Windows support.](https://github.com/IndigoUnited/node-cross-spawn#why) +- Higher max buffer. 10 MB instead of 200 KB. +- [Executes locally installed binaries by name.](#preferlocal) +- [Cleans up spawned processes when the parent process dies.](#cleanup) + + +## Install + +``` +$ npm install --save execa +``` + + +## Usage + +```js +const execa = require('execa'); + +execa('echo', ['unicorns']).then(result => { + console.log(result.stdout); + //=> 'unicorns' +}); + +// pipe the child process stdout to the current stdout +execa('echo', ['unicorns']).stdout.pipe(process.stdout); + +execa.shell('echo unicorns').then(result => { + console.log(result.stdout); + //=> 'unicorns' +}); + +// example of catching an error +execa.shell('exit 3').catch(error => { + console.log(error); + /* + { + message: 'Command failed: /bin/sh -c exit 3' + killed: false, + code: 3, + signal: null, + cmd: '/bin/sh -c exit 3', + stdout: '', + stderr: '', + timedOut: false + } + */ +}); +``` + + +## API + +### execa(file, [arguments], [options]) + +Execute a file. + +Think of this as a mix of `child_process.execFile` and `child_process.spawn`. + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties. + +### execa.stdout(file, [arguments], [options]) + +Same as `execa()`, but returns only `stdout`. + +### execa.stderr(file, [arguments], [options]) + +Same as `execa()`, but returns only `stderr`. + +### execa.shell(command, [options]) + +Execute a command through the system shell. Prefer `execa()` whenever possible, as it's both faster and safer. + +Returns a [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess). + +The `child_process` instance is enhanced to also be promise for a result object with `stdout` and `stderr` properties. + +### execa.sync(file, [arguments], [options]) + +Execute a file synchronously. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +This method throws an `Error` if the command fails. + +### execa.shellSync(file, [options]) + +Execute a command synchronously through the system shell. + +Returns the same result object as [`child_process.spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options). + +### options + +Type: `Object` + +#### cwd + +Type: `string`
+Default: `process.cwd()` + +Current working directory of the child process. + +#### env + +Type: `Object`
+Default: `process.env` + +Environment key-value pairs. Extends automatically from `process.env`. Set `extendEnv` to `false` if you don't want this. + +#### extendEnv + +Type: `boolean`
+Default: `true` + +Set to `false` if you don't want to extend the environment variables when providing the `env` property. + +#### argv0 + +Type: `string` + +Explicitly set the value of `argv[0]` sent to the child process. This will be set to `command` or `file` if not specified. + +#### stdio + +Type: `Array` `string`
+Default: `pipe` + +Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration. + +#### detached + +Type: `boolean` + +Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached). + +#### uid + +Type: `number` + +Sets the user identity of the process. + +#### gid + +Type: `number` + +Sets the group identity of the process. + +#### shell + +Type: `boolean` `string`
+Default: `false` + +If `true`, runs `command` inside of a shell. Uses `/bin/sh` on UNIX and `cmd.exe` on Windows. A different shell can be specified as a string. The shell should understand the `-c` switch on UNIX or `/d /s /c` on Windows. + +#### stripEof + +Type: `boolean`
+Default: `true` + +[Strip EOF](https://github.com/sindresorhus/strip-eof) (last newline) from the output. + +#### preferLocal + +Type: `boolean`
+Default: `true` + +Prefer locally installed binaries when looking for a binary to execute.
+If you `$ npm install foo`, you can then `execa('foo')`. + +#### localDir + +Type: `string`
+Default: `process.cwd()` + +Preferred path to find locally installed binaries in (use with `preferLocal`). + +#### input + +Type: `string` `Buffer` `stream.Readable` + +Write some input to the `stdin` of your binary.
+Streams are not allowed when using the synchronous methods. + +#### reject + +Type: `boolean`
+Default: `true` + +Setting this to `false` resolves the promise with the error instead of rejecting it. + +#### cleanup + +Type: `boolean`
+Default: `true` + +Keep track of the spawned process and `kill` it when the parent process exits. + +#### encoding + +Type: `string`
+Default: `utf8` + +Specify the character encoding used to decode the `stdout` and `stderr` output. + +#### timeout + +Type: `number`
+Default: `0` + +If timeout is greater than `0`, the parent will send the signal identified by the `killSignal` property (the default is `SIGTERM`) if the child runs longer than timeout milliseconds. + +#### maxBuffer + +Type: `number`
+Default: `10000000` (10MB) + +Largest amount of data in bytes allowed on `stdout` or `stderr`. + +#### killSignal + +Type: `string` `number`
+Default: `SIGTERM` + +Signal value to be used when the spawned process will be killed. + +#### stdin + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### stdout + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + +#### stderr + +Type: `string` `number` `Stream` `undefined` `null`
+Default: `pipe` + +Same options as [`stdio`](https://nodejs.org/dist/latest-v6.x/docs/api/child_process.html#child_process_options_stdio). + + +## Tips + +### Save and pipe output from a child process + +Let's say you want to show the output of a child process in real-time while also saving it to a variable. + +```js +const execa = require('execa'); +const getStream = require('get-stream'); + +const stream = execa('echo', ['foo']).stdout; + +stream.pipe(process.stdout); + +getStream(stream).then(value => { + console.log('child output:', value); +}); +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/index.js new file mode 100644 index 0000000..b2767e3 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/index.js @@ -0,0 +1,11 @@ +'use strict'; +const path = require('path'); +const fs = require('graceful-fs'); +const stripBom = require('strip-bom'); +const parseJson = require('parse-json'); +const pify = require('pify'); + +const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp)); + +module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp)); +module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/index.js new file mode 100644 index 0000000..7c720eb --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify = module.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify.all = pify; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/package.json new file mode 100644 index 0000000..2a0677a --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/package.json @@ -0,0 +1,80 @@ +{ + "_from": "pify@^2.0.0", + "_id": "pify@2.3.0", + "_inBundle": false, + "_integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "_location": "/alfred-mvns/alfred-notifier/load-json-file/pify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pify@^2.0.0", + "name": "pify", + "escapedName": "pify", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier/load-json-file" + ], + "_resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "_shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c", + "_spec": "pify@^2.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier/node_modules/load-json-file", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Promisify a callback-style function", + "devDependencies": { + "ava": "*", + "pinkie-promise": "^1.0.0", + "v8-natives": "0.0.2", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/pify#readme", + "keywords": [ + "promise", + "promises", + "promisify", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "es2015" + ], + "license": "MIT", + "name": "pify", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pify.git" + }, + "scripts": { + "optimization-test": "node --allow-natives-syntax optimization-test.js", + "test": "xo && ava && npm run optimization-test" + }, + "version": "2.3.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/readme.md new file mode 100644 index 0000000..c79ca8b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/node_modules/pify/readme.md @@ -0,0 +1,119 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// promisify a single function + +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// or promisify all methods in a module + +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [promiseModule], [options]) + +Returns a promise wrapped version of the supplied function or module. + +#### input + +Type: `function`, `object` + +Callback-style function or module whose methods you want to promisify. + +#### promiseModule + +Type: `function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + +#### options + +##### multiArgs + +Type: `boolean` +Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `array` of (`string`|`regex`) + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `array` of (`string`|`regex`) +Default: `[/.+Sync$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean` +Default: `false` + +By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(data, null); + }); +}; + +// promisify methods but not fn() +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/package.json new file mode 100644 index 0000000..55968cf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/package.json @@ -0,0 +1,75 @@ +{ + "_from": "load-json-file@^2.0.0", + "_id": "load-json-file@2.0.0", + "_inBundle": false, + "_integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "_location": "/alfred-mvns/alfred-notifier/load-json-file", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "load-json-file@^2.0.0", + "name": "load-json-file", + "escapedName": "load-json-file", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier/read-pkg" + ], + "_resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "_shasum": "7947e42149af80d696cbf797bcaabcfe1fe29ca8", + "_spec": "load-json-file@^2.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier/node_modules/read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/load-json-file/issues" + }, + "bundleDependencies": false, + "dependencies": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "deprecated": false, + "description": "Read and parse a JSON file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/load-json-file#readme", + "keywords": [ + "read", + "json", + "parse", + "file", + "fs", + "graceful", + "load" + ], + "license": "MIT", + "name": "load-json-file", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/load-json-file.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/readme.md new file mode 100644 index 0000000..3319c26 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/load-json-file/readme.md @@ -0,0 +1,45 @@ +# load-json-file [![Build Status](https://travis-ci.org/sindresorhus/load-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/load-json-file) + +> Read and parse a JSON file + +[Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom), uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs), and throws more [helpful JSON errors](https://github.com/sindresorhus/parse-json). + + +## Install + +``` +$ npm install --save load-json-file +``` + + +## Usage + +```js +const loadJsonFile = require('load-json-file'); + +loadJsonFile('foo.json').then(json => { + console.log(json); + //=> {foo: true} +}); +``` + + +## API + +### loadJsonFile(filepath) + +Returns a promise for the parsed JSON. + +### loadJsonFile.sync(filepath) + +Returns the parsed JSON. + + +## Related + +- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/index.js new file mode 100644 index 0000000..4ac9dd9 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/index.js @@ -0,0 +1,26 @@ +'use strict'; +const fs = require('fs'); +const pify = require('pify'); + +function type(fn, fn2, fp) { + if (typeof fp !== 'string') { + return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`)); + } + + return pify(fs[fn])(fp).then(stats => stats[fn2]()); +} + +function typeSync(fn, fn2, fp) { + if (typeof fp !== 'string') { + throw new TypeError(`Expected a string, got ${typeof fp}`); + } + + return fs[fn](fp)[fn2](); +} + +exports.file = type.bind(null, 'stat', 'isFile'); +exports.dir = type.bind(null, 'stat', 'isDirectory'); +exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink'); +exports.fileSync = typeSync.bind(null, 'statSync', 'isFile'); +exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory'); +exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/index.js new file mode 100644 index 0000000..7c720eb --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/index.js @@ -0,0 +1,68 @@ +'use strict'; + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify = module.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify.all = pify; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/package.json new file mode 100644 index 0000000..b6977c5 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/package.json @@ -0,0 +1,80 @@ +{ + "_from": "pify@^2.0.0", + "_id": "pify@2.3.0", + "_inBundle": false, + "_integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "_location": "/alfred-mvns/alfred-notifier/path-type/pify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pify@^2.0.0", + "name": "pify", + "escapedName": "pify", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier/path-type" + ], + "_resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "_shasum": "ed141a6ac043a849ea588498e7dca8b15330e90c", + "_spec": "pify@^2.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier/node_modules/path-type", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Promisify a callback-style function", + "devDependencies": { + "ava": "*", + "pinkie-promise": "^1.0.0", + "v8-natives": "0.0.2", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/pify#readme", + "keywords": [ + "promise", + "promises", + "promisify", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "es2015" + ], + "license": "MIT", + "name": "pify", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pify.git" + }, + "scripts": { + "optimization-test": "node --allow-natives-syntax optimization-test.js", + "test": "xo && ava && npm run optimization-test" + }, + "version": "2.3.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/readme.md new file mode 100644 index 0000000..c79ca8b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/node_modules/pify/readme.md @@ -0,0 +1,119 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// promisify a single function + +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// or promisify all methods in a module + +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [promiseModule], [options]) + +Returns a promise wrapped version of the supplied function or module. + +#### input + +Type: `function`, `object` + +Callback-style function or module whose methods you want to promisify. + +#### promiseModule + +Type: `function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + +#### options + +##### multiArgs + +Type: `boolean` +Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `array` of (`string`|`regex`) + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `array` of (`string`|`regex`) +Default: `[/.+Sync$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean` +Default: `false` + +By default, if given module is a function itself, this function will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(data, null); + }); +}; + +// promisify methods but not fn() +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/package.json new file mode 100644 index 0000000..17b4cc2 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/package.json @@ -0,0 +1,80 @@ +{ + "_from": "path-type@^2.0.0", + "_id": "path-type@2.0.0", + "_inBundle": false, + "_integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "_location": "/alfred-mvns/alfred-notifier/path-type", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "path-type@^2.0.0", + "name": "path-type", + "escapedName": "path-type", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier/read-pkg" + ], + "_resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "_shasum": "f012ccb8415b7096fc2daa1054c3d72389594c73", + "_spec": "path-type@^2.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier/node_modules/read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/path-type/issues" + }, + "bundleDependencies": false, + "dependencies": { + "pify": "^2.0.0" + }, + "deprecated": false, + "description": "Check if a path is a file, directory, or symlink", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/path-type#readme", + "keywords": [ + "path", + "fs", + "type", + "is", + "check", + "directory", + "dir", + "file", + "filepath", + "symlink", + "symbolic", + "link", + "stat", + "stats", + "filesystem" + ], + "license": "MIT", + "name": "path-type", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/path-type.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/readme.md new file mode 100644 index 0000000..b1ea61f --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/path-type/readme.md @@ -0,0 +1,42 @@ +# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type) + +> Check if a path is a file, directory, or symlink + + +## Install + +``` +$ npm install --save path-type +``` + + +## Usage + +```js +const pathType = require('path-type'); + +pathType.file('package.json').then(isFile => { + console.log(isFile); + //=> true +}) +``` + + +## API + +### .file(path) +### .dir(path) +### .symlink(path) + +Returns a `Promise` for a `boolean` of whether the path is the checked type. + +### .fileSync(path) +### .dirSync(path) +### .symlinkSync(path) + +Returns a `boolean` of whether the path is the checked type. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/index.js new file mode 100644 index 0000000..1dee43a --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/index.js @@ -0,0 +1,84 @@ +'use strict'; + +const processFn = (fn, opts) => function () { + const P = opts.promiseModule; + const args = new Array(arguments.length); + + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P((resolve, reject) => { + if (opts.errorFirst) { + args.push(function (err, result) { + if (opts.multiArgs) { + const results = new Array(arguments.length - 1); + + for (let i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + if (err) { + results.unshift(err); + reject(results); + } else { + resolve(results); + } + } else if (err) { + reject(err); + } else { + resolve(result); + } + }); + } else { + args.push(function (result) { + if (opts.multiArgs) { + const results = new Array(arguments.length - 1); + + for (let i = 0; i < arguments.length; i++) { + results[i] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + } + + fn.apply(this, args); + }); +}; + +module.exports = (obj, opts) => { + opts = Object.assign({ + exclude: [/.+(Sync|Stream)$/], + errorFirst: true, + promiseModule: Promise + }, opts); + + const filter = key => { + const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + let ret; + if (typeof obj === 'function') { + ret = function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, opts).apply(this, arguments); + }; + } else { + ret = Object.create(Object.getPrototypeOf(obj)); + } + + for (const key in obj) { // eslint-disable-line guard-for-in + const x = obj[key]; + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; + } + + return ret; +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/package.json new file mode 100644 index 0000000..df3940d --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/package.json @@ -0,0 +1,83 @@ +{ + "_from": "pify@^3.0.0", + "_id": "pify@3.0.0", + "_inBundle": false, + "_integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "_location": "/alfred-mvns/alfred-notifier/pify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "pify@^3.0.0", + "name": "pify", + "escapedName": "pify", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier" + ], + "_resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "_shasum": "e5a4acd2c101fdf3d9a4d07f0dbc4db49dd28176", + "_spec": "pify@^3.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/pify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Promisify a callback-style function", + "devDependencies": { + "ava": "*", + "pinkie-promise": "^2.0.0", + "v8-natives": "^1.0.0", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/pify#readme", + "keywords": [ + "promise", + "promises", + "promisify", + "all", + "denodify", + "denodeify", + "callback", + "cb", + "node", + "then", + "thenify", + "convert", + "transform", + "wrap", + "wrapper", + "bind", + "to", + "async", + "await", + "es2015", + "bluebird" + ], + "license": "MIT", + "name": "pify", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/pify.git" + }, + "scripts": { + "optimization-test": "node --allow-natives-syntax optimization-test.js", + "test": "xo && ava && npm run optimization-test" + }, + "version": "3.0.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/readme.md new file mode 100644 index 0000000..376ca4e --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/pify/readme.md @@ -0,0 +1,131 @@ +# pify [![Build Status](https://travis-ci.org/sindresorhus/pify.svg?branch=master)](https://travis-ci.org/sindresorhus/pify) + +> Promisify a callback-style function + + +## Install + +``` +$ npm install --save pify +``` + + +## Usage + +```js +const fs = require('fs'); +const pify = require('pify'); + +// Promisify a single function +pify(fs.readFile)('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); + +// Promisify all methods in a module +pify(fs).readFile('package.json', 'utf8').then(data => { + console.log(JSON.parse(data).name); + //=> 'pify' +}); +``` + + +## API + +### pify(input, [options]) + +Returns a `Promise` wrapped version of the supplied function or module. + +#### input + +Type: `Function` `Object` + +Callback-style function or module whose methods you want to promisify. + +#### options + +##### multiArgs + +Type: `boolean`
+Default: `false` + +By default, the promisified function will only return the second argument from the callback, which works fine for most APIs. This option can be useful for modules like `request` that return multiple arguments. Turning this on will make it return an array of all arguments from the callback, excluding the error argument, instead of just the second argument. This also applies to rejections, where it returns an array of all the callback arguments, including the error. + +```js +const request = require('request'); +const pify = require('pify'); + +pify(request, {multiArgs: true})('https://sindresorhus.com').then(result => { + const [httpResponse, body] = result; +}); +``` + +##### include + +Type: `string[]` `RegExp[]` + +Methods in a module to promisify. Remaining methods will be left untouched. + +##### exclude + +Type: `string[]` `RegExp[]`
+Default: `[/.+(Sync|Stream)$/]` + +Methods in a module **not** to promisify. Methods with names ending with `'Sync'` are excluded by default. + +##### excludeMain + +Type: `boolean`
+Default: `false` + +If given module is a function itself, it will be promisified. Turn this option on if you want to promisify only methods of the module. + +```js +const pify = require('pify'); + +function fn() { + return true; +} + +fn.method = (data, callback) => { + setImmediate(() => { + callback(null, data); + }); +}; + +// Promisify methods but not `fn()` +const promiseFn = pify(fn, {excludeMain: true}); + +if (promiseFn()) { + promiseFn.method('hi').then(data => { + console.log(data); + }); +} +``` + +##### errorFirst + +Type: `boolean`
+Default: `true` + +Whether the callback has an error as the first argument. You'll want to set this to `false` if you're dealing with an API that doesn't have an error as the first argument, like `fs.exists()`, some browser APIs, Chrome Extension APIs, etc. + +##### promiseModule + +Type: `Function` + +Custom promise module to use instead of the native one. + +Check out [`pinkie-promise`](https://github.com/floatdrop/pinkie-promise) if you need a tiny promise polyfill. + + +## Related + +- [p-event](https://github.com/sindresorhus/p-event) - Promisify an event by waiting for it to be emitted +- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently +- [More…](https://github.com/sindresorhus/promise-fun) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/index.js new file mode 100644 index 0000000..dff948b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/index.js @@ -0,0 +1,47 @@ +'use strict'; +const path = require('path'); +const loadJsonFile = require('load-json-file'); +const pathType = require('path-type'); + +module.exports = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } + + opts = opts || {}; + + return pathType.dir(fp) + .then(isDir => { + if (isDir) { + fp = path.join(fp, 'package.json'); + } + + return loadJsonFile(fp); + }) + .then(x => { + if (opts.normalize !== false) { + require('normalize-package-data')(x); + } + + return x; + }); +}; + +module.exports.sync = (fp, opts) => { + if (typeof fp !== 'string') { + opts = fp; + fp = '.'; + } + + opts = opts || {}; + fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp; + + const x = loadJsonFile.sync(fp); + + if (opts.normalize !== false) { + require('normalize-package-data')(x); + } + + return x; +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/package.json new file mode 100644 index 0000000..b17b224 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/package.json @@ -0,0 +1,77 @@ +{ + "_from": "read-pkg@^2.0.0", + "_id": "read-pkg@2.0.0", + "_inBundle": false, + "_integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "_location": "/alfred-mvns/alfred-notifier/read-pkg", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "read-pkg@^2.0.0", + "name": "read-pkg", + "escapedName": "read-pkg", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier" + ], + "_resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "_shasum": "8ef1c0623c6a6db0dc6713c4bfac46332b2368f8", + "_spec": "read-pkg@^2.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/read-pkg/issues" + }, + "bundleDependencies": false, + "dependencies": { + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" + }, + "deprecated": false, + "description": "Read a package.json file", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/read-pkg#readme", + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "pkg", + "package", + "normalize" + ], + "license": "MIT", + "name": "read-pkg", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/read-pkg.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "2.0.0", + "xo": { + "esnext": true + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/readme.md new file mode 100644 index 0000000..5796008 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/read-pkg/readme.md @@ -0,0 +1,79 @@ +# read-pkg [![Build Status](https://travis-ci.org/sindresorhus/read-pkg.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg) + +> Read a package.json file + + +## Why + +- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs) +- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom) +- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json) +- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) + + +## Install + +``` +$ npm install --save read-pkg +``` + + +## Usage + +```js +const readPkg = require('read-pkg'); + +readPkg().then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); + +readPkg(__dirname).then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); + +readPkg(path.join('unicorn', 'package.json')).then(pkg => { + console.log(pkg); + //=> {name: 'read-pkg', ...} +}); +``` + + +## API + +### readPkg([path], [options]) + +Returns a `Promise` for the parsed JSON. + +### readPkg.sync([path], [options]) + +Returns the parsed JSON. + +#### path + +Type: `string`
+Default: `.` + +Path to a `package.json` file or its directory. + +#### options + +##### normalize + +Type: `boolean`
+Default: `true` + +[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data. + + +## Related + +- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file +- [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file +- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/index.js new file mode 100644 index 0000000..b00feb9 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/index.js @@ -0,0 +1,14 @@ +'use strict'; +module.exports = x => { + if (typeof x !== 'string') { + throw new TypeError('Expected a string, got ' + typeof x); + } + + // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string + // conversion translates it to FEFF (UTF-16 BOM) + if (x.charCodeAt(0) === 0xFEFF) { + return x.slice(1); + } + + return x; +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/package.json new file mode 100644 index 0000000..f27c3a0 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/package.json @@ -0,0 +1,72 @@ +{ + "_from": "strip-bom@^3.0.0", + "_id": "strip-bom@3.0.0", + "_inBundle": false, + "_integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "_location": "/alfred-mvns/alfred-notifier/strip-bom", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "strip-bom@^3.0.0", + "name": "strip-bom", + "escapedName": "strip-bom", + "rawSpec": "^3.0.0", + "saveSpec": null, + "fetchSpec": "^3.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfred-notifier/load-json-file" + ], + "_resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "_shasum": "2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3", + "_spec": "strip-bom@^3.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfred-notifier/node_modules/load-json-file", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-bom/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Strip UTF-8 byte order mark (BOM) from a string", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/strip-bom#readme", + "keywords": [ + "strip", + "bom", + "byte", + "order", + "mark", + "unicode", + "utf8", + "utf-8", + "remove", + "delete", + "trim", + "text", + "string" + ], + "license": "MIT", + "name": "strip-bom", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/strip-bom.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "3.0.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/readme.md new file mode 100644 index 0000000..812a980 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/node_modules/strip-bom/readme.md @@ -0,0 +1,36 @@ +# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom) + +> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string + +From Wikipedia: + +> The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8. + + +## Install + +``` +$ npm install --save strip-bom +``` + + +## Usage + +```js +const stripBom = require('strip-bom'); + +stripBom('\uFEFFunicorn'); +//=> 'unicorn' +``` + + +## Related + +- [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module +- [strip-bom-buf](https://github.com/sindresorhus/strip-bom-buf) - Buffer version of this module +- [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/package.json new file mode 100644 index 0000000..ca714db --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/package.json @@ -0,0 +1,100 @@ +{ + "_from": "alfred-notifier@^0.2.0", + "_id": "alfred-notifier@0.2.3", + "_inBundle": false, + "_integrity": "sha512-RB03gRcGKPxiby+1zijbUQslRNfX1uhFCtsudmGd/gaVnTShByAfAKIL+uKNU6VngXjpqCQmeAyUIxdWbsZaAw==", + "_location": "/alfred-mvns/alfred-notifier", + "_phantomChildren": { + "cross-spawn": "5.1.0", + "dot-prop": "4.2.0", + "env-paths": "1.0.0", + "get-stream": "3.0.0", + "graceful-fs": "4.1.11", + "is-stream": "1.1.0", + "mkdirp": "0.5.1", + "normalize-package-data": "2.4.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "parse-json": "2.2.0", + "pkg-up": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + }, + "_requested": { + "type": "range", + "registry": true, + "raw": "alfred-notifier@^0.2.0", + "name": "alfred-notifier", + "escapedName": "alfred-notifier", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfy" + ], + "_resolved": "https://registry.npmjs.org/alfred-notifier/-/alfred-notifier-0.2.3.tgz", + "_shasum": "678816641fff03b0fe0a03f14630a778c057b399", + "_spec": "alfred-notifier@^0.2.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfy", + "author": { + "name": "Sam Verschueren", + "email": "sam.verschueren@gmail.com", + "url": "github.com/SamVerschueren" + }, + "bugs": { + "url": "https://github.com/SamVerschueren/alfred-notifier/issues" + }, + "bundleDependencies": false, + "dependencies": { + "cache-conf": "^0.5.0", + "execa": "^0.8.0", + "latest-version": "^3.1.0", + "pify": "^3.0.0", + "plist": "^2.0.1", + "read-pkg": "^2.0.0", + "semver": "^5.3.0" + }, + "deprecated": false, + "description": "Update notifications for your Alfred workflow", + "devDependencies": { + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "check.js", + "lib" + ], + "homepage": "https://github.com/SamVerschueren/alfred-notifier#readme", + "keywords": [ + "alfred", + "alfy", + "workflow", + "update", + "updater", + "notify", + "notifier", + "module", + "version" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + } + ], + "name": "alfred-notifier", + "repository": { + "type": "git", + "url": "git+https://github.com/SamVerschueren/alfred-notifier.git" + }, + "scripts": { + "test": "xo" + }, + "version": "0.2.3" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/readme.md new file mode 100644 index 0000000..8c739d6 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfred-notifier/readme.md @@ -0,0 +1,50 @@ +# alfred-notifier [![Build Status](https://travis-ci.org/SamVerschueren/alfred-notifier.svg?branch=master)](https://travis-ci.org/SamVerschueren/alfred-notifier) + +> Update notifications for your [Alfred](https://www.alfredapp.com/) workflow + + + + +## Install + +``` +$ npm install --save alfred-notifier +``` + + +## Usage + +### Simple example + +```js +const alfredNotifier = require('alfred-notifier'); + +alfredNotifier(); +``` + +### Comprehensive example + +```js +const alfy = require('alfy'); +const alfredNotifier = require('alfred-notifier'); + +// Checks for available update and updates the `info.plist` +alfredNotifier(); + +alfy.output([ + {title: '🦄'}, + {title: '🌈'} +]); +``` + + +## API + +### alfredNotifier() + +Checks if there is an available update. If an update is available, it will add a message as subtext of your workflow. + + +## License + +MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/cleanup.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/cleanup.js new file mode 100755 index 0000000..ea8c30b --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/cleanup.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node +'use strict'; +const execa = require('execa'); +const npmRunPath = require('npm-run-path'); + +const env = npmRunPath.env({cwd: __dirname}); + +execa('alfred-unlink', {env}).catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/index.js new file mode 100644 index 0000000..3fdc3c7 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/index.js @@ -0,0 +1,164 @@ +'use strict'; +/* eslint-disable dot-notation */ +const os = require('os'); +const Conf = require('conf'); +const got = require('got'); +const hookStd = require('hook-std'); +const loudRejection = require('loud-rejection'); +const cleanStack = require('clean-stack'); +const dotProp = require('dot-prop'); +const CacheConf = require('cache-conf'); +const updateNotification = require('./lib/update-notification'); + +const alfy = module.exports; + +updateNotification(); + +const getIcon = name => `/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/${name}.icns`; +const getEnv = key => process.env[`alfred_${key}`]; + +alfy.meta = { + name: getEnv('workflow_name'), + version: getEnv('workflow_version'), + uid: getEnv('workflow_uid'), + bundleId: getEnv('workflow_bundleid') +}; + +alfy.alfred = { + version: getEnv('version'), + theme: getEnv('theme'), + themeBackground: getEnv('theme_background'), + themeSelectionBackground: getEnv('theme_selection_background'), + themeSubtext: Number(getEnv('theme_subtext')), + data: getEnv('workflow_data'), + cache: getEnv('workflow_cache'), + preferences: getEnv('preferences'), + preferencesLocalHash: getEnv('preferences_localhash') +}; + +alfy.input = process.argv[2]; + +alfy.output = arr => { + console.log(JSON.stringify({items: arr}, null, '\t')); +}; + +alfy.matches = (input, list, item) => { + input = input.toLowerCase().normalize(); + + return list.filter(x => { + if (typeof item === 'string') { + x = dotProp.get(x, item); + } + + if (typeof x === 'string') { + x = x.toLowerCase(); + } + + if (typeof item === 'function') { + return item(x, input); + } + + return x.includes(input); + }); +}; + +alfy.inputMatches = (list, item) => alfy.matches(alfy.input, list, item); + +alfy.log = str => { + if (alfy.debug) { + console.log(str); + } +}; + +alfy.error = err => { + const stack = cleanStack(err.stack || err); + + const copy = ` +\`\`\` +${stack} +\`\`\` + +- +${alfy.meta.name} ${alfy.meta.version} +Alfred ${alfy.alfred.version} +${process.platform} ${process.arch} ${os.release()} + `.trim(); + + alfy.output([{ + title: err.stack ? `${err.name}: ${err.message}` : err, + subtitle: 'Press ⌘L to see the full error and ⌘C to copy it.', + valid: false, + text: { + copy, + largetype: stack + }, + icon: { + path: exports.icon.error + } + }]); +}; + +alfy.config = new Conf({ + cwd: alfy.alfred.data +}); + +alfy.cache = new CacheConf({ + configName: 'cache', + cwd: alfy.alfred.cache, + version: alfy.meta.version +}); + +alfy.fetch = (url, opts) => { + opts = Object.assign({ + json: true + }, opts); + + if (typeof url !== 'string') { + return Promise.reject(new TypeError(`Expected \`url\` to be a \`string\`, got \`${typeof url}\``)); + } + + if (opts.transform && typeof opts.transform !== 'function') { + return Promise.reject(new TypeError(`Expected \`transform\` to be a \`function\`, got \`${typeof opts.transform}\``)); + } + + const rawKey = url + JSON.stringify(opts); + const key = rawKey.replace(/\./g, '\\.'); + const cachedResponse = alfy.cache.store[rawKey] && alfy.cache.store[rawKey].data; + + if (cachedResponse && !alfy.cache.isExpired(key)) { + return Promise.resolve(cachedResponse); + } + + return got(url, opts) + .then(res => opts.transform ? opts.transform(res.body) : res.body) + .then(data => { + if (opts.maxAge) { + alfy.cache.set(key, data, {maxAge: opts.maxAge}); + } + + return data; + }) + .catch(err => { + if (cachedResponse) { + return cachedResponse; + } + + throw err; + }); +}; + +alfy.debug = getEnv('debug') === '1'; + +alfy.icon = { + get: getIcon, + info: getIcon('ToolbarInfo'), + warning: getIcon('AlertCautionIcon'), + error: getIcon('AlertStopIcon'), + alert: getIcon('Actions'), + like: getIcon('ToolbarFavoritesIcon'), + delete: getIcon('ToolbarDeleteIcon') +}; + +loudRejection(alfy.error); +process.on('uncaughtException', alfy.error); +hookStd.stderr(alfy.error); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/init.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/init.js new file mode 100755 index 0000000..5528778 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/init.js @@ -0,0 +1,11 @@ +#!/usr/bin/env node +'use strict'; +const execa = require('execa'); +const npmRunPath = require('npm-run-path'); + +const env = npmRunPath.env({cwd: __dirname}); + +execa('alfred-link', {env}).catch(err => { + console.error(err); + process.exit(1); +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/lib/update-notification.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/lib/update-notification.js new file mode 100644 index 0000000..7a30e49 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/lib/update-notification.js @@ -0,0 +1,13 @@ +'use strict'; +const readPkgUp = require('read-pkg-up'); +const alfredNotifier = require('alfred-notifier'); + +module.exports = () => { + readPkgUp().then(result => { + const alfy = result.pkg.alfy || {}; + + if (alfy.updateNotification !== false) { + alfredNotifier(); + } + }); +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/package.json new file mode 100644 index 0000000..e472bde --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/package.json @@ -0,0 +1,102 @@ +{ + "_from": "alfy@^0.6.0", + "_id": "alfy@0.6.0", + "_inBundle": false, + "_integrity": "sha1-PB3fA+RLPPmkh3r0vOt6zZaDHXE=", + "_location": "/alfred-mvns/alfy", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "alfy@^0.6.0", + "name": "alfy", + "escapedName": "alfy", + "rawSpec": "^0.6.0", + "saveSpec": null, + "fetchSpec": "^0.6.0" + }, + "_requiredBy": [ + "/alfred-mvns" + ], + "_resolved": "https://registry.npmjs.org/alfy/-/alfy-0.6.0.tgz", + "_shasum": "3c1ddf03e44b3cf9a4877af4bceb7acd96831d71", + "_spec": "alfy@^0.6.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bin": { + "run-node": "run-node.sh", + "alfy-init": "init.js", + "alfy-cleanup": "cleanup.js" + }, + "bugs": { + "url": "https://github.com/sindresorhus/alfy/issues" + }, + "bundleDependencies": false, + "dependencies": { + "alfred-link": "^0.2.0", + "alfred-notifier": "^0.2.0", + "cache-conf": "^0.3.0", + "clean-stack": "^1.0.0", + "conf": "^0.11.0", + "dot-prop": "^4.0.0", + "execa": "^0.5.0", + "got": "^6.3.0", + "hook-std": "^0.2.0", + "loud-rejection": "^1.6.0", + "npm-run-path": "^2.0.2", + "read-pkg-up": "^1.0.1" + }, + "deprecated": false, + "description": "Create Alfred workflows with ease", + "devDependencies": { + "ava": "*", + "delay": "^1.3.1", + "nock": "^8.0.0", + "tempfile": "^1.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js", + "init.js", + "cleanup.js", + "run-node.sh", + "lib" + ], + "homepage": "https://github.com/sindresorhus/alfy#readme", + "keywords": [ + "alfred", + "app", + "workflow", + "plugin", + "helper", + "util", + "utility", + "macos", + "mac", + "osx" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sam Verschueren", + "email": "sam.verschueren@gmail.com", + "url": "github.com/SamVerschueren" + } + ], + "name": "alfy", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/alfy.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "0.6.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/readme.md new file mode 100644 index 0000000..55dbd71 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/readme.md @@ -0,0 +1,523 @@ +# ![Alfy](https://cdn.rawgit.com/sindresorhus/alfy/4b50f0323dd99eafdd34523dc8de0680be04e049/media/header.svg) + +> Create [Alfred workflows](https://www.alfredapp.com/workflows/) with ease + +[![Build Status](https://travis-ci.org/sindresorhus/alfy.svg?branch=master)](https://travis-ci.org/sindresorhus/alfy) + + +## Highlights + +- Easy input↔output. +- Config and [cache](#caching) handling built-in. +- Fetching remote files with optional caching. +- Publish your workflow to npm. +- Automatic [update notifications](#update-notifications). +- Easily [testable workflows](#testing). +- [Finds the `node` binary.](run-node.sh) +- Presents uncaught exceptions and unhandled Promise rejections to the user.
+ *No need to manually `.catch()` top-level promises.* + + +## Prerequisites + +You need [Node.js 4+](https://nodejs.org) and [Alfred 3](https://www.alfredapp.com) with the paid [Powerpack](https://www.alfredapp.com/powerpack/) upgrade. + + +## Install + +``` +$ npm install --save alfy +``` + + +## Usage + +Create a new Alfred workflow and add a Script Filter with the following script: + +```sh +./node_modules/.bin/run-node index.js "$1" +``` + +*We can't call `node` directly as GUI apps on macOS doesn't inherit the $PATH.* + +In the workflow directory, create a `index.js` file, import `alfy`, and do your thing. + +> Tip: you can use [generator-alfred](https://github.com/SamVerschueren/generator-alfred) to scaffold out an `alfy` based workflow. + + +## Example + +Here we fetch some JSON from a placeholder API and present matching items to the user: + +```js +const alfy = require('alfy'); + +alfy.fetch('jsonplaceholder.typicode.com/posts').then(data => { + const items = alfy + .inputMatches(data, 'title') + .map(x => ({ + title: x.title, + subtitle: x.body, + arg: x.id + })); + + alfy.output(items); +}); +``` + + + + +###### More + +Some example usage in the wild: [`alfred-npms`](https://github.com/sindresorhus/alfred-npms), [`alfred-emoj`](https://github.com/sindresorhus/alfred-emoj), [`alfred-ng2`](https://github.com/SamVerschueren/alfred-ng2). + + +## Update notifications + +Alfy uses [alfred-notifier](https://github.com/SamVerschueren/alfred-notifier) in the background to show a notification when an update for your workflow is available. + + + + +## Caching + +Alfy offers the possibility of caching data, either with the [fetch](#fetchurl-options) or directly through the [cache](#cache) object. + +An important thing to note is that the cached data gets invalidated automatically when you update your workflow. This offers the flexibility for developers to change the structure of the cached data between workflows without having to worry about invalid older data. + + +## Publish to npm + +By adding `alfy-init` as `postinstall` and `alfy-cleanup` as `preuninstall` script, you can publish your package to [npm](https://npmjs.org) instead of to [Packal](http://www.packal.org). This way, your packages are only one simple `npm install` command away. + +```json +{ + "name": "alfred-unicorn", + "version": "1.0.0", + "description": "My awesome unicorn workflow", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "scripts": { + "postinstall": "alfy-init", + "preuninstall": "alfy-cleanup" + }, + "dependencies": { + "alfy": "*" + } +} +``` + +> Tip: Prefix your workflow with `alfred-` to make them easy searchable through npm. + +You can remove [these](https://github.com/samverschueren/alfred-link#infoplist) properties from your `info.plist` file as they are being added automatically at install time. + +After publishing your workflow to npm, your users can easily install or update the workflow. + +``` +$ npm install --global alfred-unicorn +``` + +> Tip: instead of manually updating every workflow yourself, use the [alfred-updater](https://github.com/SamVerschueren/alfred-updater) workflow to do that for you. + + +## Testing + +Workflows can easily be tested with [alfy-test](https://github.com/SamVerschueren/alfy-test). Here is a small example. + +```js +import test from 'ava'; +import alfyTest from 'alfy-test'; + +test(async t => { + const alfy = alfyTest(); + + const result = await alfy('workflow input'); + + t.deepEqual(result, [ + { + title: 'foo', + subtitle: 'bar' + } + ]); +}); +``` + + +## API + +### alfy + +#### input + +Type: `string` + +Input from Alfred. What the user wrote in the input box. + +#### output(list) + +Return output to Alfred. + +##### list + +Type: `Array` + +List of `Object` with any of the [supported properties](https://www.alfredapp.com/help/workflows/inputs/script-filter/json/). + +Example: + +```js +alfy.output([{ + title: 'Unicorn' +}, { + title: 'Rainbow' +}]); +``` + + + +#### matches(input, list, [item]) + +Returns an `Array` of items in `list` that case-insensitively contains `input`. + +```js +alfy.matches('Corn', ['foo', 'unicorn']); +//=> ['unicorn'] +``` + +##### input + +Type: `string` + +Text to match against the `list` items. + +##### list + +Type: `Array` + +List to be matched against. + +##### item + +Type: `string` `Function` + +By default it will match against the `list` items. + +Specify a string to match against an object property: + +```js +const list = [{ + title: 'foo' +}, { + title: 'unicorn' +}]; + +alfy.matches('Unicorn', list, 'title'); +//=> [{title: 'unicorn'}] +``` + +Or [nested property](https://github.com/sindresorhus/dot-prop): + +```js +const list = [{ + name: { + first: 'John', + last: 'Doe' + } +}, { + name: { + first: 'Sindre', + last: 'Sorhus' + } +}]; + +alfy.matches('sindre', list, 'name.first'); +//=> [{name: {first: 'Sindre', last: 'Sorhus'}}] +``` + +Specify a function to handle the matching yourself. The function receives the list item and input, both lowercased, as arguments, and is expected to return a boolean whether it matches: + +```js +const list = ['foo', 'unicorn']; + +// here we do an exact match +// `Foo` matches the item since it's lowercased for you +alfy.matches('Foo', list, (item, input) => item === input); +//=> ['foo'] +``` + +#### inputMatches(list, [item]) + +Same as `matches()`, but with `alfy.input` as `input`. + +#### log(text) + +##### text + +Type: `string` + +Text to be logged to the debug panel. Only logs when `alfred.debug` is `true`, so not to interfere with the normal output. + +#### error(err) + +Display an error or error message in Alfred. + +**Note:** You don't need to `.catch()` top-level promises. Alfy handles that for you. + +##### err + +Type: `Error` `string` + +Error or error message to be displayed. + + + +#### fetch(url, [options]) + +Returns a `Promise` that returns the body of the response. + +##### url + +Type: `string` + +URL to fetch. + +##### options + +Type: `Object` + +Any of the [`got` options](https://github.com/sindresorhus/got#options). + +###### json + +Type: `boolean`
+Default: `true` + +Parse response body with `JSON.parse` and set `accept` header to `application/json`. + +###### maxAge + +Type: `number` + +Number of milliseconds this request should be cached. + +###### transform + +Type: `Function` + +Transform the response before it gets cached. + +```js +alfy.fetch('https://api.foo.com', { + transform: body => { + body.foo = 'bar'; + return body; + } +}) +``` + +You can also return a Promise. + +```js +const xml2js = require('xmls2js'); +const pify = require('pify'); + +const parseString = pify(xml2js.parseString); + +alfy.fetch('https://api.foo.com', { + transform: body => parseString(body) +}) +``` + +#### config + +Type: `Object` + +Persist config data. + +Exports a [`conf` instance](https://github.com/sindresorhus/conf#instance) with the correct config path set. + +Example: + +```js +alfy.config.set('unicorn', '🦄'); + +alfy.config.get('unicorn'); +//=> '🦄' +``` + +#### cache + +Type: `Object` + +Persist cache data. + +Exports a modified [`conf` instance](https://github.com/sindresorhus/conf#instance) with the correct cache path set. + +Example: + +```js +alfy.cache.set('unicorn', '🦄'); + +alfy.cache.get('unicorn'); +//=> '🦄' +``` + +##### maxAge + +The `set` method of this instance accepts an optional third argument where you can provide a `maxAge` option. `maxAge` is +the number of milliseconds the value is valid in the cache. + +Example: + +```js +const delay = require('delay'); + +alfy.cache.set('foo', 'bar', {maxAge: 5000}); + +alfy.cache.get('foo'); +//=> 'bar' + +// Wait 5 seconds +await delay(5000); + +alfy.cache.get('foo'); +//=> undefined +``` + +#### debug + +Type: `boolean` + +Whether the user currently has the [workflow debugger](https://www.alfredapp.com/help/workflows/advanced/debugger/) open. + +#### icon + +Type: `Object`
+Keys: `info` `warning` `error` `alert` `like` `delete` + +Get various default system icons. + +The most useful ones are included as keys. The rest you can get with `icon.get()`. Go to `/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources` in Finder to see them all. + +Example: + +```js +console.log(alfy.icon.error); +//=> '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns' + +console.log(alfy.icon.get('Clock')); +//=> '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/Clock.icns' +``` + +#### meta + +Type: `Object` + +Example: + +```js +{ + name: 'Emoj', + version: '0.2.5', + uid: 'user.workflow.B0AC54EC-601C-479A-9428-01F9FD732959', + bundleId: 'com.sindresorhus.emoj' +} +``` + +#### alfred + +Type: `Object` + +Alfred metadata. + +##### version + +Example: `'3.0.2'` + +Find out which version the user is currently running. This may be useful if your workflow depends on a particular Alfred version's features. + +##### theme + +Example: `'alfred.theme.yosemite'` + +Current theme used. + +##### themeBackground + +Example: `'rgba(255,255,255,0.98)'` + +If you're creating icons on the fly, this allows you to find out the color of the theme background. + +##### themeSelectionBackground + +Example: `'rgba(255,255,255,0.98)'` + +The color of the selected result. + +##### themeSubtext + +Example: `3` + +Find out what subtext mode the user has selected in the Appearance preferences. + +> Usability note: This is available so developers can tweak the result text based on the user's selected mode, but a workflow's result text should not be bloated unnecessarily based on this, as the main reason users generally hide the subtext is to make Alfred look cleaner. + +##### data + +Example: `'/Users/sindresorhus/Library/Application Support/Alfred 3/Workflow Data/com.sindresorhus.npms'` + +Recommended location for non-volatile data. Just use `alfy.data` which uses this path. + +##### cache + +Example: `'/Users/sindresorhus/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.sindresorhus.npms'` + +Recommended location for volatile data. Just use `alfy.cache` which uses this path. + +##### preferences + +Example: `'/Users/sindresorhus/Dropbox/Alfred/Alfred.alfredpreferences'` + +This is the location of the `Alfred.alfredpreferences`. If a user has synced their settings, this will allow you to find out where their settings are regardless of sync state. + +##### preferencesLocalHash + +Example: `'adbd4f66bc3ae8493832af61a41ee609b20d8705'` + +Non-synced local preferences are stored within `Alfred.alfredpreferences` under `…/preferences/local/${preferencesLocalHash}/`. + + +## Users + +*Alfred workflows using Alfy* + +- [alfred-emoj](https://github.com/sindresorhus/alfred-emoj) - Find relevant emoji from text +- [alfred-npms](https://github.com/sindresorhus/alfred-npms) - Search for npm packages with npms.io +- [alfred-ng2](https://github.com/SamVerschueren/alfred-ng2) - Search for Angular 2 API references +- [alfred-react-native](https://github.com/ekonstantinidis/alfred-react-native) - Access the React Native documentation +- [alfred-hl](https://github.com/importre/alfred-hl) - Syntax highlight code in the clipboard +- [alfred-workflow-docs-elastic](https://github.com/spinscale/alfred-workflow-elastic-docs) - Search the Elastic.co documentation +- [alfredinary](https://github.com/urre/alfredinary) - Capture screenshots and upload to Cloudinary + + +## Related + +- [alfred-simple](https://github.com/sindresorhus/alfred-simple) - Simple theme for Alfred *(Used in the screenshots)* +- [alfred-updater](https://github.com/SamVerschueren/alfred-updater) - Workflow updater +- [alfred-notifier](https://github.com/SamVerschueren/alfred-notifier) - Update notifications for your workflow +- [generator-alfred](https://github.com/samverschueren/generator-alfred) - Scaffold out an Alfred workflow + + +## Created by + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Sam Verschueren](https://github.com/SamVerschueren) + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/run-node.sh b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/run-node.sh new file mode 100755 index 0000000..bff9d95 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/alfy/run-node.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +if [[ -z "$alfred_workflow_cache" ]]; then + echo "This script must be called from Alfred, \$alfred_workflow_cache is missing. Make sure a Bundle ID is set." + exit 1 +fi + +if [[ ! -d "$alfred_workflow_cache" ]]; then + mkdir -p "$alfred_workflow_cache" +fi + +PATH_CACHE="$alfred_workflow_cache"/node_path + +get_user_path() { + eval $(/usr/libexec/path_helper -s) + echo "$($SHELL -i -l -c 'echo -e "\n"PATH=\"$PATH:\$PATH\""\n"' 2>/dev/null | grep "^PATH=")" > "$PATH_CACHE" +} + +set_path() { + if [[ -f "$PATH_CACHE" ]]; then + . "$PATH_CACHE" + else + get_user_path + . "$PATH_CACHE" + fi + + export PATH +} + +has_node() { + command -v node >/dev/null 2>&1 +} + +# check if we have node, otherwise inherit path from user shell +if ! has_node; then + set_path + + # retry by deleting old path cache + if ! has_node; then + rm "$PATH_CACHE" + set_path + fi +fi + +if has_node; then + node "$@" +else + echo $'{"items":[{"title": "Couldn\'t find the `node` binary", "subtitle": "Symlink it to `/usr/local/bin`"}]}' +fi diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/index.js new file mode 100644 index 0000000..b9574ed --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/package.json new file mode 100644 index 0000000..aa85b61 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/package.json @@ -0,0 +1,109 @@ +{ + "_from": "ansi-regex@^2.0.0", + "_id": "ansi-regex@2.1.1", + "_inBundle": false, + "_integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "_location": "/alfred-mvns/ansi-regex", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-regex@^2.0.0", + "name": "ansi-regex", + "escapedName": "ansi-regex", + "rawSpec": "^2.0.0", + "saveSpec": null, + "fetchSpec": "^2.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/has-ansi", + "/alfred-mvns/strip-ansi" + ], + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "_shasum": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "_spec": "ansi-regex@^2.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/has-ansi", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-regex/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Regular expression for matching ANSI escape codes", + "devDependencies": { + "ava": "0.17.0", + "xo": "0.16.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-regex#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "ansi-regex", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-regex.git" + }, + "scripts": { + "test": "xo && ava --verbose", + "view-supported": "node fixtures/view-codes.js" + }, + "version": "2.1.1", + "xo": { + "rules": { + "guard-for-in": 0, + "no-loop-func": 0 + } + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/readme.md new file mode 100644 index 0000000..6a928ed --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-regex/readme.md @@ -0,0 +1,39 @@ +# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +``` +$ npm install --save ansi-regex +``` + + +## Usage + +```js +const ansiRegex = require('ansi-regex'); + +ansiRegex().test('\u001b[4mcake\u001b[0m'); +//=> true + +ansiRegex().test('cake'); +//=> false + +'\u001b[4mcake\u001b[0m'.match(ansiRegex()); +//=> ['\u001b[4m', '\u001b[0m'] +``` + +## FAQ + +### Why do you test for codes not in the ECMA 48 standard? + +Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. If I recall correctly, we test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them. + +On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/index.js new file mode 100644 index 0000000..7894527 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/index.js @@ -0,0 +1,65 @@ +'use strict'; + +function assembleStyles () { + var styles = { + modifiers: { + reset: [0, 0], + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + colors: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39] + }, + bgColors: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49] + } + }; + + // fix humans + styles.colors.grey = styles.colors.gray; + + Object.keys(styles).forEach(function (groupName) { + var group = styles[groupName]; + + Object.keys(group).forEach(function (styleName) { + var style = group[styleName]; + + styles[styleName] = group[styleName] = { + open: '\u001b[' + style[0] + 'm', + close: '\u001b[' + style[1] + 'm' + }; + }); + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + }); + + return styles; +} + +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/package.json new file mode 100644 index 0000000..01d28b1 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/package.json @@ -0,0 +1,90 @@ +{ + "_from": "ansi-styles@^2.2.1", + "_id": "ansi-styles@2.2.1", + "_inBundle": false, + "_integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "_location": "/alfred-mvns/ansi-styles", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "ansi-styles@^2.2.1", + "name": "ansi-styles", + "escapedName": "ansi-styles", + "rawSpec": "^2.2.1", + "saveSpec": null, + "fetchSpec": "^2.2.1" + }, + "_requiredBy": [ + "/alfred-mvns/chalk" + ], + "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "_shasum": "b432dd3358b634cf75e1e4664368240533c1ddbe", + "_spec": "ansi-styles@^2.2.1", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/chalk", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/chalk/ansi-styles/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ANSI escape codes for styling strings in the terminal", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/ansi-styles#readme", + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + } + ], + "name": "ansi-styles", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/ansi-styles.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "2.2.1" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/readme.md new file mode 100644 index 0000000..3f933f6 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/ansi-styles/readme.md @@ -0,0 +1,86 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + +![](screenshot.png) + + +## Install + +``` +$ npm install --save ansi-styles +``` + + +## Usage + +```js +var ansi = require('ansi-styles'); + +console.log(ansi.green.open + 'Hello world!' + ansi.green.close); +``` + + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` + + +## Advanced usage + +By default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `ansi.modifiers` +- `ansi.colors` +- `ansi.bgColors` + + +###### Example + +```js +console.log(ansi.colors.green.open); +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/index.js new file mode 100644 index 0000000..e2dcd9a --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/index.js @@ -0,0 +1,25 @@ +'use strict'; +module.exports = function (arr, predicate, ctx) { + if (typeof Array.prototype.findIndex === 'function') { + return arr.findIndex(predicate, ctx); + } + + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + + var list = Object(arr); + var len = list.length; + + if (len === 0) { + return -1; + } + + for (var i = 0; i < len; i++) { + if (predicate.call(ctx, list[i], i, list)) { + return i; + } + } + + return -1; +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/package.json new file mode 100644 index 0000000..c5ed82e --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/package.json @@ -0,0 +1,67 @@ +{ + "_from": "array-find-index@^1.0.1", + "_id": "array-find-index@1.0.2", + "_inBundle": false, + "_integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "_location": "/alfred-mvns/array-find-index", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "array-find-index@^1.0.1", + "name": "array-find-index", + "escapedName": "array-find-index", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/alfred-mvns/currently-unhandled" + ], + "_resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "_shasum": "df010aa1287e164bbda6f9723b0a96a1ec4187a1", + "_spec": "array-find-index@^1.0.1", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/currently-unhandled", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/array-find-index/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "ES2015 `Array#findIndex()` ponyfill", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/array-find-index#readme", + "keywords": [ + "es2015", + "ponyfill", + "polyfill", + "shim", + "find", + "index", + "findindex", + "array" + ], + "license": "MIT", + "name": "array-find-index", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/array-find-index.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/readme.md new file mode 100644 index 0000000..3166341 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-find-index/readme.md @@ -0,0 +1,30 @@ +# array-find-index [![Build Status](https://travis-ci.org/sindresorhus/array-find-index.svg?branch=master)](https://travis-ci.org/sindresorhus/array-find-index) + +> ES2015 [`Array#findIndex()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex) [ponyfill](https://ponyfill.com) + + +## Install + +``` +$ npm install --save array-find-index +``` + + +## Usage + +```js +const arrayFindIndex = require('array-find-index'); + +arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn'); +//=> 1 +``` + + +## API + +Same as `Array#findIndex()`, but with the input array as the first argument. + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/index.js new file mode 100644 index 0000000..e33f38a --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/index.js @@ -0,0 +1,6 @@ +'use strict'; +var arrayUniq = require('array-uniq'); + +module.exports = function () { + return arrayUniq([].concat.apply([], arguments)); +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/package.json new file mode 100644 index 0000000..d45a73a --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/package.json @@ -0,0 +1,72 @@ +{ + "_from": "array-union@^1.0.1", + "_id": "array-union@1.0.2", + "_inBundle": false, + "_integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "_location": "/alfred-mvns/array-union", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "array-union@^1.0.1", + "name": "array-union", + "escapedName": "array-union", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/alfred-mvns/globby" + ], + "_resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "_shasum": "9a34410e4f4e3da23dea375be5be70f24778ec39", + "_spec": "array-union@^1.0.1", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/globby", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/array-union/issues" + }, + "bundleDependencies": false, + "dependencies": { + "array-uniq": "^1.0.1" + }, + "deprecated": false, + "description": "Create an array of unique values, in order, from the input arrays", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/array-union#readme", + "keywords": [ + "array", + "arr", + "set", + "uniq", + "unique", + "duplicate", + "remove", + "union", + "combine", + "merge" + ], + "license": "MIT", + "name": "array-union", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/array-union.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/readme.md new file mode 100644 index 0000000..ea472dd --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-union/readme.md @@ -0,0 +1,28 @@ +# array-union [![Build Status](https://travis-ci.org/sindresorhus/array-union.svg?branch=master)](https://travis-ci.org/sindresorhus/array-union) + +> Create an array of unique values, in order, from the input arrays + + +## Install + +``` +$ npm install --save array-union +``` + + +## Usage + +```js +const arrayUnion = require('array-union'); + +arrayUnion([1, 1, 2, 3], [2, 3]); +//=> [1, 2, 3] + +arrayUnion(['foo', 'foo', 'bar'], ['foo']); +//=> ['foo', 'bar'] +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/index.js new file mode 100644 index 0000000..edd09f8 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/index.js @@ -0,0 +1,62 @@ +'use strict'; + +// there's 3 implementations written in increasing order of efficiency + +// 1 - no Set type is defined +function uniqNoSet(arr) { + var ret = []; + + for (var i = 0; i < arr.length; i++) { + if (ret.indexOf(arr[i]) === -1) { + ret.push(arr[i]); + } + } + + return ret; +} + +// 2 - a simple Set type is defined +function uniqSet(arr) { + var seen = new Set(); + return arr.filter(function (el) { + if (!seen.has(el)) { + seen.add(el); + return true; + } + + return false; + }); +} + +// 3 - a standard Set type is defined and it has a forEach method +function uniqSetWithForEach(arr) { + var ret = []; + + (new Set(arr)).forEach(function (el) { + ret.push(el); + }); + + return ret; +} + +// V8 currently has a broken implementation +// https://github.com/joyent/node/issues/8449 +function doesForEachActuallyWork() { + var ret = false; + + (new Set([true])).forEach(function (el) { + ret = el; + }); + + return ret === true; +} + +if ('Set' in global) { + if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) { + module.exports = uniqSetWithForEach; + } else { + module.exports = uniqSet; + } +} else { + module.exports = uniqNoSet; +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/package.json new file mode 100644 index 0000000..ca27eb9 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/package.json @@ -0,0 +1,69 @@ +{ + "_from": "array-uniq@^1.0.1", + "_id": "array-uniq@1.0.3", + "_inBundle": false, + "_integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "_location": "/alfred-mvns/array-uniq", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "array-uniq@^1.0.1", + "name": "array-uniq", + "escapedName": "array-uniq", + "rawSpec": "^1.0.1", + "saveSpec": null, + "fetchSpec": "^1.0.1" + }, + "_requiredBy": [ + "/alfred-mvns/array-union" + ], + "_resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "_shasum": "af6ac877a25cc7f74e058894753858dfdb24fdb6", + "_spec": "array-uniq@^1.0.1", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/array-union", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/array-uniq/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Create an array without duplicates", + "devDependencies": { + "ava": "*", + "es6-set": "^0.1.0", + "require-uncached": "^1.0.2", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/array-uniq#readme", + "keywords": [ + "array", + "arr", + "set", + "uniq", + "unique", + "es6", + "duplicate", + "remove" + ], + "license": "MIT", + "name": "array-uniq", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/array-uniq.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.3" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/readme.md new file mode 100644 index 0000000..f0bd98c --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/array-uniq/readme.md @@ -0,0 +1,30 @@ +# array-uniq [![Build Status](https://travis-ci.org/sindresorhus/array-uniq.svg?branch=master)](https://travis-ci.org/sindresorhus/array-uniq) + +> Create an array without duplicates + +It's already pretty fast, but will be much faster when [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) becomes available in V8 (especially with large arrays). + + +## Install + +``` +$ npm install --save array-uniq +``` + + +## Usage + +```js +const arrayUniq = require('array-uniq'); + +arrayUniq([1, 1, 2, 3, 3]); +//=> [1, 2, 3] + +arrayUniq(['foo', 'foo', 'bar', 'foo']); +//=> ['foo', 'bar'] +``` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/index.js new file mode 100644 index 0000000..2a2fdee --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/index.js @@ -0,0 +1,8 @@ +'use strict'; +module.exports = function (val) { + if (val === null || val === undefined) { + return []; + } + + return Array.isArray(val) ? val : [val]; +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/package.json new file mode 100644 index 0000000..cc9b0e1 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/package.json @@ -0,0 +1,65 @@ +{ + "_from": "arrify@^1.0.0", + "_id": "arrify@1.0.1", + "_inBundle": false, + "_integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "_location": "/alfred-mvns/arrify", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "arrify@^1.0.0", + "name": "arrify", + "escapedName": "arrify", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/globby" + ], + "_resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "_shasum": "898508da2226f380df904728456849c1501a4b0d", + "_spec": "arrify@^1.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/globby", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/arrify/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Convert a value to an array", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/arrify#readme", + "keywords": [ + "array", + "arr", + "arrify", + "arrayify", + "convert", + "value" + ], + "license": "MIT", + "name": "arrify", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/arrify.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.1" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/readme.md new file mode 100644 index 0000000..183d075 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/arrify/readme.md @@ -0,0 +1,36 @@ +# arrify [![Build Status](https://travis-ci.org/sindresorhus/arrify.svg?branch=master)](https://travis-ci.org/sindresorhus/arrify) + +> Convert a value to an array + + +## Install + +``` +$ npm install --save arrify +``` + + +## Usage + +```js +const arrify = require('arrify'); + +arrify('unicorn'); +//=> ['unicorn'] + +arrify(['unicorn']); +//=> ['unicorn'] + +arrify(null); +//=> [] + +arrify(undefined); +//=> [] +``` + +*Supplying `null` or `undefined` results in an empty array.* + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/.npmignore b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/.npmignore new file mode 100644 index 0000000..ae5d8c3 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/LICENSE.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/LICENSE.md new file mode 100644 index 0000000..2cdc8e4 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/LICENSE.md @@ -0,0 +1,21 @@ +(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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/README.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/README.md new file mode 100644 index 0000000..08e918c --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/README.md @@ -0,0 +1,91 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## 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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/index.js new file mode 100644 index 0000000..1685a76 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/index.js @@ -0,0 +1,59 @@ +'use strict'; +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/package.json new file mode 100644 index 0000000..8b31642 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/balanced-match/package.json @@ -0,0 +1,77 @@ +{ + "_from": "balanced-match@^1.0.0", + "_id": "balanced-match@1.0.0", + "_inBundle": false, + "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "_location": "/alfred-mvns/balanced-match", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "balanced-match@^1.0.0", + "name": "balanced-match", + "escapedName": "balanced-match", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767", + "_spec": "balanced-match@^1.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "name": "balanced-match", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "bench": "make bench", + "test": "make test" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.0.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/LICENSE b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/LICENSE new file mode 100644 index 0000000..96d3f68 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/README.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/README.md new file mode 100644 index 0000000..e546d86 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/README.md @@ -0,0 +1,32 @@ +base64-js +========= + +`base64-js` does basic base64 encoding/decoding in pure JS. + +[![build status](https://secure.travis-ci.org/beatgammit/base64-js.png)](http://travis-ci.org/beatgammit/base64-js) + +[![testling badge](https://ci.testling.com/beatgammit/base64-js.png)](https://ci.testling.com/beatgammit/base64-js) + +Many browsers already have base64 encoding/decoding functionality, but it is for text data, not all-purpose binary data. + +Sometimes encoding/decoding binary data in the browser is useful, and that is what this module does. + +## install + +With [npm](https://npmjs.org) do: + +`npm install base64-js` + +## methods + +`var base64 = require('base64-js')` + +`base64` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument. + +* `byteLength` - Takes a base64 string and returns length of byte array +* `toByteArray` - Takes a base64 string and returns a byte array +* `fromByteArray` - Takes a byte array and returns a base64 string + +## license + +MIT diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/base64js.min.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/base64js.min.js new file mode 100644 index 0000000..22ad807 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/base64js.min.js @@ -0,0 +1 @@ +(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,t;return function r(e,t,n){function o(i,a){if(!t[i]){if(!e[i]){var u=typeof require=="function"&&require;if(!a&&u)return u(i,!0);if(f)return f(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var c=t[i]={exports:{}};e[i][0].call(c.exports,function(r){var t=e[i][1][r];return o(t?t:r)},c,c.exports,r,e,t,n)}return t[i].exports}var f=typeof require=="function"&&require;for(var i=0;i0){throw new Error("Invalid string. Length must be a multiple of 4")}return r[e-2]==="="?2:r[e-1]==="="?1:0}function c(r){return r.length*3/4-d(r)}function v(r){var e,t,n,i,a,u;var c=r.length;a=d(r);u=new f(c*3/4-a);n=a>0?c-4:c;var v=0;for(e=0,t=0;e>16&255;u[v++]=i>>8&255;u[v++]=i&255}if(a===2){i=o[r.charCodeAt(e)]<<2|o[r.charCodeAt(e+1)]>>4;u[v++]=i&255}else if(a===1){i=o[r.charCodeAt(e)]<<10|o[r.charCodeAt(e+1)]<<4|o[r.charCodeAt(e+2)]>>2;u[v++]=i>>8&255;u[v++]=i&255}return u}function l(r){return n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[r&63]}function h(r,e,t){var n;var o=[];for(var f=e;fd?d:u+a))}if(o===1){e=r[t-1];f+=n[e>>2];f+=n[e<<4&63];f+="=="}else if(o===2){e=(r[t-2]<<8)+r[t-1];f+=n[e>>10];f+=n[e>>4&63];f+=n[e<<2&63];f+="="}i.push(f);return i.join("")}},{}]},{},[])("/")}); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/index.js new file mode 100644 index 0000000..8e806ac --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/index.js @@ -0,0 +1,114 @@ +'use strict' + +exports.byteLength = byteLength +exports.toByteArray = toByteArray +exports.fromByteArray = fromByteArray + +var lookup = [] +var revLookup = [] +var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array + +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i +} + +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 + +function placeHoldersCount (b64) { + var len = b64.length + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 +} + +function byteLength (b64) { + // base64 is 4/3 + up to two characters of the original data + return b64.length * 3 / 4 - placeHoldersCount(b64) +} + +function toByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) + + arr = new Arr(len * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? len - 4 : len + + var L = 0 + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] + arr[L++] = (tmp >> 16) & 0xFF + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + if (placeHolders === 2) { + tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) + arr[L++] = tmp & 0xFF + } else if (placeHolders === 1) { + tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) + arr[L++] = (tmp >> 8) & 0xFF + arr[L++] = tmp & 0xFF + } + + return arr +} + +function tripletToBase64 (num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] +} + +function encodeChunk (uint8, start, end) { + var tmp + var output = [] + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output.push(tripletToBase64(tmp)) + } + return output.join('') +} + +function fromByteArray (uint8) { + var tmp + var len = uint8.length + var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes + var output = '' + var parts = [] + var maxChunkLength = 16383 // must be multiple of 3 + + // go through the array every three bytes, we'll deal with trailing stuff later + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + if (extraBytes === 1) { + tmp = uint8[len - 1] + output += lookup[tmp >> 2] + output += lookup[(tmp << 4) & 0x3F] + output += '==' + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) + output += lookup[tmp >> 10] + output += lookup[(tmp >> 4) & 0x3F] + output += lookup[(tmp << 2) & 0x3F] + output += '=' + } + + parts.push(output) + + return parts.join('') +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/package.json new file mode 100644 index 0000000..0987c65 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/package.json @@ -0,0 +1,65 @@ +{ + "_from": "base64-js@1.2.0", + "_id": "base64-js@1.2.0", + "_inBundle": false, + "_integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=", + "_location": "/alfred-mvns/base64-js", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "base64-js@1.2.0", + "name": "base64-js", + "escapedName": "base64-js", + "rawSpec": "1.2.0", + "saveSpec": null, + "fetchSpec": "1.2.0" + }, + "_requiredBy": [ + "/alfred-mvns/plist" + ], + "_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz", + "_shasum": "a39992d723584811982be5e290bb6a53d86700f1", + "_spec": "base64-js@1.2.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/plist", + "author": { + "name": "T. Jameson Little", + "email": "t.jameson.little@gmail.com" + }, + "bugs": { + "url": "https://github.com/beatgammit/base64-js/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "Base64 encoding/decoding in pure JS", + "devDependencies": { + "benchmark": "^2.1.0", + "browserify": "^13.0.0", + "standard": "*", + "tape": "4.x", + "uglify-js": "^2.6.2" + }, + "files": [ + "test", + "index.js", + "base64js.min.js" + ], + "homepage": "https://github.com/beatgammit/base64-js", + "keywords": [ + "base64" + ], + "license": "MIT", + "main": "index.js", + "name": "base64-js", + "repository": { + "type": "git", + "url": "git://github.com/beatgammit/base64-js.git" + }, + "scripts": { + "build": "browserify -s base64js -r ./ | uglifyjs -m > base64js.min.js", + "lint": "standard", + "test": "npm run lint && npm run unit", + "unit": "tape test/*.js" + }, + "version": "1.2.0" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/big-data.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/big-data.js new file mode 100644 index 0000000..be16ebe --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/big-data.js @@ -0,0 +1,24 @@ +var test = require('tape') +var b64 = require('../') + +test('convert big data to base64', function (t) { + var b64str, arr, i, length + var big = new Uint8Array(64 * 1024 * 1024) + for (i = 0, length = big.length; i < length; ++i) { + big[i] = i % 256 + } + b64str = b64.fromByteArray(big) + arr = b64.toByteArray(b64str) + t.ok(equal(arr, big)) + t.end() +}) + +function equal (a, b) { + var i + var length = a.length + if (length !== b.length) return false + for (i = 0; i < length; ++i) { + if (a[i] !== b[i]) return false + } + return true +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/convert.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/convert.js new file mode 100644 index 0000000..d68e105 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/convert.js @@ -0,0 +1,48 @@ +var test = require('tape') +var b64 = require('../') +var checks = [ + 'a', + 'aa', + 'aaa', + 'hi', + 'hi!', + 'hi!!', + 'sup', + 'sup?', + 'sup?!' +] + +test('convert to base64 and back', function (t) { + t.plan(checks.length * 2) + + for (var i = 0; i < checks.length; i++) { + var check = checks[i] + var b64Str, arr, str + + b64Str = b64.fromByteArray(map(check, function (char) { return char.charCodeAt(0) })) + + arr = b64.toByteArray(b64Str) + str = map(arr, function (byte) { return String.fromCharCode(byte) }).join('') + + t.equal(check, str, 'Checked ' + check) + t.equal(b64.byteLength(b64Str), arr.length, 'Checked length for ' + check) + } +}) + +function map (arr, callback) { + var res = [] + var kValue, mappedValue + + for (var k = 0, len = arr.length; k < len; k++) { + if ((typeof arr === 'string' && !!arr.charAt(k))) { + kValue = arr.charAt(k) + mappedValue = callback(kValue, k, arr) + res[k] = mappedValue + } else if (typeof arr !== 'string' && k in arr) { + kValue = arr[k] + mappedValue = callback(kValue, k, arr) + res[k] = mappedValue + } + } + return res +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/url-safe.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/url-safe.js new file mode 100644 index 0000000..3203b33 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/base64-js/test/url-safe.js @@ -0,0 +1,18 @@ +var test = require('tape') +var b64 = require('../') + +test('decode url-safe style base64 strings', function (t) { + var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff] + + var actual = b64.toByteArray('//++/++/++//') + for (var i = 0; i < actual.length; i++) { + t.equal(actual[i], expected[i]) + } + + actual = b64.toByteArray('__--_--_--__') + for (i = 0; i < actual.length; i++) { + t.equal(actual[i], expected[i]) + } + + t.end() +}) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.d.ts b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.d.ts new file mode 100644 index 0000000..c3976e8 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.d.ts @@ -0,0 +1,2385 @@ +/** + * Type definitions for BigInteger.js + * Definitions by: Tommy Frazier + */ +export = bigInt; +export as namespace bigInt; + +declare var bigInt: bigInt.BigIntegerStatic; + +declare namespace bigInt { + type BigNumber = number | string | BigInteger; + + interface BigIntegerStatic { + /** + * Equivalent to bigInt(0). + */ + (): BigInteger; + + /** + * Parse a Javascript number into a bigInt. + */ + (number: number): BigInteger; + + /** + * Parse a string into a bigInt. + */ + (string: string, base?: BigNumber): BigInteger; + + /** + * no-op. + */ + (bigInt: BigInteger): BigInteger; + + /** + * Constructs a bigInt from an array of digits in specified base. + * The optional isNegative flag will make the number negative. + */ + fromArray: (digits: BigNumber[], base?: BigNumber, isNegative?: boolean) => BigInteger; + + /** + * Finds the greatest common denominator of a and b. + */ + gcd: (a: BigNumber, b: BigNumber) => BigInteger; + + + /** + * Returns true if x is a BigInteger, false otherwise. + */ + isInstance: (x: any) => boolean; + + /** + * Finds the least common multiple of a and b. + */ + lcm: (a: BigNumber, b: BigNumber) => BigInteger; + + /** + * Returns the largest of a and b. + */ + max: (a: BigNumber, b: BigNumber) => BigInteger; + + /** + * Returns the smallest of a and b. + */ + min: (a: BigNumber, b: BigNumber) => BigInteger; + + /** + * Equivalent to bigInt(-1). + */ + minusOne: BigInteger; + + /** + * Equivalent to bigInt(1). + */ + one: BigInteger; + + /** + * Returns a random number between min and max. + */ + randBetween: (min: BigNumber, max: BigNumber) => BigInteger; + + /** + * Equivalent to bigInt(0). + */ + zero: BigInteger; + } + + interface BigInteger { + /** + * Returns the absolute value of a bigInt. + */ + abs(): BigInteger; + + /** + * Performs addition. + */ + add(number: BigNumber): BigInteger; + + /** + * Performs the bitwise AND operation. + */ + and(number: BigNumber): BigInteger; + + /** + * Returns the number of digits required to represent a bigInt in binary. + */ + bitLength(): BigInteger; + + /** + * Performs a comparison between two numbers. If the numbers are equal, it returns 0. + * If the first number is greater, it returns 1. If the first number is lesser, it returns -1. + */ + compare(number: BigNumber): number; + + /** + * Performs a comparison between the absolute value of two numbers. + */ + compareAbs(number: BigNumber): number; + + /** + * Alias for the compare method. + */ + compareTo(number: BigNumber): number; + + /** + * Performs integer division, disregarding the remainder. + */ + divide(number: BigNumber): BigInteger; + + /** + * Performs division and returns an object with two properties: quotient and remainder. + * The sign of the remainder will match the sign of the dividend. + */ + divmod(number: BigNumber): {quotient: BigInteger, remainder: BigInteger}; + + /** + * Alias for the equals method. + */ + eq(number: BigNumber): boolean; + + /** + * Checks if two numbers are equal. + */ + equals(number: BigNumber): boolean; + + /** + * Alias for the greaterOrEquals method. + */ + geq(number: BigNumber): boolean; + + /** + * Checks if the first number is greater than the second. + */ + greater(number: BigNumber): boolean; + + /** + * Checks if the first number is greater than or equal to the second. + */ + greaterOrEquals(number: BigNumber): boolean; + + /** + * Alias for the greater method. + */ + gt(number: BigNumber): boolean; + + /** + * Returns true if the first number is divisible by the second number, false otherwise. + */ + isDivisibleBy(number: BigNumber): boolean; + + /** + * Returns true if the number is even, false otherwise. + */ + isEven(): boolean; + + /** + * Returns true if the number is negative, false otherwise. + * Returns false for 0 and true for -0. + */ + isNegative(): boolean; + + /** + * Returns true if the number is odd, false otherwise. + */ + isOdd(): boolean; + + /** + * Return true if the number is positive, false otherwise. + * Returns true for 0 and false for -0. + */ + isPositive(): boolean; + + /** + * Returns true if the number is prime, false otherwise. + */ + isPrime(): boolean; + + /** + * Returns true if the number is very likely to be prime, false otherwise. + */ + isProbablePrime(iterations?: number): boolean; + + /** + * Returns true if the number is 1 or -1, false otherwise. + */ + isUnit(): boolean; + + /** + * Return true if the number is 0 or -0, false otherwise. + */ + isZero(): boolean; + + /** + * Alias for the lesserOrEquals method. + */ + leq(number: BigNumber): boolean; + + /** + * Checks if the first number is lesser than the second. + */ + lesser(number: BigNumber): boolean; + + /** + * Checks if the first number is less than or equal to the second. + */ + lesserOrEquals(number: BigNumber): boolean; + + /** + * Alias for the lesser method. + */ + lt(number: BigNumber): boolean; + + /** + * Alias for the subtract method. + */ + minus(number: BigNumber): BigInteger; + + /** + * Performs division and returns the remainder, disregarding the quotient. + * The sign of the remainder will match the sign of the dividend. + */ + mod(number: BigNumber): BigInteger; + + /** + * Finds the multiplicative inverse of the number modulo mod. + */ + modInv(number: BigNumber): BigInteger; + + /** + * Takes the number to the power exp modulo mod. + */ + modPow(exp: BigNumber, mod: BigNumber): BigInteger; + + /** + * Performs multiplication. + */ + multiply(number: BigNumber): BigInteger; + + /** + * Reverses the sign of the number. + */ + negate(): BigInteger; + + /** + * Alias for the notEquals method. + */ + neq(number: BigNumber): boolean; + + /** + * Adds one to the number. + */ + next(): BigInteger; + + /** + * Performs the bitwise NOT operation. + */ + not(): BigInteger; + + /** + * Checks if two numbers are not equal. + */ + notEquals(number: BigNumber): boolean; + + /** + * Performs the bitwise OR operation. + */ + or(number: BigNumber): BigInteger; + + /** + * Alias for the divide method. + */ + over(number: BigNumber): BigInteger; + + /** + * Alias for the add method. + */ + plus(number: BigNumber): BigInteger; + + /** + * Performs exponentiation. If the exponent is less than 0, pow returns 0. + * bigInt.zero.pow(0) returns 1. + */ + pow(number: BigNumber): BigInteger; + + /** + * Subtracts one from the number. + */ + prev(): BigInteger; + + /** + * Alias for the mod method. + */ + remainder(number: BigNumber): BigInteger; + + /** + * Shifts the number left by n places in its binary representation. + * If a negative number is provided, it will shift right. + * + * Throws an error if number is outside of the range [-9007199254740992, 9007199254740992]. + */ + shiftLeft(number: BigNumber): BigInteger; + + /** + * Shifts the number right by n places in its binary representation. + * If a negative number is provided, it will shift left. + * + * Throws an error if number is outside of the range [-9007199254740992, 9007199254740992]. + */ + shiftRight(number: BigNumber): BigInteger; + + /** + * Squares the number. + */ + square(): BigInteger; + + /** + * Performs subtraction. + */ + subtract(number: BigNumber): BigInteger; + + /** + * Alias for the multiply method. + */ + times(number: BigNumber): BigInteger; + + /** + * + * Converts a bigInt to an object representing it as an array of integers module the given radix. + */ + toArray(radix: number): BaseArray; + + /** + * Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range. + */ + toJSNumber(): number; + + /** + * Converts a bigInt to a string. + */ + toString(radix?: number): string; + + /** + * Converts a bigInt to a string. This method is called behind the scenes in JSON.stringify. + */ + toJSON(): string; + + /** + * Converts a bigInt to a native Javascript number. This override allows you to use native + * arithmetic operators without explicit conversion. + */ + valueOf(): number; + + /** + * Performs the bitwise XOR operation. + */ + xor(number: BigNumber): BigInteger; + } + + // Array constant accessors + interface BigIntegerStatic { + '-999': BigInteger; + '-998': BigInteger; + '-997': BigInteger; + '-996': BigInteger; + '-995': BigInteger; + '-994': BigInteger; + '-993': BigInteger; + '-992': BigInteger; + '-991': BigInteger; + '-990': BigInteger; + '-989': BigInteger; + '-988': BigInteger; + '-987': BigInteger; + '-986': BigInteger; + '-985': BigInteger; + '-984': BigInteger; + '-983': BigInteger; + '-982': BigInteger; + '-981': BigInteger; + '-980': BigInteger; + '-979': BigInteger; + '-978': BigInteger; + '-977': BigInteger; + '-976': BigInteger; + '-975': BigInteger; + '-974': BigInteger; + '-973': BigInteger; + '-972': BigInteger; + '-971': BigInteger; + '-970': BigInteger; + '-969': BigInteger; + '-968': BigInteger; + '-967': BigInteger; + '-966': BigInteger; + '-965': BigInteger; + '-964': BigInteger; + '-963': BigInteger; + '-962': BigInteger; + '-961': BigInteger; + '-960': BigInteger; + '-959': BigInteger; + '-958': BigInteger; + '-957': BigInteger; + '-956': BigInteger; + '-955': BigInteger; + '-954': BigInteger; + '-953': BigInteger; + '-952': BigInteger; + '-951': BigInteger; + '-950': BigInteger; + '-949': BigInteger; + '-948': BigInteger; + '-947': BigInteger; + '-946': BigInteger; + '-945': BigInteger; + '-944': BigInteger; + '-943': BigInteger; + '-942': BigInteger; + '-941': BigInteger; + '-940': BigInteger; + '-939': BigInteger; + '-938': BigInteger; + '-937': BigInteger; + '-936': BigInteger; + '-935': BigInteger; + '-934': BigInteger; + '-933': BigInteger; + '-932': BigInteger; + '-931': BigInteger; + '-930': BigInteger; + '-929': BigInteger; + '-928': BigInteger; + '-927': BigInteger; + '-926': BigInteger; + '-925': BigInteger; + '-924': BigInteger; + '-923': BigInteger; + '-922': BigInteger; + '-921': BigInteger; + '-920': BigInteger; + '-919': BigInteger; + '-918': BigInteger; + '-917': BigInteger; + '-916': BigInteger; + '-915': BigInteger; + '-914': BigInteger; + '-913': BigInteger; + '-912': BigInteger; + '-911': BigInteger; + '-910': BigInteger; + '-909': BigInteger; + '-908': BigInteger; + '-907': BigInteger; + '-906': BigInteger; + '-905': BigInteger; + '-904': BigInteger; + '-903': BigInteger; + '-902': BigInteger; + '-901': BigInteger; + '-900': BigInteger; + '-899': BigInteger; + '-898': BigInteger; + '-897': BigInteger; + '-896': BigInteger; + '-895': BigInteger; + '-894': BigInteger; + '-893': BigInteger; + '-892': BigInteger; + '-891': BigInteger; + '-890': BigInteger; + '-889': BigInteger; + '-888': BigInteger; + '-887': BigInteger; + '-886': BigInteger; + '-885': BigInteger; + '-884': BigInteger; + '-883': BigInteger; + '-882': BigInteger; + '-881': BigInteger; + '-880': BigInteger; + '-879': BigInteger; + '-878': BigInteger; + '-877': BigInteger; + '-876': BigInteger; + '-875': BigInteger; + '-874': BigInteger; + '-873': BigInteger; + '-872': BigInteger; + '-871': BigInteger; + '-870': BigInteger; + '-869': BigInteger; + '-868': BigInteger; + '-867': BigInteger; + '-866': BigInteger; + '-865': BigInteger; + '-864': BigInteger; + '-863': BigInteger; + '-862': BigInteger; + '-861': BigInteger; + '-860': BigInteger; + '-859': BigInteger; + '-858': BigInteger; + '-857': BigInteger; + '-856': BigInteger; + '-855': BigInteger; + '-854': BigInteger; + '-853': BigInteger; + '-852': BigInteger; + '-851': BigInteger; + '-850': BigInteger; + '-849': BigInteger; + '-848': BigInteger; + '-847': BigInteger; + '-846': BigInteger; + '-845': BigInteger; + '-844': BigInteger; + '-843': BigInteger; + '-842': BigInteger; + '-841': BigInteger; + '-840': BigInteger; + '-839': BigInteger; + '-838': BigInteger; + '-837': BigInteger; + '-836': BigInteger; + '-835': BigInteger; + '-834': BigInteger; + '-833': BigInteger; + '-832': BigInteger; + '-831': BigInteger; + '-830': BigInteger; + '-829': BigInteger; + '-828': BigInteger; + '-827': BigInteger; + '-826': BigInteger; + '-825': BigInteger; + '-824': BigInteger; + '-823': BigInteger; + '-822': BigInteger; + '-821': BigInteger; + '-820': BigInteger; + '-819': BigInteger; + '-818': BigInteger; + '-817': BigInteger; + '-816': BigInteger; + '-815': BigInteger; + '-814': BigInteger; + '-813': BigInteger; + '-812': BigInteger; + '-811': BigInteger; + '-810': BigInteger; + '-809': BigInteger; + '-808': BigInteger; + '-807': BigInteger; + '-806': BigInteger; + '-805': BigInteger; + '-804': BigInteger; + '-803': BigInteger; + '-802': BigInteger; + '-801': BigInteger; + '-800': BigInteger; + '-799': BigInteger; + '-798': BigInteger; + '-797': BigInteger; + '-796': BigInteger; + '-795': BigInteger; + '-794': BigInteger; + '-793': BigInteger; + '-792': BigInteger; + '-791': BigInteger; + '-790': BigInteger; + '-789': BigInteger; + '-788': BigInteger; + '-787': BigInteger; + '-786': BigInteger; + '-785': BigInteger; + '-784': BigInteger; + '-783': BigInteger; + '-782': BigInteger; + '-781': BigInteger; + '-780': BigInteger; + '-779': BigInteger; + '-778': BigInteger; + '-777': BigInteger; + '-776': BigInteger; + '-775': BigInteger; + '-774': BigInteger; + '-773': BigInteger; + '-772': BigInteger; + '-771': BigInteger; + '-770': BigInteger; + '-769': BigInteger; + '-768': BigInteger; + '-767': BigInteger; + '-766': BigInteger; + '-765': BigInteger; + '-764': BigInteger; + '-763': BigInteger; + '-762': BigInteger; + '-761': BigInteger; + '-760': BigInteger; + '-759': BigInteger; + '-758': BigInteger; + '-757': BigInteger; + '-756': BigInteger; + '-755': BigInteger; + '-754': BigInteger; + '-753': BigInteger; + '-752': BigInteger; + '-751': BigInteger; + '-750': BigInteger; + '-749': BigInteger; + '-748': BigInteger; + '-747': BigInteger; + '-746': BigInteger; + '-745': BigInteger; + '-744': BigInteger; + '-743': BigInteger; + '-742': BigInteger; + '-741': BigInteger; + '-740': BigInteger; + '-739': BigInteger; + '-738': BigInteger; + '-737': BigInteger; + '-736': BigInteger; + '-735': BigInteger; + '-734': BigInteger; + '-733': BigInteger; + '-732': BigInteger; + '-731': BigInteger; + '-730': BigInteger; + '-729': BigInteger; + '-728': BigInteger; + '-727': BigInteger; + '-726': BigInteger; + '-725': BigInteger; + '-724': BigInteger; + '-723': BigInteger; + '-722': BigInteger; + '-721': BigInteger; + '-720': BigInteger; + '-719': BigInteger; + '-718': BigInteger; + '-717': BigInteger; + '-716': BigInteger; + '-715': BigInteger; + '-714': BigInteger; + '-713': BigInteger; + '-712': BigInteger; + '-711': BigInteger; + '-710': BigInteger; + '-709': BigInteger; + '-708': BigInteger; + '-707': BigInteger; + '-706': BigInteger; + '-705': BigInteger; + '-704': BigInteger; + '-703': BigInteger; + '-702': BigInteger; + '-701': BigInteger; + '-700': BigInteger; + '-699': BigInteger; + '-698': BigInteger; + '-697': BigInteger; + '-696': BigInteger; + '-695': BigInteger; + '-694': BigInteger; + '-693': BigInteger; + '-692': BigInteger; + '-691': BigInteger; + '-690': BigInteger; + '-689': BigInteger; + '-688': BigInteger; + '-687': BigInteger; + '-686': BigInteger; + '-685': BigInteger; + '-684': BigInteger; + '-683': BigInteger; + '-682': BigInteger; + '-681': BigInteger; + '-680': BigInteger; + '-679': BigInteger; + '-678': BigInteger; + '-677': BigInteger; + '-676': BigInteger; + '-675': BigInteger; + '-674': BigInteger; + '-673': BigInteger; + '-672': BigInteger; + '-671': BigInteger; + '-670': BigInteger; + '-669': BigInteger; + '-668': BigInteger; + '-667': BigInteger; + '-666': BigInteger; + '-665': BigInteger; + '-664': BigInteger; + '-663': BigInteger; + '-662': BigInteger; + '-661': BigInteger; + '-660': BigInteger; + '-659': BigInteger; + '-658': BigInteger; + '-657': BigInteger; + '-656': BigInteger; + '-655': BigInteger; + '-654': BigInteger; + '-653': BigInteger; + '-652': BigInteger; + '-651': BigInteger; + '-650': BigInteger; + '-649': BigInteger; + '-648': BigInteger; + '-647': BigInteger; + '-646': BigInteger; + '-645': BigInteger; + '-644': BigInteger; + '-643': BigInteger; + '-642': BigInteger; + '-641': BigInteger; + '-640': BigInteger; + '-639': BigInteger; + '-638': BigInteger; + '-637': BigInteger; + '-636': BigInteger; + '-635': BigInteger; + '-634': BigInteger; + '-633': BigInteger; + '-632': BigInteger; + '-631': BigInteger; + '-630': BigInteger; + '-629': BigInteger; + '-628': BigInteger; + '-627': BigInteger; + '-626': BigInteger; + '-625': BigInteger; + '-624': BigInteger; + '-623': BigInteger; + '-622': BigInteger; + '-621': BigInteger; + '-620': BigInteger; + '-619': BigInteger; + '-618': BigInteger; + '-617': BigInteger; + '-616': BigInteger; + '-615': BigInteger; + '-614': BigInteger; + '-613': BigInteger; + '-612': BigInteger; + '-611': BigInteger; + '-610': BigInteger; + '-609': BigInteger; + '-608': BigInteger; + '-607': BigInteger; + '-606': BigInteger; + '-605': BigInteger; + '-604': BigInteger; + '-603': BigInteger; + '-602': BigInteger; + '-601': BigInteger; + '-600': BigInteger; + '-599': BigInteger; + '-598': BigInteger; + '-597': BigInteger; + '-596': BigInteger; + '-595': BigInteger; + '-594': BigInteger; + '-593': BigInteger; + '-592': BigInteger; + '-591': BigInteger; + '-590': BigInteger; + '-589': BigInteger; + '-588': BigInteger; + '-587': BigInteger; + '-586': BigInteger; + '-585': BigInteger; + '-584': BigInteger; + '-583': BigInteger; + '-582': BigInteger; + '-581': BigInteger; + '-580': BigInteger; + '-579': BigInteger; + '-578': BigInteger; + '-577': BigInteger; + '-576': BigInteger; + '-575': BigInteger; + '-574': BigInteger; + '-573': BigInteger; + '-572': BigInteger; + '-571': BigInteger; + '-570': BigInteger; + '-569': BigInteger; + '-568': BigInteger; + '-567': BigInteger; + '-566': BigInteger; + '-565': BigInteger; + '-564': BigInteger; + '-563': BigInteger; + '-562': BigInteger; + '-561': BigInteger; + '-560': BigInteger; + '-559': BigInteger; + '-558': BigInteger; + '-557': BigInteger; + '-556': BigInteger; + '-555': BigInteger; + '-554': BigInteger; + '-553': BigInteger; + '-552': BigInteger; + '-551': BigInteger; + '-550': BigInteger; + '-549': BigInteger; + '-548': BigInteger; + '-547': BigInteger; + '-546': BigInteger; + '-545': BigInteger; + '-544': BigInteger; + '-543': BigInteger; + '-542': BigInteger; + '-541': BigInteger; + '-540': BigInteger; + '-539': BigInteger; + '-538': BigInteger; + '-537': BigInteger; + '-536': BigInteger; + '-535': BigInteger; + '-534': BigInteger; + '-533': BigInteger; + '-532': BigInteger; + '-531': BigInteger; + '-530': BigInteger; + '-529': BigInteger; + '-528': BigInteger; + '-527': BigInteger; + '-526': BigInteger; + '-525': BigInteger; + '-524': BigInteger; + '-523': BigInteger; + '-522': BigInteger; + '-521': BigInteger; + '-520': BigInteger; + '-519': BigInteger; + '-518': BigInteger; + '-517': BigInteger; + '-516': BigInteger; + '-515': BigInteger; + '-514': BigInteger; + '-513': BigInteger; + '-512': BigInteger; + '-511': BigInteger; + '-510': BigInteger; + '-509': BigInteger; + '-508': BigInteger; + '-507': BigInteger; + '-506': BigInteger; + '-505': BigInteger; + '-504': BigInteger; + '-503': BigInteger; + '-502': BigInteger; + '-501': BigInteger; + '-500': BigInteger; + '-499': BigInteger; + '-498': BigInteger; + '-497': BigInteger; + '-496': BigInteger; + '-495': BigInteger; + '-494': BigInteger; + '-493': BigInteger; + '-492': BigInteger; + '-491': BigInteger; + '-490': BigInteger; + '-489': BigInteger; + '-488': BigInteger; + '-487': BigInteger; + '-486': BigInteger; + '-485': BigInteger; + '-484': BigInteger; + '-483': BigInteger; + '-482': BigInteger; + '-481': BigInteger; + '-480': BigInteger; + '-479': BigInteger; + '-478': BigInteger; + '-477': BigInteger; + '-476': BigInteger; + '-475': BigInteger; + '-474': BigInteger; + '-473': BigInteger; + '-472': BigInteger; + '-471': BigInteger; + '-470': BigInteger; + '-469': BigInteger; + '-468': BigInteger; + '-467': BigInteger; + '-466': BigInteger; + '-465': BigInteger; + '-464': BigInteger; + '-463': BigInteger; + '-462': BigInteger; + '-461': BigInteger; + '-460': BigInteger; + '-459': BigInteger; + '-458': BigInteger; + '-457': BigInteger; + '-456': BigInteger; + '-455': BigInteger; + '-454': BigInteger; + '-453': BigInteger; + '-452': BigInteger; + '-451': BigInteger; + '-450': BigInteger; + '-449': BigInteger; + '-448': BigInteger; + '-447': BigInteger; + '-446': BigInteger; + '-445': BigInteger; + '-444': BigInteger; + '-443': BigInteger; + '-442': BigInteger; + '-441': BigInteger; + '-440': BigInteger; + '-439': BigInteger; + '-438': BigInteger; + '-437': BigInteger; + '-436': BigInteger; + '-435': BigInteger; + '-434': BigInteger; + '-433': BigInteger; + '-432': BigInteger; + '-431': BigInteger; + '-430': BigInteger; + '-429': BigInteger; + '-428': BigInteger; + '-427': BigInteger; + '-426': BigInteger; + '-425': BigInteger; + '-424': BigInteger; + '-423': BigInteger; + '-422': BigInteger; + '-421': BigInteger; + '-420': BigInteger; + '-419': BigInteger; + '-418': BigInteger; + '-417': BigInteger; + '-416': BigInteger; + '-415': BigInteger; + '-414': BigInteger; + '-413': BigInteger; + '-412': BigInteger; + '-411': BigInteger; + '-410': BigInteger; + '-409': BigInteger; + '-408': BigInteger; + '-407': BigInteger; + '-406': BigInteger; + '-405': BigInteger; + '-404': BigInteger; + '-403': BigInteger; + '-402': BigInteger; + '-401': BigInteger; + '-400': BigInteger; + '-399': BigInteger; + '-398': BigInteger; + '-397': BigInteger; + '-396': BigInteger; + '-395': BigInteger; + '-394': BigInteger; + '-393': BigInteger; + '-392': BigInteger; + '-391': BigInteger; + '-390': BigInteger; + '-389': BigInteger; + '-388': BigInteger; + '-387': BigInteger; + '-386': BigInteger; + '-385': BigInteger; + '-384': BigInteger; + '-383': BigInteger; + '-382': BigInteger; + '-381': BigInteger; + '-380': BigInteger; + '-379': BigInteger; + '-378': BigInteger; + '-377': BigInteger; + '-376': BigInteger; + '-375': BigInteger; + '-374': BigInteger; + '-373': BigInteger; + '-372': BigInteger; + '-371': BigInteger; + '-370': BigInteger; + '-369': BigInteger; + '-368': BigInteger; + '-367': BigInteger; + '-366': BigInteger; + '-365': BigInteger; + '-364': BigInteger; + '-363': BigInteger; + '-362': BigInteger; + '-361': BigInteger; + '-360': BigInteger; + '-359': BigInteger; + '-358': BigInteger; + '-357': BigInteger; + '-356': BigInteger; + '-355': BigInteger; + '-354': BigInteger; + '-353': BigInteger; + '-352': BigInteger; + '-351': BigInteger; + '-350': BigInteger; + '-349': BigInteger; + '-348': BigInteger; + '-347': BigInteger; + '-346': BigInteger; + '-345': BigInteger; + '-344': BigInteger; + '-343': BigInteger; + '-342': BigInteger; + '-341': BigInteger; + '-340': BigInteger; + '-339': BigInteger; + '-338': BigInteger; + '-337': BigInteger; + '-336': BigInteger; + '-335': BigInteger; + '-334': BigInteger; + '-333': BigInteger; + '-332': BigInteger; + '-331': BigInteger; + '-330': BigInteger; + '-329': BigInteger; + '-328': BigInteger; + '-327': BigInteger; + '-326': BigInteger; + '-325': BigInteger; + '-324': BigInteger; + '-323': BigInteger; + '-322': BigInteger; + '-321': BigInteger; + '-320': BigInteger; + '-319': BigInteger; + '-318': BigInteger; + '-317': BigInteger; + '-316': BigInteger; + '-315': BigInteger; + '-314': BigInteger; + '-313': BigInteger; + '-312': BigInteger; + '-311': BigInteger; + '-310': BigInteger; + '-309': BigInteger; + '-308': BigInteger; + '-307': BigInteger; + '-306': BigInteger; + '-305': BigInteger; + '-304': BigInteger; + '-303': BigInteger; + '-302': BigInteger; + '-301': BigInteger; + '-300': BigInteger; + '-299': BigInteger; + '-298': BigInteger; + '-297': BigInteger; + '-296': BigInteger; + '-295': BigInteger; + '-294': BigInteger; + '-293': BigInteger; + '-292': BigInteger; + '-291': BigInteger; + '-290': BigInteger; + '-289': BigInteger; + '-288': BigInteger; + '-287': BigInteger; + '-286': BigInteger; + '-285': BigInteger; + '-284': BigInteger; + '-283': BigInteger; + '-282': BigInteger; + '-281': BigInteger; + '-280': BigInteger; + '-279': BigInteger; + '-278': BigInteger; + '-277': BigInteger; + '-276': BigInteger; + '-275': BigInteger; + '-274': BigInteger; + '-273': BigInteger; + '-272': BigInteger; + '-271': BigInteger; + '-270': BigInteger; + '-269': BigInteger; + '-268': BigInteger; + '-267': BigInteger; + '-266': BigInteger; + '-265': BigInteger; + '-264': BigInteger; + '-263': BigInteger; + '-262': BigInteger; + '-261': BigInteger; + '-260': BigInteger; + '-259': BigInteger; + '-258': BigInteger; + '-257': BigInteger; + '-256': BigInteger; + '-255': BigInteger; + '-254': BigInteger; + '-253': BigInteger; + '-252': BigInteger; + '-251': BigInteger; + '-250': BigInteger; + '-249': BigInteger; + '-248': BigInteger; + '-247': BigInteger; + '-246': BigInteger; + '-245': BigInteger; + '-244': BigInteger; + '-243': BigInteger; + '-242': BigInteger; + '-241': BigInteger; + '-240': BigInteger; + '-239': BigInteger; + '-238': BigInteger; + '-237': BigInteger; + '-236': BigInteger; + '-235': BigInteger; + '-234': BigInteger; + '-233': BigInteger; + '-232': BigInteger; + '-231': BigInteger; + '-230': BigInteger; + '-229': BigInteger; + '-228': BigInteger; + '-227': BigInteger; + '-226': BigInteger; + '-225': BigInteger; + '-224': BigInteger; + '-223': BigInteger; + '-222': BigInteger; + '-221': BigInteger; + '-220': BigInteger; + '-219': BigInteger; + '-218': BigInteger; + '-217': BigInteger; + '-216': BigInteger; + '-215': BigInteger; + '-214': BigInteger; + '-213': BigInteger; + '-212': BigInteger; + '-211': BigInteger; + '-210': BigInteger; + '-209': BigInteger; + '-208': BigInteger; + '-207': BigInteger; + '-206': BigInteger; + '-205': BigInteger; + '-204': BigInteger; + '-203': BigInteger; + '-202': BigInteger; + '-201': BigInteger; + '-200': BigInteger; + '-199': BigInteger; + '-198': BigInteger; + '-197': BigInteger; + '-196': BigInteger; + '-195': BigInteger; + '-194': BigInteger; + '-193': BigInteger; + '-192': BigInteger; + '-191': BigInteger; + '-190': BigInteger; + '-189': BigInteger; + '-188': BigInteger; + '-187': BigInteger; + '-186': BigInteger; + '-185': BigInteger; + '-184': BigInteger; + '-183': BigInteger; + '-182': BigInteger; + '-181': BigInteger; + '-180': BigInteger; + '-179': BigInteger; + '-178': BigInteger; + '-177': BigInteger; + '-176': BigInteger; + '-175': BigInteger; + '-174': BigInteger; + '-173': BigInteger; + '-172': BigInteger; + '-171': BigInteger; + '-170': BigInteger; + '-169': BigInteger; + '-168': BigInteger; + '-167': BigInteger; + '-166': BigInteger; + '-165': BigInteger; + '-164': BigInteger; + '-163': BigInteger; + '-162': BigInteger; + '-161': BigInteger; + '-160': BigInteger; + '-159': BigInteger; + '-158': BigInteger; + '-157': BigInteger; + '-156': BigInteger; + '-155': BigInteger; + '-154': BigInteger; + '-153': BigInteger; + '-152': BigInteger; + '-151': BigInteger; + '-150': BigInteger; + '-149': BigInteger; + '-148': BigInteger; + '-147': BigInteger; + '-146': BigInteger; + '-145': BigInteger; + '-144': BigInteger; + '-143': BigInteger; + '-142': BigInteger; + '-141': BigInteger; + '-140': BigInteger; + '-139': BigInteger; + '-138': BigInteger; + '-137': BigInteger; + '-136': BigInteger; + '-135': BigInteger; + '-134': BigInteger; + '-133': BigInteger; + '-132': BigInteger; + '-131': BigInteger; + '-130': BigInteger; + '-129': BigInteger; + '-128': BigInteger; + '-127': BigInteger; + '-126': BigInteger; + '-125': BigInteger; + '-124': BigInteger; + '-123': BigInteger; + '-122': BigInteger; + '-121': BigInteger; + '-120': BigInteger; + '-119': BigInteger; + '-118': BigInteger; + '-117': BigInteger; + '-116': BigInteger; + '-115': BigInteger; + '-114': BigInteger; + '-113': BigInteger; + '-112': BigInteger; + '-111': BigInteger; + '-110': BigInteger; + '-109': BigInteger; + '-108': BigInteger; + '-107': BigInteger; + '-106': BigInteger; + '-105': BigInteger; + '-104': BigInteger; + '-103': BigInteger; + '-102': BigInteger; + '-101': BigInteger; + '-100': BigInteger; + '-99': BigInteger; + '-98': BigInteger; + '-97': BigInteger; + '-96': BigInteger; + '-95': BigInteger; + '-94': BigInteger; + '-93': BigInteger; + '-92': BigInteger; + '-91': BigInteger; + '-90': BigInteger; + '-89': BigInteger; + '-88': BigInteger; + '-87': BigInteger; + '-86': BigInteger; + '-85': BigInteger; + '-84': BigInteger; + '-83': BigInteger; + '-82': BigInteger; + '-81': BigInteger; + '-80': BigInteger; + '-79': BigInteger; + '-78': BigInteger; + '-77': BigInteger; + '-76': BigInteger; + '-75': BigInteger; + '-74': BigInteger; + '-73': BigInteger; + '-72': BigInteger; + '-71': BigInteger; + '-70': BigInteger; + '-69': BigInteger; + '-68': BigInteger; + '-67': BigInteger; + '-66': BigInteger; + '-65': BigInteger; + '-64': BigInteger; + '-63': BigInteger; + '-62': BigInteger; + '-61': BigInteger; + '-60': BigInteger; + '-59': BigInteger; + '-58': BigInteger; + '-57': BigInteger; + '-56': BigInteger; + '-55': BigInteger; + '-54': BigInteger; + '-53': BigInteger; + '-52': BigInteger; + '-51': BigInteger; + '-50': BigInteger; + '-49': BigInteger; + '-48': BigInteger; + '-47': BigInteger; + '-46': BigInteger; + '-45': BigInteger; + '-44': BigInteger; + '-43': BigInteger; + '-42': BigInteger; + '-41': BigInteger; + '-40': BigInteger; + '-39': BigInteger; + '-38': BigInteger; + '-37': BigInteger; + '-36': BigInteger; + '-35': BigInteger; + '-34': BigInteger; + '-33': BigInteger; + '-32': BigInteger; + '-31': BigInteger; + '-30': BigInteger; + '-29': BigInteger; + '-28': BigInteger; + '-27': BigInteger; + '-26': BigInteger; + '-25': BigInteger; + '-24': BigInteger; + '-23': BigInteger; + '-22': BigInteger; + '-21': BigInteger; + '-20': BigInteger; + '-19': BigInteger; + '-18': BigInteger; + '-17': BigInteger; + '-16': BigInteger; + '-15': BigInteger; + '-14': BigInteger; + '-13': BigInteger; + '-12': BigInteger; + '-11': BigInteger; + '-10': BigInteger; + '-9': BigInteger; + '-8': BigInteger; + '-7': BigInteger; + '-6': BigInteger; + '-5': BigInteger; + '-4': BigInteger; + '-3': BigInteger; + '-2': BigInteger; + '-1': BigInteger; + '0': BigInteger; + '1': BigInteger; + '2': BigInteger; + '3': BigInteger; + '4': BigInteger; + '5': BigInteger; + '6': BigInteger; + '7': BigInteger; + '8': BigInteger; + '9': BigInteger; + '10': BigInteger; + '11': BigInteger; + '12': BigInteger; + '13': BigInteger; + '14': BigInteger; + '15': BigInteger; + '16': BigInteger; + '17': BigInteger; + '18': BigInteger; + '19': BigInteger; + '20': BigInteger; + '21': BigInteger; + '22': BigInteger; + '23': BigInteger; + '24': BigInteger; + '25': BigInteger; + '26': BigInteger; + '27': BigInteger; + '28': BigInteger; + '29': BigInteger; + '30': BigInteger; + '31': BigInteger; + '32': BigInteger; + '33': BigInteger; + '34': BigInteger; + '35': BigInteger; + '36': BigInteger; + '37': BigInteger; + '38': BigInteger; + '39': BigInteger; + '40': BigInteger; + '41': BigInteger; + '42': BigInteger; + '43': BigInteger; + '44': BigInteger; + '45': BigInteger; + '46': BigInteger; + '47': BigInteger; + '48': BigInteger; + '49': BigInteger; + '50': BigInteger; + '51': BigInteger; + '52': BigInteger; + '53': BigInteger; + '54': BigInteger; + '55': BigInteger; + '56': BigInteger; + '57': BigInteger; + '58': BigInteger; + '59': BigInteger; + '60': BigInteger; + '61': BigInteger; + '62': BigInteger; + '63': BigInteger; + '64': BigInteger; + '65': BigInteger; + '66': BigInteger; + '67': BigInteger; + '68': BigInteger; + '69': BigInteger; + '70': BigInteger; + '71': BigInteger; + '72': BigInteger; + '73': BigInteger; + '74': BigInteger; + '75': BigInteger; + '76': BigInteger; + '77': BigInteger; + '78': BigInteger; + '79': BigInteger; + '80': BigInteger; + '81': BigInteger; + '82': BigInteger; + '83': BigInteger; + '84': BigInteger; + '85': BigInteger; + '86': BigInteger; + '87': BigInteger; + '88': BigInteger; + '89': BigInteger; + '90': BigInteger; + '91': BigInteger; + '92': BigInteger; + '93': BigInteger; + '94': BigInteger; + '95': BigInteger; + '96': BigInteger; + '97': BigInteger; + '98': BigInteger; + '99': BigInteger; + '100': BigInteger; + '101': BigInteger; + '102': BigInteger; + '103': BigInteger; + '104': BigInteger; + '105': BigInteger; + '106': BigInteger; + '107': BigInteger; + '108': BigInteger; + '109': BigInteger; + '110': BigInteger; + '111': BigInteger; + '112': BigInteger; + '113': BigInteger; + '114': BigInteger; + '115': BigInteger; + '116': BigInteger; + '117': BigInteger; + '118': BigInteger; + '119': BigInteger; + '120': BigInteger; + '121': BigInteger; + '122': BigInteger; + '123': BigInteger; + '124': BigInteger; + '125': BigInteger; + '126': BigInteger; + '127': BigInteger; + '128': BigInteger; + '129': BigInteger; + '130': BigInteger; + '131': BigInteger; + '132': BigInteger; + '133': BigInteger; + '134': BigInteger; + '135': BigInteger; + '136': BigInteger; + '137': BigInteger; + '138': BigInteger; + '139': BigInteger; + '140': BigInteger; + '141': BigInteger; + '142': BigInteger; + '143': BigInteger; + '144': BigInteger; + '145': BigInteger; + '146': BigInteger; + '147': BigInteger; + '148': BigInteger; + '149': BigInteger; + '150': BigInteger; + '151': BigInteger; + '152': BigInteger; + '153': BigInteger; + '154': BigInteger; + '155': BigInteger; + '156': BigInteger; + '157': BigInteger; + '158': BigInteger; + '159': BigInteger; + '160': BigInteger; + '161': BigInteger; + '162': BigInteger; + '163': BigInteger; + '164': BigInteger; + '165': BigInteger; + '166': BigInteger; + '167': BigInteger; + '168': BigInteger; + '169': BigInteger; + '170': BigInteger; + '171': BigInteger; + '172': BigInteger; + '173': BigInteger; + '174': BigInteger; + '175': BigInteger; + '176': BigInteger; + '177': BigInteger; + '178': BigInteger; + '179': BigInteger; + '180': BigInteger; + '181': BigInteger; + '182': BigInteger; + '183': BigInteger; + '184': BigInteger; + '185': BigInteger; + '186': BigInteger; + '187': BigInteger; + '188': BigInteger; + '189': BigInteger; + '190': BigInteger; + '191': BigInteger; + '192': BigInteger; + '193': BigInteger; + '194': BigInteger; + '195': BigInteger; + '196': BigInteger; + '197': BigInteger; + '198': BigInteger; + '199': BigInteger; + '200': BigInteger; + '201': BigInteger; + '202': BigInteger; + '203': BigInteger; + '204': BigInteger; + '205': BigInteger; + '206': BigInteger; + '207': BigInteger; + '208': BigInteger; + '209': BigInteger; + '210': BigInteger; + '211': BigInteger; + '212': BigInteger; + '213': BigInteger; + '214': BigInteger; + '215': BigInteger; + '216': BigInteger; + '217': BigInteger; + '218': BigInteger; + '219': BigInteger; + '220': BigInteger; + '221': BigInteger; + '222': BigInteger; + '223': BigInteger; + '224': BigInteger; + '225': BigInteger; + '226': BigInteger; + '227': BigInteger; + '228': BigInteger; + '229': BigInteger; + '230': BigInteger; + '231': BigInteger; + '232': BigInteger; + '233': BigInteger; + '234': BigInteger; + '235': BigInteger; + '236': BigInteger; + '237': BigInteger; + '238': BigInteger; + '239': BigInteger; + '240': BigInteger; + '241': BigInteger; + '242': BigInteger; + '243': BigInteger; + '244': BigInteger; + '245': BigInteger; + '246': BigInteger; + '247': BigInteger; + '248': BigInteger; + '249': BigInteger; + '250': BigInteger; + '251': BigInteger; + '252': BigInteger; + '253': BigInteger; + '254': BigInteger; + '255': BigInteger; + '256': BigInteger; + '257': BigInteger; + '258': BigInteger; + '259': BigInteger; + '260': BigInteger; + '261': BigInteger; + '262': BigInteger; + '263': BigInteger; + '264': BigInteger; + '265': BigInteger; + '266': BigInteger; + '267': BigInteger; + '268': BigInteger; + '269': BigInteger; + '270': BigInteger; + '271': BigInteger; + '272': BigInteger; + '273': BigInteger; + '274': BigInteger; + '275': BigInteger; + '276': BigInteger; + '277': BigInteger; + '278': BigInteger; + '279': BigInteger; + '280': BigInteger; + '281': BigInteger; + '282': BigInteger; + '283': BigInteger; + '284': BigInteger; + '285': BigInteger; + '286': BigInteger; + '287': BigInteger; + '288': BigInteger; + '289': BigInteger; + '290': BigInteger; + '291': BigInteger; + '292': BigInteger; + '293': BigInteger; + '294': BigInteger; + '295': BigInteger; + '296': BigInteger; + '297': BigInteger; + '298': BigInteger; + '299': BigInteger; + '300': BigInteger; + '301': BigInteger; + '302': BigInteger; + '303': BigInteger; + '304': BigInteger; + '305': BigInteger; + '306': BigInteger; + '307': BigInteger; + '308': BigInteger; + '309': BigInteger; + '310': BigInteger; + '311': BigInteger; + '312': BigInteger; + '313': BigInteger; + '314': BigInteger; + '315': BigInteger; + '316': BigInteger; + '317': BigInteger; + '318': BigInteger; + '319': BigInteger; + '320': BigInteger; + '321': BigInteger; + '322': BigInteger; + '323': BigInteger; + '324': BigInteger; + '325': BigInteger; + '326': BigInteger; + '327': BigInteger; + '328': BigInteger; + '329': BigInteger; + '330': BigInteger; + '331': BigInteger; + '332': BigInteger; + '333': BigInteger; + '334': BigInteger; + '335': BigInteger; + '336': BigInteger; + '337': BigInteger; + '338': BigInteger; + '339': BigInteger; + '340': BigInteger; + '341': BigInteger; + '342': BigInteger; + '343': BigInteger; + '344': BigInteger; + '345': BigInteger; + '346': BigInteger; + '347': BigInteger; + '348': BigInteger; + '349': BigInteger; + '350': BigInteger; + '351': BigInteger; + '352': BigInteger; + '353': BigInteger; + '354': BigInteger; + '355': BigInteger; + '356': BigInteger; + '357': BigInteger; + '358': BigInteger; + '359': BigInteger; + '360': BigInteger; + '361': BigInteger; + '362': BigInteger; + '363': BigInteger; + '364': BigInteger; + '365': BigInteger; + '366': BigInteger; + '367': BigInteger; + '368': BigInteger; + '369': BigInteger; + '370': BigInteger; + '371': BigInteger; + '372': BigInteger; + '373': BigInteger; + '374': BigInteger; + '375': BigInteger; + '376': BigInteger; + '377': BigInteger; + '378': BigInteger; + '379': BigInteger; + '380': BigInteger; + '381': BigInteger; + '382': BigInteger; + '383': BigInteger; + '384': BigInteger; + '385': BigInteger; + '386': BigInteger; + '387': BigInteger; + '388': BigInteger; + '389': BigInteger; + '390': BigInteger; + '391': BigInteger; + '392': BigInteger; + '393': BigInteger; + '394': BigInteger; + '395': BigInteger; + '396': BigInteger; + '397': BigInteger; + '398': BigInteger; + '399': BigInteger; + '400': BigInteger; + '401': BigInteger; + '402': BigInteger; + '403': BigInteger; + '404': BigInteger; + '405': BigInteger; + '406': BigInteger; + '407': BigInteger; + '408': BigInteger; + '409': BigInteger; + '410': BigInteger; + '411': BigInteger; + '412': BigInteger; + '413': BigInteger; + '414': BigInteger; + '415': BigInteger; + '416': BigInteger; + '417': BigInteger; + '418': BigInteger; + '419': BigInteger; + '420': BigInteger; + '421': BigInteger; + '422': BigInteger; + '423': BigInteger; + '424': BigInteger; + '425': BigInteger; + '426': BigInteger; + '427': BigInteger; + '428': BigInteger; + '429': BigInteger; + '430': BigInteger; + '431': BigInteger; + '432': BigInteger; + '433': BigInteger; + '434': BigInteger; + '435': BigInteger; + '436': BigInteger; + '437': BigInteger; + '438': BigInteger; + '439': BigInteger; + '440': BigInteger; + '441': BigInteger; + '442': BigInteger; + '443': BigInteger; + '444': BigInteger; + '445': BigInteger; + '446': BigInteger; + '447': BigInteger; + '448': BigInteger; + '449': BigInteger; + '450': BigInteger; + '451': BigInteger; + '452': BigInteger; + '453': BigInteger; + '454': BigInteger; + '455': BigInteger; + '456': BigInteger; + '457': BigInteger; + '458': BigInteger; + '459': BigInteger; + '460': BigInteger; + '461': BigInteger; + '462': BigInteger; + '463': BigInteger; + '464': BigInteger; + '465': BigInteger; + '466': BigInteger; + '467': BigInteger; + '468': BigInteger; + '469': BigInteger; + '470': BigInteger; + '471': BigInteger; + '472': BigInteger; + '473': BigInteger; + '474': BigInteger; + '475': BigInteger; + '476': BigInteger; + '477': BigInteger; + '478': BigInteger; + '479': BigInteger; + '480': BigInteger; + '481': BigInteger; + '482': BigInteger; + '483': BigInteger; + '484': BigInteger; + '485': BigInteger; + '486': BigInteger; + '487': BigInteger; + '488': BigInteger; + '489': BigInteger; + '490': BigInteger; + '491': BigInteger; + '492': BigInteger; + '493': BigInteger; + '494': BigInteger; + '495': BigInteger; + '496': BigInteger; + '497': BigInteger; + '498': BigInteger; + '499': BigInteger; + '500': BigInteger; + '501': BigInteger; + '502': BigInteger; + '503': BigInteger; + '504': BigInteger; + '505': BigInteger; + '506': BigInteger; + '507': BigInteger; + '508': BigInteger; + '509': BigInteger; + '510': BigInteger; + '511': BigInteger; + '512': BigInteger; + '513': BigInteger; + '514': BigInteger; + '515': BigInteger; + '516': BigInteger; + '517': BigInteger; + '518': BigInteger; + '519': BigInteger; + '520': BigInteger; + '521': BigInteger; + '522': BigInteger; + '523': BigInteger; + '524': BigInteger; + '525': BigInteger; + '526': BigInteger; + '527': BigInteger; + '528': BigInteger; + '529': BigInteger; + '530': BigInteger; + '531': BigInteger; + '532': BigInteger; + '533': BigInteger; + '534': BigInteger; + '535': BigInteger; + '536': BigInteger; + '537': BigInteger; + '538': BigInteger; + '539': BigInteger; + '540': BigInteger; + '541': BigInteger; + '542': BigInteger; + '543': BigInteger; + '544': BigInteger; + '545': BigInteger; + '546': BigInteger; + '547': BigInteger; + '548': BigInteger; + '549': BigInteger; + '550': BigInteger; + '551': BigInteger; + '552': BigInteger; + '553': BigInteger; + '554': BigInteger; + '555': BigInteger; + '556': BigInteger; + '557': BigInteger; + '558': BigInteger; + '559': BigInteger; + '560': BigInteger; + '561': BigInteger; + '562': BigInteger; + '563': BigInteger; + '564': BigInteger; + '565': BigInteger; + '566': BigInteger; + '567': BigInteger; + '568': BigInteger; + '569': BigInteger; + '570': BigInteger; + '571': BigInteger; + '572': BigInteger; + '573': BigInteger; + '574': BigInteger; + '575': BigInteger; + '576': BigInteger; + '577': BigInteger; + '578': BigInteger; + '579': BigInteger; + '580': BigInteger; + '581': BigInteger; + '582': BigInteger; + '583': BigInteger; + '584': BigInteger; + '585': BigInteger; + '586': BigInteger; + '587': BigInteger; + '588': BigInteger; + '589': BigInteger; + '590': BigInteger; + '591': BigInteger; + '592': BigInteger; + '593': BigInteger; + '594': BigInteger; + '595': BigInteger; + '596': BigInteger; + '597': BigInteger; + '598': BigInteger; + '599': BigInteger; + '600': BigInteger; + '601': BigInteger; + '602': BigInteger; + '603': BigInteger; + '604': BigInteger; + '605': BigInteger; + '606': BigInteger; + '607': BigInteger; + '608': BigInteger; + '609': BigInteger; + '610': BigInteger; + '611': BigInteger; + '612': BigInteger; + '613': BigInteger; + '614': BigInteger; + '615': BigInteger; + '616': BigInteger; + '617': BigInteger; + '618': BigInteger; + '619': BigInteger; + '620': BigInteger; + '621': BigInteger; + '622': BigInteger; + '623': BigInteger; + '624': BigInteger; + '625': BigInteger; + '626': BigInteger; + '627': BigInteger; + '628': BigInteger; + '629': BigInteger; + '630': BigInteger; + '631': BigInteger; + '632': BigInteger; + '633': BigInteger; + '634': BigInteger; + '635': BigInteger; + '636': BigInteger; + '637': BigInteger; + '638': BigInteger; + '639': BigInteger; + '640': BigInteger; + '641': BigInteger; + '642': BigInteger; + '643': BigInteger; + '644': BigInteger; + '645': BigInteger; + '646': BigInteger; + '647': BigInteger; + '648': BigInteger; + '649': BigInteger; + '650': BigInteger; + '651': BigInteger; + '652': BigInteger; + '653': BigInteger; + '654': BigInteger; + '655': BigInteger; + '656': BigInteger; + '657': BigInteger; + '658': BigInteger; + '659': BigInteger; + '660': BigInteger; + '661': BigInteger; + '662': BigInteger; + '663': BigInteger; + '664': BigInteger; + '665': BigInteger; + '666': BigInteger; + '667': BigInteger; + '668': BigInteger; + '669': BigInteger; + '670': BigInteger; + '671': BigInteger; + '672': BigInteger; + '673': BigInteger; + '674': BigInteger; + '675': BigInteger; + '676': BigInteger; + '677': BigInteger; + '678': BigInteger; + '679': BigInteger; + '680': BigInteger; + '681': BigInteger; + '682': BigInteger; + '683': BigInteger; + '684': BigInteger; + '685': BigInteger; + '686': BigInteger; + '687': BigInteger; + '688': BigInteger; + '689': BigInteger; + '690': BigInteger; + '691': BigInteger; + '692': BigInteger; + '693': BigInteger; + '694': BigInteger; + '695': BigInteger; + '696': BigInteger; + '697': BigInteger; + '698': BigInteger; + '699': BigInteger; + '700': BigInteger; + '701': BigInteger; + '702': BigInteger; + '703': BigInteger; + '704': BigInteger; + '705': BigInteger; + '706': BigInteger; + '707': BigInteger; + '708': BigInteger; + '709': BigInteger; + '710': BigInteger; + '711': BigInteger; + '712': BigInteger; + '713': BigInteger; + '714': BigInteger; + '715': BigInteger; + '716': BigInteger; + '717': BigInteger; + '718': BigInteger; + '719': BigInteger; + '720': BigInteger; + '721': BigInteger; + '722': BigInteger; + '723': BigInteger; + '724': BigInteger; + '725': BigInteger; + '726': BigInteger; + '727': BigInteger; + '728': BigInteger; + '729': BigInteger; + '730': BigInteger; + '731': BigInteger; + '732': BigInteger; + '733': BigInteger; + '734': BigInteger; + '735': BigInteger; + '736': BigInteger; + '737': BigInteger; + '738': BigInteger; + '739': BigInteger; + '740': BigInteger; + '741': BigInteger; + '742': BigInteger; + '743': BigInteger; + '744': BigInteger; + '745': BigInteger; + '746': BigInteger; + '747': BigInteger; + '748': BigInteger; + '749': BigInteger; + '750': BigInteger; + '751': BigInteger; + '752': BigInteger; + '753': BigInteger; + '754': BigInteger; + '755': BigInteger; + '756': BigInteger; + '757': BigInteger; + '758': BigInteger; + '759': BigInteger; + '760': BigInteger; + '761': BigInteger; + '762': BigInteger; + '763': BigInteger; + '764': BigInteger; + '765': BigInteger; + '766': BigInteger; + '767': BigInteger; + '768': BigInteger; + '769': BigInteger; + '770': BigInteger; + '771': BigInteger; + '772': BigInteger; + '773': BigInteger; + '774': BigInteger; + '775': BigInteger; + '776': BigInteger; + '777': BigInteger; + '778': BigInteger; + '779': BigInteger; + '780': BigInteger; + '781': BigInteger; + '782': BigInteger; + '783': BigInteger; + '784': BigInteger; + '785': BigInteger; + '786': BigInteger; + '787': BigInteger; + '788': BigInteger; + '789': BigInteger; + '790': BigInteger; + '791': BigInteger; + '792': BigInteger; + '793': BigInteger; + '794': BigInteger; + '795': BigInteger; + '796': BigInteger; + '797': BigInteger; + '798': BigInteger; + '799': BigInteger; + '800': BigInteger; + '801': BigInteger; + '802': BigInteger; + '803': BigInteger; + '804': BigInteger; + '805': BigInteger; + '806': BigInteger; + '807': BigInteger; + '808': BigInteger; + '809': BigInteger; + '810': BigInteger; + '811': BigInteger; + '812': BigInteger; + '813': BigInteger; + '814': BigInteger; + '815': BigInteger; + '816': BigInteger; + '817': BigInteger; + '818': BigInteger; + '819': BigInteger; + '820': BigInteger; + '821': BigInteger; + '822': BigInteger; + '823': BigInteger; + '824': BigInteger; + '825': BigInteger; + '826': BigInteger; + '827': BigInteger; + '828': BigInteger; + '829': BigInteger; + '830': BigInteger; + '831': BigInteger; + '832': BigInteger; + '833': BigInteger; + '834': BigInteger; + '835': BigInteger; + '836': BigInteger; + '837': BigInteger; + '838': BigInteger; + '839': BigInteger; + '840': BigInteger; + '841': BigInteger; + '842': BigInteger; + '843': BigInteger; + '844': BigInteger; + '845': BigInteger; + '846': BigInteger; + '847': BigInteger; + '848': BigInteger; + '849': BigInteger; + '850': BigInteger; + '851': BigInteger; + '852': BigInteger; + '853': BigInteger; + '854': BigInteger; + '855': BigInteger; + '856': BigInteger; + '857': BigInteger; + '858': BigInteger; + '859': BigInteger; + '860': BigInteger; + '861': BigInteger; + '862': BigInteger; + '863': BigInteger; + '864': BigInteger; + '865': BigInteger; + '866': BigInteger; + '867': BigInteger; + '868': BigInteger; + '869': BigInteger; + '870': BigInteger; + '871': BigInteger; + '872': BigInteger; + '873': BigInteger; + '874': BigInteger; + '875': BigInteger; + '876': BigInteger; + '877': BigInteger; + '878': BigInteger; + '879': BigInteger; + '880': BigInteger; + '881': BigInteger; + '882': BigInteger; + '883': BigInteger; + '884': BigInteger; + '885': BigInteger; + '886': BigInteger; + '887': BigInteger; + '888': BigInteger; + '889': BigInteger; + '890': BigInteger; + '891': BigInteger; + '892': BigInteger; + '893': BigInteger; + '894': BigInteger; + '895': BigInteger; + '896': BigInteger; + '897': BigInteger; + '898': BigInteger; + '899': BigInteger; + '900': BigInteger; + '901': BigInteger; + '902': BigInteger; + '903': BigInteger; + '904': BigInteger; + '905': BigInteger; + '906': BigInteger; + '907': BigInteger; + '908': BigInteger; + '909': BigInteger; + '910': BigInteger; + '911': BigInteger; + '912': BigInteger; + '913': BigInteger; + '914': BigInteger; + '915': BigInteger; + '916': BigInteger; + '917': BigInteger; + '918': BigInteger; + '919': BigInteger; + '920': BigInteger; + '921': BigInteger; + '922': BigInteger; + '923': BigInteger; + '924': BigInteger; + '925': BigInteger; + '926': BigInteger; + '927': BigInteger; + '928': BigInteger; + '929': BigInteger; + '930': BigInteger; + '931': BigInteger; + '932': BigInteger; + '933': BigInteger; + '934': BigInteger; + '935': BigInteger; + '936': BigInteger; + '937': BigInteger; + '938': BigInteger; + '939': BigInteger; + '940': BigInteger; + '941': BigInteger; + '942': BigInteger; + '943': BigInteger; + '944': BigInteger; + '945': BigInteger; + '946': BigInteger; + '947': BigInteger; + '948': BigInteger; + '949': BigInteger; + '950': BigInteger; + '951': BigInteger; + '952': BigInteger; + '953': BigInteger; + '954': BigInteger; + '955': BigInteger; + '956': BigInteger; + '957': BigInteger; + '958': BigInteger; + '959': BigInteger; + '960': BigInteger; + '961': BigInteger; + '962': BigInteger; + '963': BigInteger; + '964': BigInteger; + '965': BigInteger; + '966': BigInteger; + '967': BigInteger; + '968': BigInteger; + '969': BigInteger; + '970': BigInteger; + '971': BigInteger; + '972': BigInteger; + '973': BigInteger; + '974': BigInteger; + '975': BigInteger; + '976': BigInteger; + '977': BigInteger; + '978': BigInteger; + '979': BigInteger; + '980': BigInteger; + '981': BigInteger; + '982': BigInteger; + '983': BigInteger; + '984': BigInteger; + '985': BigInteger; + '986': BigInteger; + '987': BigInteger; + '988': BigInteger; + '989': BigInteger; + '990': BigInteger; + '991': BigInteger; + '992': BigInteger; + '993': BigInteger; + '994': BigInteger; + '995': BigInteger; + '996': BigInteger; + '997': BigInteger; + '998': BigInteger; + '999': BigInteger; + } + + interface BaseArray { + value: number[], + isNegative: boolean + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.js new file mode 100644 index 0000000..605a498 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.js @@ -0,0 +1,1321 @@ +var bigInt = (function (undefined) { + "use strict"; + + var BASE = 1e7, + LOG_BASE = 7, + MAX_INT = 9007199254740992, + MAX_INT_ARR = smallToArray(MAX_INT), + LOG_MAX_INT = Math.log(MAX_INT); + + function Integer(v, radix) { + if (typeof v === "undefined") return Integer[0]; + if (typeof radix !== "undefined") return +radix === 10 ? parseValue(v) : parseBase(v, radix); + return parseValue(v); + } + + function BigInteger(value, sign) { + this.value = value; + this.sign = sign; + this.isSmall = false; + } + BigInteger.prototype = Object.create(Integer.prototype); + + function SmallInteger(value) { + this.value = value; + this.sign = value < 0; + this.isSmall = true; + } + SmallInteger.prototype = Object.create(Integer.prototype); + + function isPrecise(n) { + return -MAX_INT < n && n < MAX_INT; + } + + function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes + if (n < 1e7) + return [n]; + if (n < 1e14) + return [n % 1e7, Math.floor(n / 1e7)]; + return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)]; + } + + function arrayToSmall(arr) { // If BASE changes this function may need to change + trim(arr); + var length = arr.length; + if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) { + switch (length) { + case 0: return 0; + case 1: return arr[0]; + case 2: return arr[0] + arr[1] * BASE; + default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE; + } + } + return arr; + } + + function trim(v) { + var i = v.length; + while (v[--i] === 0); + v.length = i + 1; + } + + function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger + var x = new Array(length); + var i = -1; + while (++i < length) { + x[i] = 0; + } + return x; + } + + function truncate(n) { + if (n > 0) return Math.floor(n); + return Math.ceil(n); + } + + function add(a, b) { // assumes a and b are arrays with a.length >= b.length + var l_a = a.length, + l_b = b.length, + r = new Array(l_a), + carry = 0, + base = BASE, + sum, i; + for (i = 0; i < l_b; i++) { + sum = a[i] + b[i] + carry; + carry = sum >= base ? 1 : 0; + r[i] = sum - carry * base; + } + while (i < l_a) { + sum = a[i] + carry; + carry = sum === base ? 1 : 0; + r[i++] = sum - carry * base; + } + if (carry > 0) r.push(carry); + return r; + } + + function addAny(a, b) { + if (a.length >= b.length) return add(a, b); + return add(b, a); + } + + function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT + var l = a.length, + r = new Array(l), + base = BASE, + sum, i; + for (i = 0; i < l; i++) { + sum = a[i] - base + carry; + carry = Math.floor(sum / base); + r[i] = sum - carry * base; + carry += 1; + } + while (carry > 0) { + r[i++] = carry % base; + carry = Math.floor(carry / base); + } + return r; + } + + BigInteger.prototype.add = function (v) { + var n = parseValue(v); + if (this.sign !== n.sign) { + return this.subtract(n.negate()); + } + var a = this.value, b = n.value; + if (n.isSmall) { + return new BigInteger(addSmall(a, Math.abs(b)), this.sign); + } + return new BigInteger(addAny(a, b), this.sign); + }; + BigInteger.prototype.plus = BigInteger.prototype.add; + + SmallInteger.prototype.add = function (v) { + var n = parseValue(v); + var a = this.value; + if (a < 0 !== n.sign) { + return this.subtract(n.negate()); + } + var b = n.value; + if (n.isSmall) { + if (isPrecise(a + b)) return new SmallInteger(a + b); + b = smallToArray(Math.abs(b)); + } + return new BigInteger(addSmall(b, Math.abs(a)), a < 0); + }; + SmallInteger.prototype.plus = SmallInteger.prototype.add; + + function subtract(a, b) { // assumes a and b are arrays with a >= b + var a_l = a.length, + b_l = b.length, + r = new Array(a_l), + borrow = 0, + base = BASE, + i, difference; + for (i = 0; i < b_l; i++) { + difference = a[i] - borrow - b[i]; + if (difference < 0) { + difference += base; + borrow = 1; + } else borrow = 0; + r[i] = difference; + } + for (i = b_l; i < a_l; i++) { + difference = a[i] - borrow; + if (difference < 0) difference += base; + else { + r[i++] = difference; + break; + } + r[i] = difference; + } + for (; i < a_l; i++) { + r[i] = a[i]; + } + trim(r); + return r; + } + + function subtractAny(a, b, sign) { + var value; + if (compareAbs(a, b) >= 0) { + value = subtract(a, b); + } else { + value = subtract(b, a); + sign = !sign; + } + value = arrayToSmall(value); + if (typeof value === "number") { + if (sign) value = -value; + return new SmallInteger(value); + } + return new BigInteger(value, sign); + } + + function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT + var l = a.length, + r = new Array(l), + carry = -b, + base = BASE, + i, difference; + for (i = 0; i < l; i++) { + difference = a[i] + carry; + carry = Math.floor(difference / base); + difference %= base; + r[i] = difference < 0 ? difference + base : difference; + } + r = arrayToSmall(r); + if (typeof r === "number") { + if (sign) r = -r; + return new SmallInteger(r); + } return new BigInteger(r, sign); + } + + BigInteger.prototype.subtract = function (v) { + var n = parseValue(v); + if (this.sign !== n.sign) { + return this.add(n.negate()); + } + var a = this.value, b = n.value; + if (n.isSmall) + return subtractSmall(a, Math.abs(b), this.sign); + return subtractAny(a, b, this.sign); + }; + BigInteger.prototype.minus = BigInteger.prototype.subtract; + + SmallInteger.prototype.subtract = function (v) { + var n = parseValue(v); + var a = this.value; + if (a < 0 !== n.sign) { + return this.add(n.negate()); + } + var b = n.value; + if (n.isSmall) { + return new SmallInteger(a - b); + } + return subtractSmall(b, Math.abs(a), a >= 0); + }; + SmallInteger.prototype.minus = SmallInteger.prototype.subtract; + + BigInteger.prototype.negate = function () { + return new BigInteger(this.value, !this.sign); + }; + SmallInteger.prototype.negate = function () { + var sign = this.sign; + var small = new SmallInteger(-this.value); + small.sign = !sign; + return small; + }; + + BigInteger.prototype.abs = function () { + return new BigInteger(this.value, false); + }; + SmallInteger.prototype.abs = function () { + return new SmallInteger(Math.abs(this.value)); + }; + + function multiplyLong(a, b) { + var a_l = a.length, + b_l = b.length, + l = a_l + b_l, + r = createArray(l), + base = BASE, + product, carry, i, a_i, b_j; + for (i = 0; i < a_l; ++i) { + a_i = a[i]; + for (var j = 0; j < b_l; ++j) { + b_j = b[j]; + product = a_i * b_j + r[i + j]; + carry = Math.floor(product / base); + r[i + j] = product - carry * base; + r[i + j + 1] += carry; + } + } + trim(r); + return r; + } + + function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE + var l = a.length, + r = new Array(l), + base = BASE, + carry = 0, + product, i; + for (i = 0; i < l; i++) { + product = a[i] * b + carry; + carry = Math.floor(product / base); + r[i] = product - carry * base; + } + while (carry > 0) { + r[i++] = carry % base; + carry = Math.floor(carry / base); + } + return r; + } + + function shiftLeft(x, n) { + var r = []; + while (n-- > 0) r.push(0); + return r.concat(x); + } + + function multiplyKaratsuba(x, y) { + var n = Math.max(x.length, y.length); + + if (n <= 30) return multiplyLong(x, y); + n = Math.ceil(n / 2); + + var b = x.slice(n), + a = x.slice(0, n), + d = y.slice(n), + c = y.slice(0, n); + + var ac = multiplyKaratsuba(a, c), + bd = multiplyKaratsuba(b, d), + abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d)); + + var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n)); + trim(product); + return product; + } + + // The following function is derived from a surface fit of a graph plotting the performance difference + // between long multiplication and karatsuba multiplication versus the lengths of the two arrays. + function useKaratsuba(l1, l2) { + return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0; + } + + BigInteger.prototype.multiply = function (v) { + var n = parseValue(v), + a = this.value, b = n.value, + sign = this.sign !== n.sign, + abs; + if (n.isSmall) { + if (b === 0) return Integer[0]; + if (b === 1) return this; + if (b === -1) return this.negate(); + abs = Math.abs(b); + if (abs < BASE) { + return new BigInteger(multiplySmall(a, abs), sign); + } + b = smallToArray(abs); + } + if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes + return new BigInteger(multiplyKaratsuba(a, b), sign); + return new BigInteger(multiplyLong(a, b), sign); + }; + + BigInteger.prototype.times = BigInteger.prototype.multiply; + + function multiplySmallAndArray(a, b, sign) { // a >= 0 + if (a < BASE) { + return new BigInteger(multiplySmall(b, a), sign); + } + return new BigInteger(multiplyLong(b, smallToArray(a)), sign); + } + SmallInteger.prototype._multiplyBySmall = function (a) { + if (isPrecise(a.value * this.value)) { + return new SmallInteger(a.value * this.value); + } + return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign); + }; + BigInteger.prototype._multiplyBySmall = function (a) { + if (a.value === 0) return Integer[0]; + if (a.value === 1) return this; + if (a.value === -1) return this.negate(); + return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign); + }; + SmallInteger.prototype.multiply = function (v) { + return parseValue(v)._multiplyBySmall(this); + }; + SmallInteger.prototype.times = SmallInteger.prototype.multiply; + + function square(a) { + //console.assert(2 * BASE * BASE < MAX_INT); + var l = a.length, + r = createArray(l + l), + base = BASE, + product, carry, i, a_i, a_j; + for (i = 0; i < l; i++) { + a_i = a[i]; + carry = 0 - a_i * a_i; + for (var j = i; j < l; j++) { + a_j = a[j]; + product = 2 * (a_i * a_j) + r[i + j] + carry; + carry = Math.floor(product / base); + r[i + j] = product - carry * base; + } + r[i + l] = carry; + } + trim(r); + return r; + } + + BigInteger.prototype.square = function () { + return new BigInteger(square(this.value), false); + }; + + SmallInteger.prototype.square = function () { + var value = this.value * this.value; + if (isPrecise(value)) return new SmallInteger(value); + return new BigInteger(square(smallToArray(Math.abs(this.value))), false); + }; + + function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes. + var a_l = a.length, + b_l = b.length, + base = BASE, + result = createArray(b.length), + divisorMostSignificantDigit = b[b_l - 1], + // normalization + lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), + remainder = multiplySmall(a, lambda), + divisor = multiplySmall(b, lambda), + quotientDigit, shift, carry, borrow, i, l, q; + if (remainder.length <= a_l) remainder.push(0); + divisor.push(0); + divisorMostSignificantDigit = divisor[b_l - 1]; + for (shift = a_l - b_l; shift >= 0; shift--) { + quotientDigit = base - 1; + if (remainder[shift + b_l] !== divisorMostSignificantDigit) { + quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit); + } + // quotientDigit <= base - 1 + carry = 0; + borrow = 0; + l = divisor.length; + for (i = 0; i < l; i++) { + carry += quotientDigit * divisor[i]; + q = Math.floor(carry / base); + borrow += remainder[shift + i] - (carry - q * base); + carry = q; + if (borrow < 0) { + remainder[shift + i] = borrow + base; + borrow = -1; + } else { + remainder[shift + i] = borrow; + borrow = 0; + } + } + while (borrow !== 0) { + quotientDigit -= 1; + carry = 0; + for (i = 0; i < l; i++) { + carry += remainder[shift + i] - base + divisor[i]; + if (carry < 0) { + remainder[shift + i] = carry + base; + carry = 0; + } else { + remainder[shift + i] = carry; + carry = 1; + } + } + borrow += carry; + } + result[shift] = quotientDigit; + } + // denormalization + remainder = divModSmall(remainder, lambda)[0]; + return [arrayToSmall(result), arrayToSmall(remainder)]; + } + + function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/ + // Performs faster than divMod1 on larger input sizes. + var a_l = a.length, + b_l = b.length, + result = [], + part = [], + base = BASE, + guess, xlen, highx, highy, check; + while (a_l) { + part.unshift(a[--a_l]); + trim(part); + if (compareAbs(part, b) < 0) { + result.push(0); + continue; + } + xlen = part.length; + highx = part[xlen - 1] * base + part[xlen - 2]; + highy = b[b_l - 1] * base + b[b_l - 2]; + if (xlen > b_l) { + highx = (highx + 1) * base; + } + guess = Math.ceil(highx / highy); + do { + check = multiplySmall(b, guess); + if (compareAbs(check, part) <= 0) break; + guess--; + } while (guess); + result.push(guess); + part = subtract(part, check); + } + result.reverse(); + return [arrayToSmall(result), arrayToSmall(part)]; + } + + function divModSmall(value, lambda) { + var length = value.length, + quotient = createArray(length), + base = BASE, + i, q, remainder, divisor; + remainder = 0; + for (i = length - 1; i >= 0; --i) { + divisor = remainder * base + value[i]; + q = truncate(divisor / lambda); + remainder = divisor - q * lambda; + quotient[i] = q | 0; + } + return [quotient, remainder | 0]; + } + + function divModAny(self, v) { + var value, n = parseValue(v); + var a = self.value, b = n.value; + var quotient; + if (b === 0) throw new Error("Cannot divide by zero"); + if (self.isSmall) { + if (n.isSmall) { + return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)]; + } + return [Integer[0], self]; + } + if (n.isSmall) { + if (b === 1) return [self, Integer[0]]; + if (b == -1) return [self.negate(), Integer[0]]; + var abs = Math.abs(b); + if (abs < BASE) { + value = divModSmall(a, abs); + quotient = arrayToSmall(value[0]); + var remainder = value[1]; + if (self.sign) remainder = -remainder; + if (typeof quotient === "number") { + if (self.sign !== n.sign) quotient = -quotient; + return [new SmallInteger(quotient), new SmallInteger(remainder)]; + } + return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)]; + } + b = smallToArray(abs); + } + var comparison = compareAbs(a, b); + if (comparison === -1) return [Integer[0], self]; + if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]]; + + // divMod1 is faster on smaller input sizes + if (a.length + b.length <= 200) + value = divMod1(a, b); + else value = divMod2(a, b); + + quotient = value[0]; + var qSign = self.sign !== n.sign, + mod = value[1], + mSign = self.sign; + if (typeof quotient === "number") { + if (qSign) quotient = -quotient; + quotient = new SmallInteger(quotient); + } else quotient = new BigInteger(quotient, qSign); + if (typeof mod === "number") { + if (mSign) mod = -mod; + mod = new SmallInteger(mod); + } else mod = new BigInteger(mod, mSign); + return [quotient, mod]; + } + + BigInteger.prototype.divmod = function (v) { + var result = divModAny(this, v); + return { + quotient: result[0], + remainder: result[1] + }; + }; + SmallInteger.prototype.divmod = BigInteger.prototype.divmod; + + BigInteger.prototype.divide = function (v) { + return divModAny(this, v)[0]; + }; + SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide; + + BigInteger.prototype.mod = function (v) { + return divModAny(this, v)[1]; + }; + SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod; + + BigInteger.prototype.pow = function (v) { + var n = parseValue(v), + a = this.value, + b = n.value, + value, x, y; + if (b === 0) return Integer[1]; + if (a === 0) return Integer[0]; + if (a === 1) return Integer[1]; + if (a === -1) return n.isEven() ? Integer[1] : Integer[-1]; + if (n.sign) { + return Integer[0]; + } + if (!n.isSmall) throw new Error("The exponent " + n.toString() + " is too large."); + if (this.isSmall) { + if (isPrecise(value = Math.pow(a, b))) + return new SmallInteger(truncate(value)); + } + x = this; + y = Integer[1]; + while (true) { + if (b & 1 === 1) { + y = y.times(x); + --b; + } + if (b === 0) break; + b /= 2; + x = x.square(); + } + return y; + }; + SmallInteger.prototype.pow = BigInteger.prototype.pow; + + BigInteger.prototype.modPow = function (exp, mod) { + exp = parseValue(exp); + mod = parseValue(mod); + if (mod.isZero()) throw new Error("Cannot take modPow with modulus 0"); + var r = Integer[1], + base = this.mod(mod); + while (exp.isPositive()) { + if (base.isZero()) return Integer[0]; + if (exp.isOdd()) r = r.multiply(base).mod(mod); + exp = exp.divide(2); + base = base.square().mod(mod); + } + return r; + }; + SmallInteger.prototype.modPow = BigInteger.prototype.modPow; + + function compareAbs(a, b) { + if (a.length !== b.length) { + return a.length > b.length ? 1 : -1; + } + for (var i = a.length - 1; i >= 0; i--) { + if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1; + } + return 0; + } + + BigInteger.prototype.compareAbs = function (v) { + var n = parseValue(v), + a = this.value, + b = n.value; + if (n.isSmall) return 1; + return compareAbs(a, b); + }; + SmallInteger.prototype.compareAbs = function (v) { + var n = parseValue(v), + a = Math.abs(this.value), + b = n.value; + if (n.isSmall) { + b = Math.abs(b); + return a === b ? 0 : a > b ? 1 : -1; + } + return -1; + }; + + BigInteger.prototype.compare = function (v) { + // See discussion about comparison with Infinity: + // https://github.com/peterolson/BigInteger.js/issues/61 + if (v === Infinity) { + return -1; + } + if (v === -Infinity) { + return 1; + } + + var n = parseValue(v), + a = this.value, + b = n.value; + if (this.sign !== n.sign) { + return n.sign ? 1 : -1; + } + if (n.isSmall) { + return this.sign ? -1 : 1; + } + return compareAbs(a, b) * (this.sign ? -1 : 1); + }; + BigInteger.prototype.compareTo = BigInteger.prototype.compare; + + SmallInteger.prototype.compare = function (v) { + if (v === Infinity) { + return -1; + } + if (v === -Infinity) { + return 1; + } + + var n = parseValue(v), + a = this.value, + b = n.value; + if (n.isSmall) { + return a == b ? 0 : a > b ? 1 : -1; + } + if (a < 0 !== n.sign) { + return a < 0 ? -1 : 1; + } + return a < 0 ? 1 : -1; + }; + SmallInteger.prototype.compareTo = SmallInteger.prototype.compare; + + BigInteger.prototype.equals = function (v) { + return this.compare(v) === 0; + }; + SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals; + + BigInteger.prototype.notEquals = function (v) { + return this.compare(v) !== 0; + }; + SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals; + + BigInteger.prototype.greater = function (v) { + return this.compare(v) > 0; + }; + SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater; + + BigInteger.prototype.lesser = function (v) { + return this.compare(v) < 0; + }; + SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser; + + BigInteger.prototype.greaterOrEquals = function (v) { + return this.compare(v) >= 0; + }; + SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals; + + BigInteger.prototype.lesserOrEquals = function (v) { + return this.compare(v) <= 0; + }; + SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals; + + BigInteger.prototype.isEven = function () { + return (this.value[0] & 1) === 0; + }; + SmallInteger.prototype.isEven = function () { + return (this.value & 1) === 0; + }; + + BigInteger.prototype.isOdd = function () { + return (this.value[0] & 1) === 1; + }; + SmallInteger.prototype.isOdd = function () { + return (this.value & 1) === 1; + }; + + BigInteger.prototype.isPositive = function () { + return !this.sign; + }; + SmallInteger.prototype.isPositive = function () { + return this.value > 0; + }; + + BigInteger.prototype.isNegative = function () { + return this.sign; + }; + SmallInteger.prototype.isNegative = function () { + return this.value < 0; + }; + + BigInteger.prototype.isUnit = function () { + return false; + }; + SmallInteger.prototype.isUnit = function () { + return Math.abs(this.value) === 1; + }; + + BigInteger.prototype.isZero = function () { + return false; + }; + SmallInteger.prototype.isZero = function () { + return this.value === 0; + }; + BigInteger.prototype.isDivisibleBy = function (v) { + var n = parseValue(v); + var value = n.value; + if (value === 0) return false; + if (value === 1) return true; + if (value === 2) return this.isEven(); + return this.mod(n).equals(Integer[0]); + }; + SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy; + + function isBasicPrime(v) { + var n = v.abs(); + if (n.isUnit()) return false; + if (n.equals(2) || n.equals(3) || n.equals(5)) return true; + if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false; + if (n.lesser(49)) return true; + // we don't know if it's prime: let the other functions figure it out + } + + function millerRabinTest(n, a) { + var nPrev = n.prev(), + b = nPrev, + r = 0, + d, t, i, x; + while (b.isEven()) b = b.divide(2), r++; + next : for (i = 0; i < a.length; i++) { + if (n.lesser(a[i])) continue; + x = bigInt(a[i]).modPow(b, n); + if (x.equals(Integer[1]) || x.equals(nPrev)) continue; + for (d = r - 1; d != 0; d--) { + x = x.square().mod(n); + if (x.isUnit()) return false; + if (x.equals(nPrev)) continue next; + } + return false; + } + return true; + } + +// Set "strict" to true to force GRH-supported lower bound of 2*log(N)^2 + BigInteger.prototype.isPrime = function (strict) { + var isPrime = isBasicPrime(this); + if (isPrime !== undefined) return isPrime; + var n = this.abs(); + var bits = n.bitLength(); + if(bits <= 64) + return millerRabinTest(n, [2, 325, 9375, 28178, 450775, 9780504, 1795265022]); + var logN = Math.log(2) * bits; + var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN); + for (var a = [], i = 0; i < t; i++) { + a.push(bigInt(i + 2)); + } + return millerRabinTest(n, a); + }; + SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime; + + BigInteger.prototype.isProbablePrime = function (iterations) { + var isPrime = isBasicPrime(this); + if (isPrime !== undefined) return isPrime; + var n = this.abs(); + var t = iterations === undefined ? 5 : iterations; + for (var a = [], i = 0; i < t; i++) { + a.push(bigInt.randBetween(2, n.minus(2))); + } + return millerRabinTest(n, a); + }; + SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime; + + BigInteger.prototype.modInv = function (n) { + var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR; + while (!newR.equals(bigInt.zero)) { + q = r.divide(newR); + lastT = t; + lastR = r; + t = newT; + r = newR; + newT = lastT.subtract(q.multiply(newT)); + newR = lastR.subtract(q.multiply(newR)); + } + if (!r.equals(1)) throw new Error(this.toString() + " and " + n.toString() + " are not co-prime"); + if (t.compare(0) === -1) { + t = t.add(n); + } + if (this.isNegative()) { + return t.negate(); + } + return t; + }; + + SmallInteger.prototype.modInv = BigInteger.prototype.modInv; + + BigInteger.prototype.next = function () { + var value = this.value; + if (this.sign) { + return subtractSmall(value, 1, this.sign); + } + return new BigInteger(addSmall(value, 1), this.sign); + }; + SmallInteger.prototype.next = function () { + var value = this.value; + if (value + 1 < MAX_INT) return new SmallInteger(value + 1); + return new BigInteger(MAX_INT_ARR, false); + }; + + BigInteger.prototype.prev = function () { + var value = this.value; + if (this.sign) { + return new BigInteger(addSmall(value, 1), true); + } + return subtractSmall(value, 1, this.sign); + }; + SmallInteger.prototype.prev = function () { + var value = this.value; + if (value - 1 > -MAX_INT) return new SmallInteger(value - 1); + return new BigInteger(MAX_INT_ARR, true); + }; + + var powersOfTwo = [1]; + while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); + var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; + + function shift_isSmall(n) { + return ((typeof n === "number" || typeof n === "string") && +Math.abs(n) <= BASE) || + (n instanceof BigInteger && n.value.length <= 1); + } + + BigInteger.prototype.shiftLeft = function (n) { + if (!shift_isSmall(n)) { + throw new Error(String(n) + " is too large for shifting."); + } + n = +n; + if (n < 0) return this.shiftRight(-n); + var result = this; + if (result.isZero()) return result; + while (n >= powers2Length) { + result = result.multiply(highestPower2); + n -= powers2Length - 1; + } + return result.multiply(powersOfTwo[n]); + }; + SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft; + + BigInteger.prototype.shiftRight = function (n) { + var remQuo; + if (!shift_isSmall(n)) { + throw new Error(String(n) + " is too large for shifting."); + } + n = +n; + if (n < 0) return this.shiftLeft(-n); + var result = this; + while (n >= powers2Length) { + if (result.isZero() || (result.isNegative() && result.isUnit())) return result; + remQuo = divModAny(result, highestPower2); + result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; + n -= powers2Length - 1; + } + remQuo = divModAny(result, powersOfTwo[n]); + return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; + }; + SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight; + + function bitwise(x, y, fn) { + y = parseValue(y); + var xSign = x.isNegative(), ySign = y.isNegative(); + var xRem = xSign ? x.not() : x, + yRem = ySign ? y.not() : y; + var xDigit = 0, yDigit = 0; + var xDivMod = null, yDivMod = null; + var result = []; + while (!xRem.isZero() || !yRem.isZero()) { + xDivMod = divModAny(xRem, highestPower2); + xDigit = xDivMod[1].toJSNumber(); + if (xSign) { + xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers + } + + yDivMod = divModAny(yRem, highestPower2); + yDigit = yDivMod[1].toJSNumber(); + if (ySign) { + yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers + } + + xRem = xDivMod[0]; + yRem = yDivMod[0]; + result.push(fn(xDigit, yDigit)); + } + var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0); + for (var i = result.length - 1; i >= 0; i -= 1) { + sum = sum.multiply(highestPower2).add(bigInt(result[i])); + } + return sum; + } + + BigInteger.prototype.not = function () { + return this.negate().prev(); + }; + SmallInteger.prototype.not = BigInteger.prototype.not; + + BigInteger.prototype.and = function (n) { + return bitwise(this, n, function (a, b) { return a & b; }); + }; + SmallInteger.prototype.and = BigInteger.prototype.and; + + BigInteger.prototype.or = function (n) { + return bitwise(this, n, function (a, b) { return a | b; }); + }; + SmallInteger.prototype.or = BigInteger.prototype.or; + + BigInteger.prototype.xor = function (n) { + return bitwise(this, n, function (a, b) { return a ^ b; }); + }; + SmallInteger.prototype.xor = BigInteger.prototype.xor; + + var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I; + function roughLOB(n) { // get lowestOneBit (rough) + // SmallInteger: return Min(lowestOneBit(n), 1 << 30) + // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7] + var v = n.value, x = typeof v === "number" ? v | LOBMASK_I : v[0] + v[1] * BASE | LOBMASK_BI; + return x & -x; + } + + function integerLogarithm(value, base) { + if (base.compareTo(value) <= 0) { + var tmp = integerLogarithm(value, base.square(base)); + var p = tmp.p; + var e = tmp.e; + var t = p.multiply(base); + return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 }; + } + return { p: bigInt(1), e: 0 }; + } + + BigInteger.prototype.bitLength = function () { + var n = this; + if (n.compareTo(bigInt(0)) < 0) { + n = n.negate().subtract(bigInt(1)); + } + if (n.compareTo(bigInt(0)) === 0) { + return bigInt(0); + } + return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1)); + } + SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength; + + function max(a, b) { + a = parseValue(a); + b = parseValue(b); + return a.greater(b) ? a : b; + } + function min(a, b) { + a = parseValue(a); + b = parseValue(b); + return a.lesser(b) ? a : b; + } + function gcd(a, b) { + a = parseValue(a).abs(); + b = parseValue(b).abs(); + if (a.equals(b)) return a; + if (a.isZero()) return b; + if (b.isZero()) return a; + var c = Integer[1], d, t; + while (a.isEven() && b.isEven()) { + d = Math.min(roughLOB(a), roughLOB(b)); + a = a.divide(d); + b = b.divide(d); + c = c.multiply(d); + } + while (a.isEven()) { + a = a.divide(roughLOB(a)); + } + do { + while (b.isEven()) { + b = b.divide(roughLOB(b)); + } + if (a.greater(b)) { + t = b; b = a; a = t; + } + b = b.subtract(a); + } while (!b.isZero()); + return c.isUnit() ? a : a.multiply(c); + } + function lcm(a, b) { + a = parseValue(a).abs(); + b = parseValue(b).abs(); + return a.divide(gcd(a, b)).multiply(b); + } + function randBetween(a, b) { + a = parseValue(a); + b = parseValue(b); + var low = min(a, b), high = max(a, b); + var range = high.subtract(low).add(1); + if (range.isSmall) return low.add(Math.floor(Math.random() * range)); + var length = range.value.length - 1; + var result = [], restricted = true; + for (var i = length; i >= 0; i--) { + var top = restricted ? range.value[i] : BASE; + var digit = truncate(Math.random() * top); + result.unshift(digit); + if (digit < top) restricted = false; + } + result = arrayToSmall(result); + return low.add(typeof result === "number" ? new SmallInteger(result) : new BigInteger(result, false)); + } + var parseBase = function (text, base) { + var length = text.length; + var i; + var absBase = Math.abs(base); + for (var i = 0; i < length; i++) { + var c = text[i].toLowerCase(); + if (c === "-") continue; + if (/[a-z0-9]/.test(c)) { + if (/[0-9]/.test(c) && +c >= absBase) { + if (c === "1" && absBase === 1) continue; + throw new Error(c + " is not a valid digit in base " + base + "."); + } else if (c.charCodeAt(0) - 87 >= absBase) { + throw new Error(c + " is not a valid digit in base " + base + "."); + } + } + } + if (2 <= base && base <= 36) { + if (length <= LOG_MAX_INT / Math.log(base)) { + var result = parseInt(text, base); + if (isNaN(result)) { + throw new Error(c + " is not a valid digit in base " + base + "."); + } + return new SmallInteger(parseInt(text, base)); + } + } + base = parseValue(base); + var digits = []; + var isNegative = text[0] === "-"; + for (i = isNegative ? 1 : 0; i < text.length; i++) { + var c = text[i].toLowerCase(), + charCode = c.charCodeAt(0); + if (48 <= charCode && charCode <= 57) digits.push(parseValue(c)); + else if (97 <= charCode && charCode <= 122) digits.push(parseValue(c.charCodeAt(0) - 87)); + else if (c === "<") { + var start = i; + do { i++; } while (text[i] !== ">"); + digits.push(parseValue(text.slice(start + 1, i))); + } + else throw new Error(c + " is not a valid character"); + } + return parseBaseFromArray(digits, base, isNegative); + }; + + function parseBaseFromArray(digits, base, isNegative) { + var val = Integer[0], pow = Integer[1], i; + for (i = digits.length - 1; i >= 0; i--) { + val = val.add(digits[i].times(pow)); + pow = pow.times(base); + } + return isNegative ? val.negate() : val; + } + + function stringify(digit) { + if (digit <= 35) { + return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(digit); + } + return "<" + digit + ">"; + } + + function toBase(n, base) { + base = bigInt(base); + if (base.isZero()) { + if (n.isZero()) return { value: [0], isNegative: false }; + throw new Error("Cannot convert nonzero numbers to base 0."); + } + if (base.equals(-1)) { + if (n.isZero()) return { value: [0], isNegative: false }; + if (n.isNegative()) + return { + value: [].concat.apply([], Array.apply(null, Array(-n)) + .map(Array.prototype.valueOf, [1, 0]) + ), + isNegative: false + }; + + var arr = Array.apply(null, Array(+n - 1)) + .map(Array.prototype.valueOf, [0, 1]); + arr.unshift([1]); + return { + value: [].concat.apply([], arr), + isNegative: false + }; + } + + var neg = false; + if (n.isNegative() && base.isPositive()) { + neg = true; + n = n.abs(); + } + if (base.equals(1)) { + if (n.isZero()) return { value: [0], isNegative: false }; + + return { + value: Array.apply(null, Array(+n)) + .map(Number.prototype.valueOf, 1), + isNegative: neg + }; + } + var out = []; + var left = n, divmod; + while (left.isNegative() || left.compareAbs(base) >= 0) { + divmod = left.divmod(base); + left = divmod.quotient; + var digit = divmod.remainder; + if (digit.isNegative()) { + digit = base.minus(digit).abs(); + left = left.next(); + } + out.push(digit.toJSNumber()); + } + out.push(left.toJSNumber()); + return { value: out.reverse(), isNegative: neg }; + } + + function toBaseString(n, base) { + var arr = toBase(n, base); + return (arr.isNegative ? "-" : "") + arr.value.map(stringify).join(''); + } + + BigInteger.prototype.toArray = function (radix) { + return toBase(this, radix); + }; + + SmallInteger.prototype.toArray = function (radix) { + return toBase(this, radix); + }; + + BigInteger.prototype.toString = function (radix) { + if (radix === undefined) radix = 10; + if (radix !== 10) return toBaseString(this, radix); + var v = this.value, l = v.length, str = String(v[--l]), zeros = "0000000", digit; + while (--l >= 0) { + digit = String(v[l]); + str += zeros.slice(digit.length) + digit; + } + var sign = this.sign ? "-" : ""; + return sign + str; + }; + + SmallInteger.prototype.toString = function (radix) { + if (radix === undefined) radix = 10; + if (radix != 10) return toBaseString(this, radix); + return String(this.value); + }; + BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); } + + BigInteger.prototype.valueOf = function () { + return parseInt(this.toString(), 10); + }; + BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf; + + SmallInteger.prototype.valueOf = function () { + return this.value; + }; + SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf; + + function parseStringValue(v) { + if (isPrecise(+v)) { + var x = +v; + if (x === truncate(x)) + return new SmallInteger(x); + throw new Error("Invalid integer: " + v); + } + var sign = v[0] === "-"; + if (sign) v = v.slice(1); + var split = v.split(/e/i); + if (split.length > 2) throw new Error("Invalid integer: " + split.join("e")); + if (split.length === 2) { + var exp = split[1]; + if (exp[0] === "+") exp = exp.slice(1); + exp = +exp; + if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error("Invalid integer: " + exp + " is not a valid exponent."); + var text = split[0]; + var decimalPlace = text.indexOf("."); + if (decimalPlace >= 0) { + exp -= text.length - decimalPlace - 1; + text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1); + } + if (exp < 0) throw new Error("Cannot include negative exponent part for integers"); + text += (new Array(exp + 1)).join("0"); + v = text; + } + var isValid = /^([0-9][0-9]*)$/.test(v); + if (!isValid) throw new Error("Invalid integer: " + v); + var r = [], max = v.length, l = LOG_BASE, min = max - l; + while (max > 0) { + r.push(+v.slice(min, max)); + min -= l; + if (min < 0) min = 0; + max -= l; + } + trim(r); + return new BigInteger(r, sign); + } + + function parseNumberValue(v) { + if (isPrecise(v)) { + if (v !== truncate(v)) throw new Error(v + " is not an integer."); + return new SmallInteger(v); + } + return parseStringValue(v.toString()); + } + + function parseValue(v) { + if (typeof v === "number") { + return parseNumberValue(v); + } + if (typeof v === "string") { + return parseStringValue(v); + } + return v; + } + // Pre-define numbers in range [-999,999] + for (var i = 0; i < 1000; i++) { + Integer[i] = new SmallInteger(i); + if (i > 0) Integer[-i] = new SmallInteger(-i); + } + // Backwards compatibility + Integer.one = Integer[1]; + Integer.zero = Integer[0]; + Integer.minusOne = Integer[-1]; + Integer.max = max; + Integer.min = min; + Integer.gcd = gcd; + Integer.lcm = lcm; + Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger; }; + Integer.randBetween = randBetween; + + Integer.fromArray = function (digits, base, isNegative) { + return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative); + }; + + return Integer; +})(); + +// Node.js check +if (typeof module !== "undefined" && module.hasOwnProperty("exports")) { + module.exports = bigInt; +} + +//amd check +if (typeof define === "function" && define.amd) { + define("big-integer", [], function () { + return bigInt; + }); +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.min.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.min.js new file mode 100644 index 0000000..c69e29e --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/BigInteger.min.js @@ -0,0 +1 @@ +var bigInt=function(undefined){"use strict";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),LOG_MAX_INT=Math.log(MAX_INT);function Integer(v,radix){if(typeof v==="undefined")return Integer[0];if(typeof radix!=="undefined")return+radix===10?parseValue(v):parseBase(v,radix);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value==="number"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);var a=self.value,b=n.value;var quotient;if(b===0)throw new Error("Cannot divide by zero");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absb.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);var value=n.value;if(value===0)return false;if(value===1)return true;if(value===2)return this.isEven();return this.mod(n).equals(Integer[0])};SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(49))return true}function millerRabinTest(n,a){var nPrev=n.prev(),b=nPrev,r=0,d,t,i,x;while(b.isEven())b=b.divide(2),r++;next:for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return(typeof n==="number"||typeof n==="string")&&+Math.abs(n)<=BASE||n instanceof BigInteger&&n.value.length<=1}BigInteger.prototype.shiftLeft=function(n){if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}n=+n;if(n<0)return this.shiftRight(-n);var result=this;if(result.isZero())return result;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(n){var remQuo;if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}n=+n;if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero()||result.isNegative()&&result.isUnit())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v==="number"?v|LOBMASK_I:v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function integerLogarithm(value,base){if(base.compareTo(value)<=0){var tmp=integerLogarithm(value,base.square(base));var p=tmp.p;var e=tmp.e;var t=p.multiply(base);return t.compareTo(value)<=0?{p:t,e:e*2+1}:{p:p,e:e*2}}return{p:bigInt(1),e:0}}BigInteger.prototype.bitLength=function(){var n=this;if(n.compareTo(bigInt(0))<0){n=n.negate().subtract(bigInt(1))}if(n.compareTo(bigInt(0))===0){return bigInt(0)}return bigInt(integerLogarithm(n,bigInt(2)).e).add(bigInt(1))};SmallInteger.prototype.bitLength=BigInteger.prototype.bitLength;function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=Math.min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b){a=parseValue(a);b=parseValue(b);var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(Math.random()*range));var length=range.value.length-1;var result=[],restricted=true;for(var i=length;i>=0;i--){var top=restricted?range.value[i]:BASE;var digit=truncate(Math.random()*top);result.unshift(digit);if(digit=absBase){if(c==="1"&&absBase===1)continue;throw new Error(c+" is not a valid digit in base "+base+".")}else if(c.charCodeAt(0)-87>=absBase){throw new Error(c+" is not a valid digit in base "+base+".")}}}if(2<=base&&base<=36){if(length<=LOG_MAX_INT/Math.log(base)){var result=parseInt(text,base);if(isNaN(result)){throw new Error(c+" is not a valid digit in base "+base+".")}return new SmallInteger(parseInt(text,base))}}base=parseValue(base);var digits=[];var isNegative=text[0]==="-";for(i=isNegative?1:0;i");digits.push(parseValue(text.slice(start+1,i)))}else throw new Error(c+" is not a valid character")}return parseBaseFromArray(digits,base,isNegative)};function parseBaseFromArray(digits,base,isNegative){var val=Integer[0],pow=Integer[1],i;for(i=digits.length-1;i>=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit){if(digit<=35){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(digit)}return"<"+digit+">"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return{value:[0],isNegative:false};throw new Error("Cannot convert nonzero numbers to base 0.")}if(base.equals(-1)){if(n.isZero())return{value:[0],isNegative:false};if(n.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-n)).map(Array.prototype.valueOf,[1,0])),isNegative:false};var arr=Array.apply(null,Array(+n-1)).map(Array.prototype.valueOf,[0,1]);arr.unshift([1]);return{value:[].concat.apply([],arr),isNegative:false}}var neg=false;if(n.isNegative()&&base.isPositive()){neg=true;n=n.abs()}if(base.equals(1)){if(n.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(+n)).map(Number.prototype.valueOf,1),isNegative:neg}}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(digit.toJSNumber())}out.push(left.toJSNumber());return{value:out.reverse(),isNegative:neg}}function toBaseString(n,base){var arr=toBase(n,base);return(arr.isNegative?"-":"")+arr.value.map(stringify).join("")}BigInteger.prototype.toArray=function(radix){return toBase(this,radix)};SmallInteger.prototype.toArray=function(radix){return toBase(this,radix)};BigInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!==10)return toBaseString(this,radix);var v=this.value,l=v.length,str=String(v[--l]),zeros="0000000",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?"-":"";return sign+str};SmallInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!=10)return toBaseString(this,radix);return String(this.value)};BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return new SmallInteger(x);throw new Error("Invalid integer: "+v)}var sign=v[0]==="-";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error("Invalid integer: "+split.join("e"));if(split.length===2){var exp=split[1];if(exp[0]==="+")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error("Invalid integer: "+exp+" is not a valid exponent.");var text=split[0];var decimalPlace=text.indexOf(".");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error("Cannot include negative exponent part for integers");text+=new Array(exp+1).join("0");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error("Invalid integer: "+v);var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}trim(r);return new BigInteger(r,sign)}function parseNumberValue(v){if(isPrecise(v)){if(v!==truncate(v))throw new Error(v+" is not an integer.");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v==="number"){return parseNumberValue(v)}if(typeof v==="string"){return parseStringValue(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=new SmallInteger(i);if(i>0)Integer[-i]=new SmallInteger(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();if(typeof module!=="undefined"&&module.hasOwnProperty("exports")){module.exports=bigInt}if(typeof define==="function"&&define.amd){define("big-integer",[],function(){return bigInt})} \ No newline at end of file diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/LICENSE b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/LICENSE new file mode 100644 index 0000000..3ce22da --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/LICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +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 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. + +For more information, please refer to diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/README.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/README.md new file mode 100644 index 0000000..dc4885e --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/README.md @@ -0,0 +1,570 @@ +# BigInteger.js [![Build Status][travis-img]][travis-url] [![Coverage Status][coveralls-img]][coveralls-url] [![Monthly Downloads][downloads-img]][downloads-url] + +[travis-url]: https://travis-ci.org/peterolson/BigInteger.js +[travis-img]: https://travis-ci.org/peterolson/BigInteger.js.svg?branch=master +[coveralls-url]: https://coveralls.io/github/peterolson/BigInteger.js?branch=master +[coveralls-img]: https://coveralls.io/repos/peterolson/BigInteger.js/badge.svg?branch=master&service=github +[downloads-url]: https://www.npmjs.com/package/big-integer +[downloads-img]: https://img.shields.io/npm/dm/big-integer.svg + +**BigInteger.js** is an arbitrary-length integer library for Javascript, allowing arithmetic operations on integers of unlimited size, notwithstanding memory and time limitations. + +## Installation + +If you are using a browser, you can download [BigInteger.js from GitHub](http://peterolson.github.com/BigInteger.js/BigInteger.min.js) or just hotlink to it: + + + +If you are using node, you can install BigInteger with [npm](https://npmjs.org/). + + npm install big-integer + +Then you can include it in your code: + + var bigInt = require("big-integer"); + + +## Usage +### `bigInt(number, [base])` + +You can create a bigInt by calling the `bigInt` function. You can pass in + + - a string, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails. + - a Javascript number, which it will parse as an bigInt and throw an `"Invalid integer"` error if the parsing fails. + - another bigInt. + - nothing, and it will return `bigInt.zero`. + + If you provide a second parameter, then it will parse `number` as a number in base `base`. Note that `base` can be any bigInt (even negative or zero). The letters "a-z" and "A-Z" will be interpreted as the numbers 10 to 35. Higher digits can be specified in angle brackets (`<` and `>`). + +Examples: + + var zero = bigInt(); + var ninetyThree = bigInt(93); + var largeNumber = bigInt("75643564363473453456342378564387956906736546456235345"); + var googol = bigInt("1e100"); + var bigNumber = bigInt(largeNumber); + + var maximumByte = bigInt("FF", 16); + var fiftyFiveGoogol = bigInt("<55>0", googol); + +Note that Javascript numbers larger than `9007199254740992` and smaller than `-9007199254740992` are not precisely represented numbers and will not produce exact results. If you are dealing with numbers outside that range, it is better to pass in strings. + +### Method Chaining + +Note that bigInt operations return bigInts, which allows you to chain methods, for example: + + var salary = bigInt(dollarsPerHour).times(hoursWorked).plus(randomBonuses) + +### Constants + +There are three named constants already stored that you do not have to construct with the `bigInt` function yourself: + + - `bigInt.one`, equivalent to `bigInt(1)` + - `bigInt.zero`, equivalent to `bigInt(0)` + - `bigInt.minusOne`, equivalent to `bigInt(-1)` + +The numbers from -999 to 999 are also already prestored and can be accessed using `bigInt[index]`, for example: + + - `bigInt[-999]`, equivalent to `bigInt(-999)` + - `bigInt[256]`, equivalent to `bigInt(256)` + +### Methods + +#### `abs()` + +Returns the absolute value of a bigInt. + + - `bigInt(-45).abs()` => `45` + - `bigInt(45).abs()` => `45` + +#### `add(number)` + +Performs addition. + + - `bigInt(5).add(7)` => `12` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition) + +#### `and(number)` + +Performs the bitwise AND operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(6).and(3)` => `2` + - `bigInt(6).and(-3)` => `4` + +#### `bitLength()` + +Returns the number of digits required to represent a bigInt in binary. + + - `bigInt(5)` => `3` (since 5 is `101` in binary, which is three digits long) + +#### `compare(number)` + +Performs a comparison between two numbers. If the numbers are equal, it returns `0`. If the first number is greater, it returns `1`. If the first number is lesser, it returns `-1`. + + - `bigInt(5).compare(5)` => `0` + - `bigInt(5).compare(4)` => `1` + - `bigInt(4).compare(5)` => `-1` + +#### `compareAbs(number)` + +Performs a comparison between the absolute value of two numbers. + + - `bigInt(5).compareAbs(-5)` => `0` + - `bigInt(5).compareAbs(4)` => `1` + - `bigInt(4).compareAbs(-5)` => `-1` + +#### `compareTo(number)` + +Alias for the `compare` method. + +#### `divide(number)` + +Performs integer division, disregarding the remainder. + + - `bigInt(59).divide(5)` => `11` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `divmod(number)` + +Performs division and returns an object with two properties: `quotient` and `remainder`. The sign of the remainder will match the sign of the dividend. + + - `bigInt(59).divmod(5)` => `{quotient: bigInt(11), remainder: bigInt(4) }` + - `bigInt(-5).divmod(2)` => `{quotient: bigInt(-2), remainder: bigInt(-1) }` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `eq(number)` + +Alias for the `equals` method. + +#### `equals(number)` + +Checks if two numbers are equal. + + - `bigInt(5).equals(5)` => `true` + - `bigInt(4).equals(7)` => `false` + +#### `geq(number)` + +Alias for the `greaterOrEquals` method. + + +#### `greater(number)` + +Checks if the first number is greater than the second. + + - `bigInt(5).greater(6)` => `false` + - `bigInt(5).greater(5)` => `false` + - `bigInt(5).greater(4)` => `true` + +#### `greaterOrEquals(number)` + +Checks if the first number is greater than or equal to the second. + + - `bigInt(5).greaterOrEquals(6)` => `false` + - `bigInt(5).greaterOrEquals(5)` => `true` + - `bigInt(5).greaterOrEquals(4)` => `true` + +#### `gt(number)` + +Alias for the `greater` method. + +#### `isDivisibleBy(number)` + +Returns `true` if the first number is divisible by the second number, `false` otherwise. + + - `bigInt(999).isDivisibleBy(333)` => `true` + - `bigInt(99).isDivisibleBy(5)` => `false` + +#### `isEven()` + +Returns `true` if the number is even, `false` otherwise. + + - `bigInt(6).isEven()` => `true` + - `bigInt(3).isEven()` => `false` + +#### `isNegative()` + +Returns `true` if the number is negative, `false` otherwise. +Returns `false` for `0` and `-0`. + + - `bigInt(-23).isNegative()` => `true` + - `bigInt(50).isNegative()` => `false` + +#### `isOdd()` + +Returns `true` if the number is odd, `false` otherwise. + + - `bigInt(13).isOdd()` => `true` + - `bigInt(40).isOdd()` => `false` + +#### `isPositive()` + +Return `true` if the number is positive, `false` otherwise. +Returns `false` for `0` and `-0`. + + - `bigInt(54).isPositive()` => `true` + - `bigInt(-1).isPositive()` => `false` + +#### `isPrime()` + +Returns `true` if the number is prime, `false` otherwise. + + - `bigInt(5).isPrime()` => `true` + - `bigInt(6).isPrime()` => `false` + +#### `isProbablePrime([iterations])` + +Returns `true` if the number is very likely to be prime, `false` otherwise. +Argument is optional and determines the amount of iterations of the test (default: `5`). The more iterations, the lower chance of getting a false positive. +This uses the [Miller Rabin test](https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test). + + - `bigInt(5).isProbablePrime()` => `true` + - `bigInt(49).isProbablePrime()` => `false` + - `bigInt(1729).isProbablePrime()` => `false` + +Note that this function is not deterministic, since it relies on random sampling of factors, so the result for some numbers is not always the same. +If the number is composite then the Miller–Rabin primality test declares the number probably prime with a probability at most `4` to the power `−iterations`. +If the number is prime, this function always returns `true`. + +#### `isUnit()` + +Returns `true` if the number is `1` or `-1`, `false` otherwise. + + - `bigInt.one.isUnit()` => `true` + - `bigInt.minusOne.isUnit()` => `true` + - `bigInt(5).isUnit()` => `false` + +#### `isZero()` + +Return `true` if the number is `0` or `-0`, `false` otherwise. + + - `bigInt.zero.isZero()` => `true` + - `bigInt("-0").isZero()` => `true` + - `bigInt(50).isZero()` => `false` + +#### `leq(number)` + +Alias for the `lesserOrEquals` method. + +#### `lesser(number)` + +Checks if the first number is lesser than the second. + + - `bigInt(5).lesser(6)` => `true` + - `bigInt(5).lesser(5)` => `false` + - `bigInt(5).lesser(4)` => `false` + +#### `lesserOrEquals(number)` + +Checks if the first number is less than or equal to the second. + + - `bigInt(5).lesserOrEquals(6)` => `true` + - `bigInt(5).lesserOrEquals(5)` => `true` + - `bigInt(5).lesserOrEquals(4)` => `false` + +#### `lt(number)` + +Alias for the `lesser` method. + +#### `minus(number)` + +Alias for the `subtract` method. + + - `bigInt(3).minus(5)` => `-2` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction) + +#### `mod(number)` + +Performs division and returns the remainder, disregarding the quotient. The sign of the remainder will match the sign of the dividend. + + - `bigInt(59).mod(5)` => `4` + - `bigInt(-5).mod(2)` => `-1` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `modInv(mod)` + +Finds the [multiplicative inverse](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) of the number modulo `mod`. + + - `bigInt(3).modInv(11)` => `4` + - `bigInt(42).modInv(2017)` => `1969` + +#### `modPow(exp, mod)` + +Takes the number to the power `exp` modulo `mod`. + + - `bigInt(10).modPow(3, 30)` => `10` + +#### `multiply(number)` + +Performs multiplication. + + - `bigInt(111).multiply(111)` => `12321` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication) + +#### `neq(number)` + +Alias for the `notEquals` method. + +#### `next()` + +Adds one to the number. + + - `bigInt(6).next()` => `7` + +#### `not()` + +Performs the bitwise NOT operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(10).not()` => `-11` + - `bigInt(0).not()` => `-1` + +#### `notEquals(number)` + +Checks if two numbers are not equal. + + - `bigInt(5).notEquals(5)` => `false` + - `bigInt(4).notEquals(7)` => `true` + +#### `or(number)` + +Performs the bitwise OR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(13).or(10)` => `15` + - `bigInt(13).or(-8)` => `-3` + +#### `over(number)` + +Alias for the `divide` method. + + - `bigInt(59).over(5)` => `11` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `plus(number)` + +Alias for the `add` method. + + - `bigInt(5).plus(7)` => `12` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Addition) + +#### `pow(number)` + +Performs exponentiation. If the exponent is less than `0`, `pow` returns `0`. `bigInt.zero.pow(0)` returns `1`. + + - `bigInt(16).pow(16)` => `18446744073709551616` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Exponentiation) + +#### `prev(number)` + +Subtracts one from the number. + + - `bigInt(6).prev()` => `5` + +#### `remainder(number)` + +Alias for the `mod` method. + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) + +#### `shiftLeft(n)` + +Shifts the number left by `n` places in its binary representation. If a negative number is provided, it will shift right. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`. + + - `bigInt(8).shiftLeft(2)` => `32` + - `bigInt(8).shiftLeft(-2)` => `2` + +#### `shiftRight(n)` + +Shifts the number right by `n` places in its binary representation. If a negative number is provided, it will shift left. Throws an error if `n` is outside of the range `[-9007199254740992, 9007199254740992]`. + + - `bigInt(8).shiftRight(2)` => `2` + - `bigInt(8).shiftRight(-2)` => `32` + +#### `square()` + +Squares the number + + - `bigInt(3).square()` => `9` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Squaring) + +#### `subtract(number)` + +Performs subtraction. + + - `bigInt(3).subtract(5)` => `-2` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Subtraction) + +#### `times(number)` + +Alias for the `multiply` method. + + - `bigInt(111).times(111)` => `12321` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Multiplication) + +#### `toArray(radix)` + +Converts a bigInt into an object with the properties "value" and "isNegative." "Value" is an array of integers modulo the given radix. "isNegative" is a boolean that represents the sign of the result. + + - `bigInt("1e9").toArray(10)` => { + value: [1, 0, 0, 0, 0, 0, 0, 0, 0, 0], + isNegative: false + } + - `bigInt("1e9").toArray(16)` => { + value: [3, 11, 9, 10, 12, 10, 0, 0], + isNegative: false + } + - `bigInt(567890).toArray(100)` => { + value: [56, 78, 90], + isNegative: false + } + +Negative bases are supported. + + - `bigInt(12345).toArray(-10)` => { + value: [2, 8, 4, 6, 5], + isNegative: false + } + +Base 1 and base -1 are also supported. + + - `bigInt(-15).toArray(1)` => { + value: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], + isNegative: true + } + - `bigInt(-15).toArray(-1)` => { + value: [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0], + isNegative: false + } + +Base 0 is only allowed for the number zero. + + - `bigInt(0).toArray(0)` => { + value: [0], + isNegative: false + } + - `bigInt(1).toArray(0)` => `Error: Cannot convert nonzero numbers to base 0.` + +#### `toJSNumber()` + +Converts a bigInt into a native Javascript number. Loses precision for numbers outside the range `[-9007199254740992, 9007199254740992]`. + + - `bigInt("18446744073709551616").toJSNumber()` => `18446744073709552000` + +#### `xor(number)` + +Performs the bitwise XOR operation. The operands are treated as if they were represented using [two's complement representation](http://en.wikipedia.org/wiki/Two%27s_complement). + + - `bigInt(12).xor(5)` => `9` + - `bigInt(12).xor(-5)` => `-9` + +### Static Methods + +#### `fromArray(digits, base = 10, isNegative?)` + +Constructs a bigInt from an array of digits in base `base`. The optional `isNegative` flag will make the number negative. + + - `bigInt.fromArray([1, 2, 3, 4, 5], 10)` => `12345` + - `bigInt.fromArray([1, 0, 0], 2, true)` => `-4` + +#### `gcd(a, b)` + +Finds the greatest common denominator of `a` and `b`. + + - `bigInt.gcd(42,56)` => `14` + +#### `isInstance(x)` + +Returns `true` if `x` is a BigInteger, `false` otherwise. + + - `bigInt.isInstance(bigInt(14))` => `true` + - `bigInt.isInstance(14)` => `false` + +#### `lcm(a,b)` + +Finds the least common multiple of `a` and `b`. + + - `bigInt.lcm(21, 6)` => `42` + +#### `max(a,b)` + +Returns the largest of `a` and `b`. + + - `bigInt.max(77, 432)` => `432` + +#### `min(a,b)` + +Returns the smallest of `a` and `b`. + + - `bigInt.min(77, 432)` => `77` + +#### `randBetween(min, max)` + +Returns a random number between `min` and `max`. + + - `bigInt.randBetween("-1e100", "1e100")` => (for example) `8494907165436643479673097939554427056789510374838494147955756275846226209006506706784609314471378745` + + +### Override Methods + +#### `toString(radix = 10)` + +Converts a bigInt to a string. There is an optional radix parameter (which defaults to 10) that converts the number to the given radix. Digits in the range `10-35` will use the letters `a-z`. + + - `bigInt("1e9").toString()` => `"1000000000"` + - `bigInt("1e9").toString(16)` => `"3b9aca00"` + +**Note that arithmetical operators will trigger the `valueOf` function rather than the `toString` function.** When converting a bigInteger to a string, you should use the `toString` method or the `String` function instead of adding the empty string. + + - `bigInt("999999999999999999").toString()` => `"999999999999999999"` + - `String(bigInt("999999999999999999"))` => `"999999999999999999"` + - `bigInt("999999999999999999") + ""` => `1000000000000000000` + +Bases larger than 36 are supported. If a digit is greater than or equal to 36, it will be enclosed in angle brackets. + + - `bigInt(567890).toString(100)` => `"<56><78><90>"` + +Negative bases are also supported. + + - `bigInt(12345).toString(-10)` => `"28465"` + +Base 1 and base -1 are also supported. + + - `bigInt(-15).toString(1)` => `"-111111111111111"` + - `bigInt(-15).toString(-1)` => `"101010101010101010101010101010"` + +Base 0 is only allowed for the number zero. + + - `bigInt(0).toString(0)` => `0` + - `bigInt(1).toString(0)` => `Error: Cannot convert nonzero numbers to base 0.` + +[View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#toString) + +#### `valueOf()` + +Converts a bigInt to a native Javascript number. This override allows you to use native arithmetic operators without explicit conversion: + + - `bigInt("100") + bigInt("200") === 300; //true` + +## Contributors + +To contribute, just fork the project, make some changes, and submit a pull request. Please verify that the unit tests pass before submitting. + +The unit tests are contained in the `spec/spec.js` file. You can run them locally by opening the `spec/SpecRunner.html` or file or running `npm test`. You can also [run the tests online from GitHub](http://peterolson.github.io/BigInteger.js/spec/SpecRunner.html). + +There are performance benchmarks that can be viewed from the `benchmarks/index.html` page. You can [run them online from GitHub](http://peterolson.github.io/BigInteger.js/benchmark/). + +## License + +This project is public domain. For more details, read about the [Unlicense](http://unlicense.org/). diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/bower.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/bower.json new file mode 100644 index 0000000..c744605 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/bower.json @@ -0,0 +1,29 @@ +{ + "name": "big-integer", + "description": "An arbitrary length integer library for Javascript", + "main": "./BigInteger.js", + "authors": [ + "Peter Olson" + ], + "license": "Unlicense", + "keywords": [ + "math", + "big", + "bignum", + "bigint", + "biginteger", + "integer", + "arbitrary", + "precision", + "arithmetic" + ], + "homepage": "https://github.com/peterolson/BigInteger.js", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "coverage", + "tests" + ] +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/package.json new file mode 100644 index 0000000..9370160 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/package.json @@ -0,0 +1,80 @@ +{ + "_from": "big-integer@^1.6.7", + "_id": "big-integer@1.6.36", + "_inBundle": false, + "_integrity": "sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg==", + "_location": "/alfred-mvns/big-integer", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "big-integer@^1.6.7", + "name": "big-integer", + "escapedName": "big-integer", + "rawSpec": "^1.6.7", + "saveSpec": null, + "fetchSpec": "^1.6.7" + }, + "_requiredBy": [ + "/alfred-mvns/bplist-parser" + ], + "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.36.tgz", + "_shasum": "78631076265d4ae3555c04f85e7d9d2f3a071a36", + "_spec": "big-integer@^1.6.7", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/bplist-parser", + "author": { + "name": "Peter Olson", + "email": "peter.e.c.olson+npm@gmail.com" + }, + "bin": {}, + "bugs": { + "url": "https://github.com/peterolson/BigInteger.js/issues" + }, + "bundleDependencies": false, + "contributors": [], + "deprecated": false, + "description": "An arbitrary length integer library for Javascript", + "devDependencies": { + "@types/lodash": "^4.14.109", + "@types/node": "^7.0.65", + "coveralls": "^2.11.4", + "jasmine": "2.1.x", + "jasmine-core": "^2.3.4", + "karma": "^0.13.22", + "karma-cli": "^1.0.1", + "karma-coverage": "^0.4.2", + "karma-jasmine": "^0.3.6", + "karma-phantomjs-launcher": "^1.0.4", + "lodash": "^4.17.4", + "typescript": "^2.3.3", + "uglifyjs": "^2.4.10" + }, + "engines": { + "node": ">=0.6" + }, + "homepage": "https://github.com/peterolson/BigInteger.js#readme", + "keywords": [ + "math", + "big", + "bignum", + "bigint", + "biginteger", + "integer", + "arbitrary", + "precision", + "arithmetic" + ], + "license": "Unlicense", + "main": "./BigInteger", + "name": "big-integer", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/peterolson/BigInteger.js.git" + }, + "scripts": { + "minify": "uglifyjs BigInteger.js -o BigInteger.min.js", + "test": "tsc && karma start my.conf.js && node spec/tsDefinitions.js" + }, + "typings": "./BigInteger.d.ts", + "version": "1.6.36" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/tsconfig.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/tsconfig.json new file mode 100644 index 0000000..920c4ce --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/big-integer/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "./", + "moduleResolution": "node", + "allowJs": true, + "typeRoots": [ + "./" + ], + "types": [ + "node" + ], + "forceConsistentCasingInFileNames": true + }, + "files": [ + "BigInteger.d.ts", + "spec/tsDefinitions.ts" + ] +} \ No newline at end of file diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/.npmignore b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/.npmignore new file mode 100644 index 0000000..a9b46ea --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/.npmignore @@ -0,0 +1,8 @@ +/build/* +node_modules +*.node +*.sh +*.swp +.lock* +npm-debug.log +.idea diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/README.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/README.md new file mode 100644 index 0000000..37e5e1c --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/README.md @@ -0,0 +1,47 @@ +bplist-parser +============= + +Binary Mac OS X Plist (property list) parser. + +## Installation + +```bash +$ npm install bplist-parser +``` + +## Quick Examples + +```javascript +var bplist = require('bplist-parser'); + +bplist.parseFile('myPlist.bplist', function(err, obj) { + if (err) throw err; + + console.log(JSON.stringify(obj)); +}); +``` + +## License + +(The MIT License) + +Copyright (c) 2012 Near Infinity Corporation + +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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/bplistParser.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/bplistParser.js new file mode 100644 index 0000000..f8335bc --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/bplistParser.js @@ -0,0 +1,357 @@ +'use strict'; + +// adapted from http://code.google.com/p/plist/source/browse/trunk/src/com/dd/plist/BinaryPropertyListParser.java + +var fs = require('fs'); +var bigInt = require("big-integer"); +var debug = false; + +exports.maxObjectSize = 100 * 1000 * 1000; // 100Meg +exports.maxObjectCount = 32768; + +// EPOCH = new SimpleDateFormat("yyyy MM dd zzz").parse("2001 01 01 GMT").getTime(); +// ...but that's annoying in a static initializer because it can throw exceptions, ick. +// So we just hardcode the correct value. +var EPOCH = 978307200000; + +// UID object definition +var UID = exports.UID = function(id) { + this.UID = id; +} + +var parseFile = exports.parseFile = function (fileNameOrBuffer, callback) { + function tryParseBuffer(buffer) { + var err = null; + var result; + try { + result = parseBuffer(buffer); + } catch (ex) { + err = ex; + } + callback(err, result); + } + + if (Buffer.isBuffer(fileNameOrBuffer)) { + return tryParseBuffer(fileNameOrBuffer); + } else { + fs.readFile(fileNameOrBuffer, function (err, data) { + if (err) { return callback(err); } + tryParseBuffer(data); + }); + } +}; + +var parseBuffer = exports.parseBuffer = function (buffer) { + var result = {}; + + // check header + var header = buffer.slice(0, 'bplist'.length).toString('utf8'); + if (header !== 'bplist') { + throw new Error("Invalid binary plist. Expected 'bplist' at offset 0."); + } + + // Handle trailer, last 32 bytes of the file + var trailer = buffer.slice(buffer.length - 32, buffer.length); + // 6 null bytes (index 0 to 5) + var offsetSize = trailer.readUInt8(6); + if (debug) { + console.log("offsetSize: " + offsetSize); + } + var objectRefSize = trailer.readUInt8(7); + if (debug) { + console.log("objectRefSize: " + objectRefSize); + } + var numObjects = readUInt64BE(trailer, 8); + if (debug) { + console.log("numObjects: " + numObjects); + } + var topObject = readUInt64BE(trailer, 16); + if (debug) { + console.log("topObject: " + topObject); + } + var offsetTableOffset = readUInt64BE(trailer, 24); + if (debug) { + console.log("offsetTableOffset: " + offsetTableOffset); + } + + if (numObjects > exports.maxObjectCount) { + throw new Error("maxObjectCount exceeded"); + } + + // Handle offset table + var offsetTable = []; + + for (var i = 0; i < numObjects; i++) { + var offsetBytes = buffer.slice(offsetTableOffset + i * offsetSize, offsetTableOffset + (i + 1) * offsetSize); + offsetTable[i] = readUInt(offsetBytes, 0); + if (debug) { + console.log("Offset for Object #" + i + " is " + offsetTable[i] + " [" + offsetTable[i].toString(16) + "]"); + } + } + + // Parses an object inside the currently parsed binary property list. + // For the format specification check + // + // Apple's binary property list parser implementation. + function parseObject(tableOffset) { + var offset = offsetTable[tableOffset]; + var type = buffer[offset]; + var objType = (type & 0xF0) >> 4; //First 4 bits + var objInfo = (type & 0x0F); //Second 4 bits + switch (objType) { + case 0x0: + return parseSimple(); + case 0x1: + return parseInteger(); + case 0x8: + return parseUID(); + case 0x2: + return parseReal(); + case 0x3: + return parseDate(); + case 0x4: + return parseData(); + case 0x5: // ASCII + return parsePlistString(); + case 0x6: // UTF-16 + return parsePlistString(true); + case 0xA: + return parseArray(); + case 0xD: + return parseDictionary(); + default: + throw new Error("Unhandled type 0x" + objType.toString(16)); + } + + function parseSimple() { + //Simple + switch (objInfo) { + case 0x0: // null + return null; + case 0x8: // false + return false; + case 0x9: // true + return true; + case 0xF: // filler byte + return null; + default: + throw new Error("Unhandled simple type 0x" + objType.toString(16)); + } + } + + function bufferToHexString(buffer) { + var str = ''; + var i; + for (i = 0; i < buffer.length; i++) { + if (buffer[i] != 0x00) { + break; + } + } + for (; i < buffer.length; i++) { + var part = '00' + buffer[i].toString(16); + str += part.substr(part.length - 2); + } + return str; + } + + function parseInteger() { + var length = Math.pow(2, objInfo); + if (length > 4) { + var data = buffer.slice(offset + 1, offset + 1 + length); + var str = bufferToHexString(data); + return bigInt(str, 16); + } if (length < exports.maxObjectSize) { + return readUInt(buffer.slice(offset + 1, offset + 1 + length)); + } else { + throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); + } + } + + function parseUID() { + var length = objInfo + 1; + if (length < exports.maxObjectSize) { + return new UID(readUInt(buffer.slice(offset + 1, offset + 1 + length))); + } else { + throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); + } + } + + function parseReal() { + var length = Math.pow(2, objInfo); + if (length < exports.maxObjectSize) { + var realBuffer = buffer.slice(offset + 1, offset + 1 + length); + if (length === 4) { + return realBuffer.readFloatBE(0); + } + else if (length === 8) { + return realBuffer.readDoubleBE(0); + } + } else { + throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); + } + } + + function parseDate() { + if (objInfo != 0x3) { + console.error("Unknown date type :" + objInfo + ". Parsing anyway..."); + } + var dateBuffer = buffer.slice(offset + 1, offset + 9); + return new Date(EPOCH + (1000 * dateBuffer.readDoubleBE(0))); + } + + function parseData() { + var dataoffset = 1; + var length = objInfo; + if (objInfo == 0xF) { + var int_type = buffer[offset + 1]; + var intType = (int_type & 0xF0) / 0x10; + if (intType != 0x1) { + console.error("0x4: UNEXPECTED LENGTH-INT TYPE! " + intType); + } + var intInfo = int_type & 0x0F; + var intLength = Math.pow(2, intInfo); + dataoffset = 2 + intLength; + if (intLength < 3) { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } else { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } + } + if (length < exports.maxObjectSize) { + return buffer.slice(offset + dataoffset, offset + dataoffset + length); + } else { + throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); + } + } + + function parsePlistString (isUtf16) { + isUtf16 = isUtf16 || 0; + var enc = "utf8"; + var length = objInfo; + var stroffset = 1; + if (objInfo == 0xF) { + var int_type = buffer[offset + 1]; + var intType = (int_type & 0xF0) / 0x10; + if (intType != 0x1) { + console.err("UNEXPECTED LENGTH-INT TYPE! " + intType); + } + var intInfo = int_type & 0x0F; + var intLength = Math.pow(2, intInfo); + var stroffset = 2 + intLength; + if (intLength < 3) { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } else { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } + } + // length is String length -> to get byte length multiply by 2, as 1 character takes 2 bytes in UTF-16 + length *= (isUtf16 + 1); + if (length < exports.maxObjectSize) { + var plistString = new Buffer(buffer.slice(offset + stroffset, offset + stroffset + length)); + if (isUtf16) { + plistString = swapBytes(plistString); + enc = "ucs2"; + } + return plistString.toString(enc); + } else { + throw new Error("To little heap space available! Wanted to read " + length + " bytes, but only " + exports.maxObjectSize + " are available."); + } + } + + function parseArray() { + var length = objInfo; + var arrayoffset = 1; + if (objInfo == 0xF) { + var int_type = buffer[offset + 1]; + var intType = (int_type & 0xF0) / 0x10; + if (intType != 0x1) { + console.error("0xa: UNEXPECTED LENGTH-INT TYPE! " + intType); + } + var intInfo = int_type & 0x0F; + var intLength = Math.pow(2, intInfo); + arrayoffset = 2 + intLength; + if (intLength < 3) { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } else { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } + } + if (length * objectRefSize > exports.maxObjectSize) { + throw new Error("To little heap space available!"); + } + var array = []; + for (var i = 0; i < length; i++) { + var objRef = readUInt(buffer.slice(offset + arrayoffset + i * objectRefSize, offset + arrayoffset + (i + 1) * objectRefSize)); + array[i] = parseObject(objRef); + } + return array; + } + + function parseDictionary() { + var length = objInfo; + var dictoffset = 1; + if (objInfo == 0xF) { + var int_type = buffer[offset + 1]; + var intType = (int_type & 0xF0) / 0x10; + if (intType != 0x1) { + console.error("0xD: UNEXPECTED LENGTH-INT TYPE! " + intType); + } + var intInfo = int_type & 0x0F; + var intLength = Math.pow(2, intInfo); + dictoffset = 2 + intLength; + if (intLength < 3) { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } else { + length = readUInt(buffer.slice(offset + 2, offset + 2 + intLength)); + } + } + if (length * 2 * objectRefSize > exports.maxObjectSize) { + throw new Error("To little heap space available!"); + } + if (debug) { + console.log("Parsing dictionary #" + tableOffset); + } + var dict = {}; + for (var i = 0; i < length; i++) { + var keyRef = readUInt(buffer.slice(offset + dictoffset + i * objectRefSize, offset + dictoffset + (i + 1) * objectRefSize)); + var valRef = readUInt(buffer.slice(offset + dictoffset + (length * objectRefSize) + i * objectRefSize, offset + dictoffset + (length * objectRefSize) + (i + 1) * objectRefSize)); + var key = parseObject(keyRef); + var val = parseObject(valRef); + if (debug) { + console.log(" DICT #" + tableOffset + ": Mapped " + key + " to " + val); + } + dict[key] = val; + } + return dict; + } + } + + return [ parseObject(topObject) ]; +}; + +function readUInt(buffer, start) { + start = start || 0; + + var l = 0; + for (var i = start; i < buffer.length; i++) { + l <<= 8; + l |= buffer[i] & 0xFF; + } + return l; +} + +// we're just going to toss the high order bits because javascript doesn't have 64-bit ints +function readUInt64BE(buffer, start) { + var data = buffer.slice(start, start + 8); + return data.readUInt32BE(4, 8); +} + +function swapBytes(buffer) { + var len = buffer.length; + for (var i = 0; i < len; i += 2) { + var a = buffer[i]; + buffer[i] = buffer[i+1]; + buffer[i+1] = a; + } + return buffer; +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/package.json new file mode 100644 index 0000000..f5c1ebc --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/package.json @@ -0,0 +1,58 @@ +{ + "_from": "bplist-parser@^0.1.1", + "_id": "bplist-parser@0.1.1", + "_inBundle": false, + "_integrity": "sha1-1g1dzCDLptx+HymbNdPh+V2vuuY=", + "_location": "/alfred-mvns/bplist-parser", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "bplist-parser@^0.1.1", + "name": "bplist-parser", + "escapedName": "bplist-parser", + "rawSpec": "^0.1.1", + "saveSpec": null, + "fetchSpec": "^0.1.1" + }, + "_requiredBy": [ + "/alfred-mvns/resolve-alfred-prefs" + ], + "_resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.1.1.tgz", + "_shasum": "d60d5dcc20cba6dc7e1f299b35d3e1f95dafbae6", + "_spec": "bplist-parser@^0.1.1", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/resolve-alfred-prefs", + "author": { + "name": "Joe Ferner", + "email": "joe.ferner@nearinfinity.com" + }, + "bugs": { + "url": "https://github.com/nearinfinity/node-bplist-parser/issues" + }, + "bundleDependencies": false, + "dependencies": { + "big-integer": "^1.6.7" + }, + "deprecated": false, + "description": "Binary plist parser.", + "devDependencies": { + "nodeunit": "~0.9.1" + }, + "homepage": "https://github.com/nearinfinity/node-bplist-parser#readme", + "keywords": [ + "bplist", + "plist", + "parser" + ], + "license": "MIT", + "main": "bplistParser.js", + "name": "bplist-parser", + "repository": { + "type": "git", + "url": "git+https://github.com/nearinfinity/node-bplist-parser.git" + }, + "scripts": { + "test": "./node_modules/nodeunit/bin/nodeunit test" + }, + "version": "0.1.1" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/airplay.bplist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/airplay.bplist new file mode 100644 index 0000000..931adea Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/airplay.bplist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/iTunes-small.bplist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/iTunes-small.bplist new file mode 100644 index 0000000..b7edb14 Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/iTunes-small.bplist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/int64.bplist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/int64.bplist new file mode 100644 index 0000000..6da9c04 Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/int64.bplist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/int64.xml b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/int64.xml new file mode 100644 index 0000000..cc6cb03 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/int64.xml @@ -0,0 +1,10 @@ + + + + + zero + 0 + int64item + 12345678901234567890 + + diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/parseTest.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/parseTest.js new file mode 100644 index 0000000..67e7bfa --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/parseTest.js @@ -0,0 +1,159 @@ +'use strict'; + +// tests are adapted from https://github.com/TooTallNate/node-plist + +var path = require('path'); +var nodeunit = require('nodeunit'); +var bplist = require('../'); + +module.exports = { + 'iTunes Small': function (test) { + var file = path.join(__dirname, "iTunes-small.bplist"); + var startTime1 = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime1) + 'ms'); + var dict = dicts[0]; + test.equal(dict['Application Version'], "9.0.3"); + test.equal(dict['Library Persistent ID'], "6F81D37F95101437"); + test.done(); + }); + }, + + 'sample1': function (test) { + var file = path.join(__dirname, "sample1.bplist"); + var startTime = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); + var dict = dicts[0]; + test.equal(dict['CFBundleIdentifier'], 'com.apple.dictionary.MySample'); + test.done(); + }); + }, + + 'sample2': function (test) { + var file = path.join(__dirname, "sample2.bplist"); + var startTime = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); + var dict = dicts[0]; + test.equal(dict['PopupMenu'][2]['Key'], "\n #import \n\n#import \n\nint main(int argc, char *argv[])\n{\n return macruby_main(\"rb_main.rb\", argc, argv);\n}\n"); + test.done(); + }); + }, + + 'airplay': function (test) { + var file = path.join(__dirname, "airplay.bplist"); + var startTime = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); + + var dict = dicts[0]; + test.equal(dict['duration'], 5555.0495000000001); + test.equal(dict['position'], 4.6269989039999997); + test.done(); + }); + }, + + 'utf16': function (test) { + var file = path.join(__dirname, "utf16.bplist"); + var startTime = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); + + var dict = dicts[0]; + test.equal(dict['CFBundleName'], 'sellStuff'); + test.equal(dict['CFBundleShortVersionString'], '2.6.1'); + test.equal(dict['NSHumanReadableCopyright'], '©2008-2012, sellStuff, Inc.'); + test.done(); + }); + }, + + 'utf16chinese': function (test) { + var file = path.join(__dirname, "utf16_chinese.plist"); + var startTime = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); + + var dict = dicts[0]; + test.equal(dict['CFBundleName'], '天翼阅读'); + test.equal(dict['CFBundleDisplayName'], '天翼阅读'); + test.done(); + }); + }, + + + + 'uid': function (test) { + var file = path.join(__dirname, "uid.bplist"); + var startTime = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); + + var dict = dicts[0]; + test.deepEqual(dict['$objects'][1]['NS.keys'], [{UID:2}, {UID:3}, {UID:4}]); + test.deepEqual(dict['$objects'][1]['NS.objects'], [{UID: 5}, {UID:6}, {UID:7}]); + test.deepEqual(dict['$top']['root'], {UID:1}); + test.done(); + }); + }, + + 'int64': function (test) { + var file = path.join(__dirname, "int64.bplist"); + var startTime = new Date(); + + bplist.parseFile(file, function (err, dicts) { + if (err) { + throw err; + } + + var endTime = new Date(); + console.log('Parsed "' + file + '" in ' + (endTime - startTime) + 'ms'); + var dict = dicts[0]; + test.equal(dict['zero'], '0'); + test.equal(dict['int64item'], '12345678901234567890'); + test.done(); + }); + } +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/sample1.bplist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/sample1.bplist new file mode 100644 index 0000000..5b808ff Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/sample1.bplist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/sample2.bplist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/sample2.bplist new file mode 100644 index 0000000..fc42979 Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/sample2.bplist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/uid.bplist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/uid.bplist new file mode 100644 index 0000000..59f341e Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/uid.bplist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/utf16.bplist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/utf16.bplist new file mode 100644 index 0000000..ba4bcfa Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/utf16.bplist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/utf16_chinese.plist b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/utf16_chinese.plist new file mode 100755 index 0000000..ba1e2d7 Binary files /dev/null and b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/bplist-parser/test/utf16_chinese.plist differ diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/LICENSE b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/LICENSE new file mode 100644 index 0000000..de32266 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2013 Julian Gruber + +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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/README.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/README.md new file mode 100644 index 0000000..6b4e0e1 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/README.md @@ -0,0 +1,129 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) +[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## Sponsors + +This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)! + +Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)! + +## 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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/index.js new file mode 100644 index 0000000..0478be8 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/package.json new file mode 100644 index 0000000..098b5e0 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/brace-expansion/package.json @@ -0,0 +1,75 @@ +{ + "_from": "brace-expansion@^1.1.7", + "_id": "brace-expansion@1.1.11", + "_inBundle": false, + "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "_location": "/alfred-mvns/brace-expansion", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "brace-expansion@^1.1.7", + "name": "brace-expansion", + "escapedName": "brace-expansion", + "rawSpec": "^1.1.7", + "saveSpec": null, + "fetchSpec": "^1.1.7" + }, + "_requiredBy": [ + "/alfred-mvns/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd", + "_spec": "brace-expansion@^1.1.7", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/minimatch", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "bundleDependencies": false, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + }, + "deprecated": false, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "matcha": "^0.7.0", + "tape": "^4.6.0" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "name": "brace-expansion", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "bench": "matcha test/perf/bench.js", + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.11" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/builtin-modules.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/builtin-modules.json new file mode 100644 index 0000000..72670f6 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/builtin-modules.json @@ -0,0 +1,35 @@ +[ + "assert", + "buffer", + "child_process", + "cluster", + "console", + "constants", + "crypto", + "dgram", + "dns", + "domain", + "events", + "fs", + "http", + "https", + "module", + "net", + "os", + "path", + "process", + "punycode", + "querystring", + "readline", + "repl", + "stream", + "string_decoder", + "timers", + "tls", + "tty", + "url", + "util", + "v8", + "vm", + "zlib" +] diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/index.js new file mode 100644 index 0000000..9ef35ab --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/index.js @@ -0,0 +1,10 @@ +'use strict'; + +var blacklist = [ + 'freelist', + 'sys' +]; + +module.exports = Object.keys(process.binding('natives')).filter(function (el) { + return !/^_|^internal|\//.test(el) && blacklist.indexOf(el) === -1; +}).sort(); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/package.json new file mode 100644 index 0000000..6750fc6 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/package.json @@ -0,0 +1,72 @@ +{ + "_from": "builtin-modules@^1.0.0", + "_id": "builtin-modules@1.1.1", + "_inBundle": false, + "_integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "_location": "/alfred-mvns/builtin-modules", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "builtin-modules@^1.0.0", + "name": "builtin-modules", + "escapedName": "builtin-modules", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/is-builtin-module" + ], + "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "_shasum": "270f076c5a72c02f5b65a47df94c5fe3a278892f", + "_spec": "builtin-modules@^1.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/is-builtin-module", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/builtin-modules/issues" + }, + "bundleDependencies": false, + "deprecated": false, + "description": "List of the Node.js builtin modules", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js", + "static.js", + "builtin-modules.json" + ], + "homepage": "https://github.com/sindresorhus/builtin-modules#readme", + "keywords": [ + "builtin", + "built-in", + "builtins", + "node", + "modules", + "core", + "bundled", + "list", + "array", + "names" + ], + "license": "MIT", + "name": "builtin-modules", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/builtin-modules.git" + }, + "scripts": { + "make": "node make.js", + "test": "xo && ava" + }, + "version": "1.1.1" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/readme.md new file mode 100644 index 0000000..f1894b1 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/readme.md @@ -0,0 +1,41 @@ +# builtin-modules [![Build Status](https://travis-ci.org/sindresorhus/builtin-modules.svg?branch=master)](https://travis-ci.org/sindresorhus/builtin-modules) + +> List of the Node.js builtin modules + +The list is just a [JSON file](builtin-modules.json) and can be used wherever. + + +## Install + +``` +$ npm install --save builtin-modules +``` + + +## Usage + +```js +var builtinModules = require('builtin-modules'); + +console.log(builinModules); +//=> ['assert', 'buffer', ...] +``` + + +## API + +Returns an array of builtin modules fetched from the running Node.js version. + +### Static list + +This module also comes bundled with a static array of builtin modules generated from the latest Node.js version. You can get it with `require('builtin-modules/static');` + + +## Related + +- [is-builtin-module](https://github.com/sindresorhus/is-builtin-module) - Check if a string matches the name of a Node.js builtin module + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/static.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/static.js new file mode 100644 index 0000000..9508f8f --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/builtin-modules/static.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = require('./builtin-modules.json'); diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/index.js new file mode 100644 index 0000000..86af803 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/index.js @@ -0,0 +1,82 @@ +'use strict'; +const path = require('path'); +const Conf = require('conf'); +const pkgUp = require('pkg-up'); + +const parentDir = path.dirname(module.parent.filename); + +class CacheConf extends Conf { + + constructor(options) { + const pkgPath = pkgUp.sync(parentDir); + + options = Object.assign({ + projectName: pkgPath && require(pkgPath).name // eslint-disable-line import/no-dynamic-require + }, options); + + super(options); + + this.version = options.version; + } + + get(key) { + if (this.isExpired(key)) { + super.delete(key); + return; + } + + const item = super.get(key); + + return item && item.data; + } + + set(key, val, opts) { + opts = opts || {}; + + if (typeof key === 'object') { + opts = val || {}; + + Object.keys(key).forEach(k => { + super.set(k, { + timestamp: opts.maxAge && Date.now() + opts.maxAge, + version: this.version, + data: key[k] + }); + }); + } else { + super.set(key, { + timestamp: opts.maxAge && Date.now() + opts.maxAge, + version: this.version, + data: val + }); + } + } + + has(key) { + if (!super.has(key)) { + return false; + } + + if (this.isExpired(key)) { + super.delete(key); + return false; + } + + return true; + } + + isExpired(key) { + const item = super.get(key); + + if (!item) { + return false; + } + + const invalidTimestamp = item.timestamp && item.timestamp < Date.now(); + const invalidVersion = item.version !== this.version; + + return Boolean(invalidTimestamp || invalidVersion); + } +} + +module.exports = CacheConf; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/license new file mode 100644 index 0000000..78b0855 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sam Verschueren (github.com/SamVerschueren) + +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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/package.json new file mode 100644 index 0000000..903380f --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/package.json @@ -0,0 +1,86 @@ +{ + "_from": "cache-conf@^0.3.0", + "_id": "cache-conf@0.3.0", + "_inBundle": false, + "_integrity": "sha1-3iJPgkTq+Ua+pPyOSaub0p860U4=", + "_location": "/alfred-mvns/cache-conf", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "cache-conf@^0.3.0", + "name": "cache-conf", + "escapedName": "cache-conf", + "rawSpec": "^0.3.0", + "saveSpec": null, + "fetchSpec": "^0.3.0" + }, + "_requiredBy": [ + "/alfred-mvns/alfy" + ], + "_resolved": "https://registry.npmjs.org/cache-conf/-/cache-conf-0.3.0.tgz", + "_shasum": "de224f8244eaf946bea4fc8e49ab9bd29f3ad14e", + "_spec": "cache-conf@^0.3.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/alfy", + "author": { + "name": "Sam Verschueren", + "email": "sam.verschueren@gmail.com", + "url": "github.com/SamVerschueren" + }, + "bugs": { + "url": "https://github.com/SamVerschueren/cache-conf/issues" + }, + "bundleDependencies": false, + "dependencies": { + "conf": "^0.11.2", + "pkg-up": "^1.0.0" + }, + "deprecated": false, + "description": "Simple cache config handling for your app or module", + "devDependencies": { + "ava": "*", + "delay": "^1.3.1", + "tempfile": "^1.1.1", + "xo": "*" + }, + "engines": { + "node": ">=4" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/SamVerschueren/cache-conf#readme", + "keywords": [ + "cache", + "caching", + "config", + "store", + "app", + "storage", + "conf", + "configuration", + "settings", + "preferences", + "json", + "data", + "persist", + "persistent", + "save", + "load", + "read", + "write" + ], + "license": "MIT", + "name": "cache-conf", + "repository": { + "type": "git", + "url": "git+https://github.com/SamVerschueren/cache-conf.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "0.3.0", + "xo": { + "esnext": true + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/readme.md new file mode 100644 index 0000000..fb4a103 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/cache-conf/readme.md @@ -0,0 +1,83 @@ +# cache-conf [![Build Status](https://travis-ci.org/SamVerschueren/cache-conf.svg?branch=master)](https://travis-ci.org/SamVerschueren/cache-conf) + +> Simple cache config handling for your app or module + +If you don't need caching, you should use [conf](https://github.com/sindresorhus/conf) instead. This module extends that module and +abstracts away the caching mechanism. + + +## Install + +``` +$ npm install --save cache-conf +``` + + +## Usage + +```js +const delay = require('delay'); +const CacheConf = require('cache-conf'); +const config = new CacheConf(); + +config.set('unicorn', '🦄', {maxAge: 5000}); +console.log(config.get('unicorn')); +//=> '🦄' + +// Wait 5 seconds +await delay(5000); + +console.log(config.get('unicorn')); +//=> undefined +``` + + +## API + +### CacheConf([options]) + +Returns a new instance. + +#### options + +Any of the [conf options](https://github.com/sindresorhus/conf#options). + +### Instance + +An extended [conf](https://github.com/sindresorhus/conf#instance) instance. + +#### set(key, value, [options]) + +Set an item. + +#### set(object, [options]) + +Set multiple items at once. + +##### options + +###### maxAge + +Type: `number` + +Number of milliseconds the cached value is valid. + +###### version + +Type: `string` + +Version number of the data. If the version provided is not the same as the version of the cached data, the data will be invalid. + +#### isExpired(key) + +Boolean indicating if the cached data is expired. + + +## Related + +- [conf](https://github.com/sindresorhus/conf) - Simple config handling for your app or module + + +## License + +MIT © [Sam Verschueren](https://github.com/SamVerschueren) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/index.js new file mode 100644 index 0000000..1b696c8 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/index.js @@ -0,0 +1,18 @@ +'use strict'; + +module.exports = Error.captureStackTrace || function (error) { + var container = new Error(); + + Object.defineProperty(error, 'stack', { + configurable: true, + get: function getStack() { + var stack = container.stack; + + Object.defineProperty(this, 'stack', { + value: stack + }); + + return stack; + } + }); +}; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/license new file mode 100644 index 0000000..1aeb74f --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Vsevolod Strukchinsky (github.com/floatdrop) + +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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/package.json new file mode 100644 index 0000000..742e9bb --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/package.json @@ -0,0 +1,61 @@ +{ + "_from": "capture-stack-trace@^1.0.0", + "_id": "capture-stack-trace@1.0.1", + "_inBundle": false, + "_integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", + "_location": "/alfred-mvns/capture-stack-trace", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "capture-stack-trace@^1.0.0", + "name": "capture-stack-trace", + "escapedName": "capture-stack-trace", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/create-error-class" + ], + "_resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "_shasum": "a6c0bbe1f38f3aa0b92238ecb6ff42c344d4135d", + "_spec": "capture-stack-trace@^1.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/create-error-class", + "author": { + "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", + "url": "github.com/floatdrop" + }, + "bugs": { + "url": "https://github.com/floatdrop/capture-stack-trace/issues" + }, + "bundleDependencies": false, + "dependencies": {}, + "deprecated": false, + "description": "Error.captureStackTrace ponyfill", + "devDependencies": { + "mocha": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/floatdrop/capture-stack-trace#readme", + "keywords": [ + "Error", + "captureStackTrace" + ], + "license": "MIT", + "name": "capture-stack-trace", + "repository": { + "type": "git", + "url": "git+https://github.com/floatdrop/capture-stack-trace.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "1.0.1" +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/readme.md new file mode 100644 index 0000000..a944ab9 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/capture-stack-trace/readme.md @@ -0,0 +1,36 @@ +# capture-stack-trace [![Build Status](https://travis-ci.org/floatdrop/capture-stack-trace.svg?branch=master)](https://travis-ci.org/floatdrop/capture-stack-trace) + +> Ponyfill for Error.captureStackTrace + + +## Install + +``` +$ npm install --save capture-stack-trace +``` + + +## Usage + +```js +var captureStackTrace = require('capture-stack-trace'); + +captureStackTrace({}); +// => {stack: ...} +``` + + +## API + +### captureStackTrace(error) + +#### error + +*Required* +Type: `Object` + +Target Object, that will recieve stack property. + +## License + +MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop) diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/index.js b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/index.js new file mode 100644 index 0000000..2d85a91 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/index.js @@ -0,0 +1,116 @@ +'use strict'; +var escapeStringRegexp = require('escape-string-regexp'); +var ansiStyles = require('ansi-styles'); +var stripAnsi = require('strip-ansi'); +var hasAnsi = require('has-ansi'); +var supportsColor = require('supports-color'); +var defineProps = Object.defineProperties; +var isSimpleWindowsTerm = process.platform === 'win32' && !/^xterm/i.test(process.env.TERM); + +function Chalk(options) { + // detect mode if not set manually + this.enabled = !options || options.enabled === undefined ? supportsColor : options.enabled; +} + +// use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001b[94m'; +} + +var styles = (function () { + var ret = {}; + + Object.keys(ansiStyles).forEach(function (key) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + ret[key] = { + get: function () { + return build.call(this, this._styles.concat(key)); + } + }; + }); + + return ret; +})(); + +var proto = defineProps(function chalk() {}, styles); + +function build(_styles) { + var builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder.enabled = this.enabled; + // __proto__ is used because we must return a function, but there is + // no way to create a function with a different prototype. + /* eslint-disable no-proto */ + builder.__proto__ = proto; + + return builder; +} + +function applyStyle() { + // support varags, but simply cast to string in case there's only one arg + var args = arguments; + var argsLen = args.length; + var str = argsLen !== 0 && String(arguments[0]); + + if (argsLen > 1) { + // don't slice `arguments`, it prevents v8 optimizations + for (var a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || !str) { + return str; + } + + var nestedStyles = this._styles; + var i = nestedStyles.length; + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + var originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && (nestedStyles.indexOf('gray') !== -1 || nestedStyles.indexOf('grey') !== -1)) { + ansiStyles.dim.open = ''; + } + + while (i--) { + var code = ansiStyles[nestedStyles[i]]; + + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + } + + // Reset the original 'dim' if we changed it to work around the Windows dimmed gray issue. + ansiStyles.dim.open = originalDim; + + return str; +} + +function init() { + var ret = {}; + + Object.keys(styles).forEach(function (name) { + ret[name] = { + get: function () { + return build.call(this, [name]); + } + }; + }); + + return ret; +} + +defineProps(Chalk.prototype, init()); + +module.exports = new Chalk(); +module.exports.styles = ansiStyles; +module.exports.hasColor = hasAnsi; +module.exports.stripColor = stripAnsi; +module.exports.supportsColor = supportsColor; diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/license b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/package.json b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/package.json new file mode 100644 index 0000000..073b1c0 --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/package.json @@ -0,0 +1,114 @@ +{ + "_from": "chalk@^1.0.0", + "_id": "chalk@1.1.3", + "_inBundle": false, + "_integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "_location": "/alfred-mvns/chalk", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "chalk@^1.0.0", + "name": "chalk", + "escapedName": "chalk", + "rawSpec": "^1.0.0", + "saveSpec": null, + "fetchSpec": "^1.0.0" + }, + "_requiredBy": [ + "/alfred-mvns/sudo-block" + ], + "_resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "_shasum": "a8115c55e4a702fe4d150abd3872822a7e09fc98", + "_spec": "chalk@^1.0.0", + "_where": "/usr/local/lib/node_modules/alfred-mvns/node_modules/sudo-block", + "bugs": { + "url": "https://github.com/chalk/chalk/issues" + }, + "bundleDependencies": false, + "dependencies": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "deprecated": false, + "description": "Terminal string styling done right. Much color.", + "devDependencies": { + "coveralls": "^2.11.2", + "matcha": "^0.6.0", + "mocha": "*", + "nyc": "^3.0.0", + "require-uncached": "^1.0.2", + "resolve-from": "^1.0.0", + "semver": "^4.3.3", + "xo": "*" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/chalk/chalk#readme", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "license": "MIT", + "maintainers": [ + { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + { + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" + }, + { + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" + } + ], + "name": "chalk", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/chalk.git" + }, + "scripts": { + "bench": "matcha benchmark.js", + "coverage": "nyc npm test && nyc report", + "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls", + "test": "xo && mocha" + }, + "version": "1.1.3", + "xo": { + "envs": [ + "node", + "mocha" + ] + } +} diff --git a/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/readme.md b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/readme.md new file mode 100644 index 0000000..5cf111e --- /dev/null +++ b/alfred/Alfred.alfredpreferences/workflows/user.workflow.89674631-3A28-4885-92F0-2FB102B395CE/node_modules/chalk/readme.md @@ -0,0 +1,213 @@ +

+
+
+ chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) +[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master) +[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough. + +**Chalk is a clean and focused alternative.** + +![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png) + + +## Why + +- Highly performant +- Doesn't extend `String.prototype` +- Expressive API +- Ability to nest styles +- Clean and focused +- Auto-detects color support +- Actively maintained +- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015 + + +## Install + +``` +$ npm install --save chalk +``` + + +## Usage + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +var chalk = require('chalk'); + +// style a string +chalk.blue('Hello world!'); + +// combine styled and normal strings +chalk.blue('Hello') + 'World' + chalk.red('!'); + +// compose multiple styles using the chainable API +chalk.blue.bgRed.bold('Hello world!'); + +// pass in multiple arguments +chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'); + +// nest styles +chalk.red('Hello', chalk.underline.bgBlue('world') + '!'); + +// nest styles of the same type even (color, underline, background) +chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +); +``` + +Easily define your own themes. + +```js +var chalk = require('chalk'); +var error = chalk.bold.red; +console.log(error('Error!')); +``` + +Take advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data). + +```js +var name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> Hello Sindre +``` + + +## API + +### chalk.`